mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-07-15 03:04:25 +08:00
modify home.dart bottom tab
This commit is contained in:
@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:flutter_go/utils/shared_preferences.dart';
|
import 'package:flutter_go/utils/shared_preferences.dart';
|
||||||
import 'package:flutter_go/views/first_page/first_page.dart';
|
import 'package:flutter_go/views/first_page/first_page.dart';
|
||||||
|
import 'package:flutter_go/views/first_page/main_page.dart';
|
||||||
import 'package:flutter_go/views/widget_page/widget_page.dart';
|
import 'package:flutter_go/views/widget_page/widget_page.dart';
|
||||||
import 'package:flutter_go/views/welcome_page/fourth_page.dart';
|
import 'package:flutter_go/views/welcome_page/fourth_page.dart';
|
||||||
import 'package:flutter_go/views/collection_page/collection_page.dart';
|
import 'package:flutter_go/views/collection_page/collection_page.dart';
|
||||||
@ -60,7 +61,8 @@ class _MyHomePageState extends State<AppPage>
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
list
|
list
|
||||||
..add(FirstPage())
|
// ..add(FirstPage())
|
||||||
|
..add(MainPage())
|
||||||
..add(WidgetPage(Provider.db))
|
..add(WidgetPage(Provider.db))
|
||||||
..add(CollectionPage())
|
..add(CollectionPage())
|
||||||
..add(FourthPage());
|
..add(FourthPage());
|
||||||
@ -115,11 +117,18 @@ class _MyHomePageState extends State<AppPage>
|
|||||||
}, (value) {}, () {});
|
}, (value) {}, () {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderAppBar(BuildContext context,Widget widget,int index) {
|
||||||
|
print('renderAppBar=====>>>>>>${index}');
|
||||||
|
if(index == 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return AppBar(title: buildSearchInput(context));
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return new Scaffold(
|
return new Scaffold(
|
||||||
appBar: new AppBar(title: buildSearchInput(context)),
|
appBar: renderAppBar(context,widget,_currentIndex),
|
||||||
body: list[_currentIndex],
|
body: list[_currentIndex],
|
||||||
bottomNavigationBar: BottomNavigationBar(
|
bottomNavigationBar: BottomNavigationBar(
|
||||||
items: myTabs,
|
items: myTabs,
|
||||||
|
Reference in New Issue
Block a user