mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-07-14 09:54:27 +08:00
添加 github Oauth ,个人中心
This commit is contained in:
@ -20,10 +20,16 @@ import 'package:flutter_go/widgets/index.dart';
|
||||
import 'package:flutter_go/components/search_input.dart';
|
||||
import 'package:flutter_go/model/search_history.dart';
|
||||
import 'package:flutter_go/resources/widget_name_to_icon.dart';
|
||||
import 'package:flutter_go/model/user_info.dart';
|
||||
|
||||
const int ThemeColor = 0xFFC91B3A;
|
||||
|
||||
class AppPage extends StatefulWidget {
|
||||
final UserInformation userInfo;
|
||||
|
||||
AppPage(this.userInfo);
|
||||
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
return _MyHomePageState();
|
||||
@ -32,6 +38,8 @@ class AppPage extends StatefulWidget {
|
||||
|
||||
class _MyHomePageState extends State<AppPage>
|
||||
with SingleTickerProviderStateMixin {
|
||||
|
||||
|
||||
SpUtil sp;
|
||||
WidgetControlModel widgetControl = new WidgetControlModel();
|
||||
SearchHistoryList searchHistoryList;
|
||||
@ -62,7 +70,7 @@ class _MyHomePageState extends State<AppPage>
|
||||
}
|
||||
list
|
||||
// ..add(FirstPage())
|
||||
..add(MainPage())
|
||||
..add(MainPage(userInfo:widget.userInfo))
|
||||
..add(WidgetPage(Provider.db))
|
||||
..add(CollectionPage())
|
||||
..add(FourthPage());
|
||||
@ -98,7 +106,7 @@ class _MyHomePageState extends State<AppPage>
|
||||
}
|
||||
|
||||
Widget buildSearchInput(BuildContext context) {
|
||||
return new SearchInput((value) async {
|
||||
return new SearchInput((value) async {
|
||||
if (value != '') {
|
||||
List<WidgetPoint> list = await widgetControl.search(value);
|
||||
return list
|
||||
@ -107,7 +115,7 @@ class _MyHomePageState extends State<AppPage>
|
||||
icon: WidgetName2Icon.icons[item.name] ?? null,
|
||||
text: 'widget',
|
||||
onTap: () {
|
||||
onWidgetTap(item, context);
|
||||
onWidgetTap(item, context);
|
||||
},
|
||||
))
|
||||
.toList();
|
||||
@ -117,9 +125,9 @@ class _MyHomePageState extends State<AppPage>
|
||||
}, (value) {}, () {});
|
||||
}
|
||||
|
||||
renderAppBar(BuildContext context,Widget widget,int index) {
|
||||
renderAppBar(BuildContext context, Widget widget, int index) {
|
||||
print('renderAppBar=====>>>>>>${index}');
|
||||
if(index == 0) {
|
||||
if (index == 0) {
|
||||
return null;
|
||||
}
|
||||
return AppBar(title: buildSearchInput(context));
|
||||
@ -128,7 +136,7 @@ class _MyHomePageState extends State<AppPage>
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return new Scaffold(
|
||||
appBar: renderAppBar(context,widget,_currentIndex),
|
||||
appBar: renderAppBar(context, widget, _currentIndex),
|
||||
body: list[_currentIndex],
|
||||
bottomNavigationBar: BottomNavigationBar(
|
||||
items: myTabs,
|
||||
|
Reference in New Issue
Block a user