28 lines
978 B
Dart
28 lines
978 B
Dart
import 'package:blog_app/pages/blog_page.dart';
|
|
import 'package:blog_app/pages/category_page.dart';
|
|
import 'package:blog_app/pages/stats_page.dart';
|
|
import 'package:blog_app/pages/timeline_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: BlogPage()),
|
|
PageInfo(title: '分类', icon: Icons.folder, page: CategoryPage()),
|
|
PageInfo(title: '归档', icon: Icons.archive, page: TimelinePage()),
|
|
PageInfo(title: '统计', icon: Icons.insert_chart, page: StatsPage()),
|
|
];
|
|
|
|
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();
|