opt: bar set (#862)

* opt: bar set

* opt: navbar

* fix: type
This commit is contained in:
My-Responsitories
2025-05-21 02:14:08 +08:00
committed by GitHub
parent acb3784071
commit 218e829fd4
19 changed files with 288 additions and 556 deletions

View File

@@ -1,68 +1,34 @@
import 'package:PiliPlus/models/common/enum_with_label.dart';
import 'package:PiliPlus/pages/dynamics/view.dart';
import 'package:PiliPlus/pages/home/view.dart';
import 'package:PiliPlus/pages/media/view.dart';
import 'package:flutter/material.dart';
// enum NavigationBarType {
// home(
// '首页',
// Icon(Icons.home_outlined, size: 23),
// Icon(Icons.home, size: 21),
// ),
// dynamics(
// '动态',
// Icon(Icons.motion_photos_on_outlined, size: 21),
// Icon(Icons.motion_photos_on, size: 21),
// ),
// media(
// '媒体库',
// Icon(Icons.video_collection_outlined, size: 21),
// Icon(Icons.video_collection, size: 21),
// );
enum NavigationBarType implements EnumWithLabel {
home(
'首页',
Icon(Icons.home_outlined, size: 23),
Icon(Icons.home, size: 21),
HomePage(),
),
dynamics(
'动态',
Icon(Icons.motion_photos_on_outlined, size: 21),
Icon(Icons.motion_photos_on, size: 21),
DynamicsPage(),
),
media(
'媒体库',
Icon(Icons.video_collection_outlined, size: 21),
Icon(Icons.video_collection, size: 21),
MediaPage(),
);
// final Icon icon;
// final Icon selectIcon;
// final String label;
@override
final String label;
final Icon icon;
final Icon selectIcon;
final Widget page;
// const NavigationBarType(this.label, this.icon, this.selectIcon);
// }
// TODO enum
List defaultNavigationBars = [
{
'id': 0,
'icon': const Icon(
Icons.home_outlined,
size: 23,
),
'selectIcon': const Icon(
Icons.home,
size: 23,
),
'label': "首页",
'count': 0,
},
{
'id': 1,
'icon': const Icon(
Icons.motion_photos_on_outlined,
size: 21,
),
'selectIcon': const Icon(
Icons.motion_photos_on,
size: 21,
),
'label': "动态",
'count': 0,
},
{
'id': 2,
'icon': const Icon(
Icons.video_collection_outlined,
size: 21,
),
'selectIcon': const Icon(
Icons.video_collection,
size: 21,
),
'label': "媒体库",
'count': 0,
}
];
const NavigationBarType(this.label, this.icon, this.selectIcon, this.page);
}