-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
coolrc136
committed
Nov 29, 2021
1 parent
bbbbfb9
commit 817ea28
Showing
28 changed files
with
439 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
{ | ||
// 使用 IntelliSense 了解相关属性。 | ||
// 悬停以查看现有属性的描述。 | ||
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Flutter Debug", | ||
"type": "dart", | ||
"name": "jandan", | ||
"request": "launch", | ||
"program": "lib/main.dart" | ||
"type": "dart" | ||
}, | ||
{ | ||
"name": "jandan (profile mode)", | ||
"request": "launch", | ||
"type": "dart", | ||
"flutterMode": "profile" | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...tlin/com/fitwallet/online/MainActivity.kt → ...kotlin/com/example/jandan/MainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.fitwallet.online | ||
package com.example.jandan | ||
|
||
import io.flutter.embedding.android.FlutterActivity | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" | ||
#include "Generated.xcconfig" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" | ||
#include "Generated.xcconfig" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/widgets.dart'; | ||
import 'package:jandan/page/home/wuliao/wuliao_page.dart'; | ||
import 'package:pull_to_refresh/pull_to_refresh.dart'; | ||
|
||
class MyHomePage extends StatelessWidget { | ||
MyHomePage({Key? key}) : super(key: key); | ||
static const buttonMargin = 40.0; //左右边距 | ||
static const buttonPadding = 15.0; //按钮内部上下边距 | ||
|
||
final RefreshController _wuliaorefreshController = | ||
RefreshController(initialRefresh: false); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: DefaultTabController( | ||
length: 5, | ||
child: NestedScrollView( | ||
floatHeaderSlivers: true, | ||
headerSliverBuilder: (context, innerBoxIsScrolled) { | ||
return [ | ||
SliverAppBar( | ||
pinned: true, | ||
floating: true, | ||
snap: true, | ||
title: const Text("Jandan"), | ||
bottom: TabBar( | ||
tabs: const [ | ||
Tab(text: "新鲜事"), | ||
Tab(text: "热榜"), | ||
Tab(text: "无聊图"), | ||
Tab(text: "随手拍"), | ||
Tab(text: "树洞"), | ||
], | ||
onTap: (position) { | ||
//TODO:双击刷新 | ||
_wuliaorefreshController.requestRefresh(); | ||
}, | ||
), | ||
), | ||
]; | ||
}, | ||
body: TabBarView( | ||
children: [ | ||
const Icon(Icons.directions_car), | ||
const Icon(Icons.directions_car), | ||
WuliaoPage(refreshController: _wuliaorefreshController), | ||
const Icon(Icons.directions_bike), | ||
const Icon(Icons.directions_bike), | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} | ||
|
||
|
||
|
||
// return DefaultTabController( | ||
// length: 5, | ||
// child: Scaffold( | ||
// appBar: AppBar( | ||
// bottom: const TabBar( | ||
// tabs: [ | ||
// Tab(text: "新鲜事"), | ||
// Tab(text: "热榜"), | ||
// Tab(text: "无聊图"), | ||
// Tab(text: "随手拍"), | ||
// Tab(text: "树洞"), | ||
// ], | ||
// ), | ||
// title: const Text('Jandan'), | ||
// ), | ||
// body: TabBarView( | ||
// children: [ | ||
// const Icon(Icons.directions_car), | ||
// const Icon(Icons.directions_car), | ||
// WuliaoPage(refreshController: _wuliaorefreshController), | ||
// const Icon(Icons.directions_bike), | ||
// const Icon(Icons.directions_bike), | ||
// ], | ||
// ), | ||
// ), | ||
// ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/widgets.dart'; | ||
import 'package:pull_to_refresh/pull_to_refresh.dart'; | ||
|
||
class WuliaoPage extends StatelessWidget { | ||
const WuliaoPage({Key? key, required this.refreshController}) | ||
: super(key: key); | ||
final RefreshController refreshController; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return SmartRefresher( | ||
onRefresh: () { | ||
Future.delayed(Duration(seconds: 3), () { | ||
refreshController.refreshCompleted(); | ||
}); | ||
}, | ||
controller: refreshController, | ||
enablePullDown: true, | ||
enablePullUp: true, | ||
child: ListView.builder( | ||
itemCount: 12, | ||
shrinkWrap: true, | ||
itemBuilder: (context, idx) { | ||
return Text("asd"); | ||
}), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.