feat:增加数据存储
This commit is contained in:
27
lib/models/menu.dart
Normal file
27
lib/models/menu.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
import 'package:fitnote/pages/history_page.dart';
|
||||
import 'package:fitnote/pages/record_page.dart';
|
||||
import 'package:fitnote/pages/setting_page.dart';
|
||||
import 'package:fitnote/pages/stats_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PageInfo {
|
||||
final String title;
|
||||
final IconData icon;
|
||||
final Widget page;
|
||||
|
||||
const PageInfo({required this.title, required this.icon, required this.page});
|
||||
}
|
||||
|
||||
final List<PageInfo> pages = [
|
||||
PageInfo(title: '记录', icon: Icons.article, page: RecordPage()),
|
||||
PageInfo(title: '历史', icon: Icons.history, page: HistoryPage()),
|
||||
PageInfo(title: '统计', icon: Icons.insert_chart, page: StatsPage()),
|
||||
PageInfo(title: '设置', icon: Icons.settings, page: SettingPage()),
|
||||
];
|
||||
|
||||
final List<Widget> pageWidgets = pages.map((item) => item.page).toList();
|
||||
|
||||
final List<BottomNavigationBarItem> bottomNavItems =
|
||||
pages.map((page) {
|
||||
return BottomNavigationBarItem(icon: Icon(page.icon), label: page.title);
|
||||
}).toList();
|
||||
Reference in New Issue
Block a user