优化bug
This commit is contained in:
@@ -18,8 +18,8 @@ class _LayoutPageState extends State<LayoutPage> {
|
||||
final PageController _pageController = PageController(initialPage: 0);
|
||||
|
||||
int get currentPage {
|
||||
if (!_pageController.hasClients) return 1; // 没 attach 直接 0
|
||||
return _pageController.page?.round() ?? 1;
|
||||
if (!_pageController.hasClients) return 0; // 没 attach 直接 0
|
||||
return _pageController.page?.round() ?? 0;
|
||||
}
|
||||
|
||||
//TabBar列表
|
||||
@@ -29,9 +29,13 @@ class _LayoutPageState extends State<LayoutPage> {
|
||||
icon: RemixIcons.home_2_line,
|
||||
page: HomePage(),
|
||||
),
|
||||
PageItem(name: "record", icon: RemixIcons.history_line, page: RecordListPage()),
|
||||
PageItem(
|
||||
name: "Home",
|
||||
name: "Record",
|
||||
icon: RemixIcons.history_line,
|
||||
page: RecordListPage(),
|
||||
),
|
||||
PageItem(
|
||||
name: "My",
|
||||
icon: RemixIcons.book_open_line,
|
||||
page: MyPage(),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user