feat: 页面优化
This commit is contained in:
@ -15,23 +15,35 @@ class MainController extends GetxController {
|
||||
RxList navigationBars = [
|
||||
{
|
||||
'icon': const Icon(
|
||||
Icons.motion_photos_on_outlined,
|
||||
Icons.favorite_outline,
|
||||
size: 21,
|
||||
),
|
||||
'label': "推荐",
|
||||
'selectIcon': const Icon(
|
||||
Icons.favorite,
|
||||
size: 21,
|
||||
),
|
||||
'label': "首页",
|
||||
},
|
||||
{
|
||||
'icon': const Icon(
|
||||
Icons.bolt,
|
||||
Icons.motion_photos_on_outlined,
|
||||
size: 21,
|
||||
),
|
||||
'selectIcon': const Icon(
|
||||
Icons.motion_photos_on,
|
||||
size: 21,
|
||||
),
|
||||
'label': "动态",
|
||||
},
|
||||
{
|
||||
'icon': const Icon(
|
||||
Icons.folder_open_outlined,
|
||||
Icons.folder_outlined,
|
||||
size: 20,
|
||||
),
|
||||
'selectIcon': const Icon(
|
||||
Icons.folder,
|
||||
size: 21,
|
||||
),
|
||||
'label': "媒体库",
|
||||
}
|
||||
].obs;
|
||||
|
||||
@ -135,21 +135,17 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
|
||||
initialData: true,
|
||||
builder: (context, AsyncSnapshot snapshot) {
|
||||
return AnimatedSlide(
|
||||
curve: Curves.linear,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOutCubicEmphasized,
|
||||
duration: const Duration(milliseconds: 1000),
|
||||
offset: Offset(0, snapshot.data ? 0 : 1),
|
||||
child: BottomNavigationBar(
|
||||
currentIndex: selectedIndex,
|
||||
// type: BottomNavigationBarType.shifting,
|
||||
selectedItemColor: Theme.of(context).colorScheme.primary,
|
||||
unselectedItemColor:
|
||||
Theme.of(context).colorScheme.outline.withOpacity(0.5),
|
||||
selectedFontSize: 12.4,
|
||||
onTap: (value) => setIndex(value),
|
||||
items: [
|
||||
child: NavigationBar(
|
||||
onDestinationSelected: (value) => setIndex(value),
|
||||
selectedIndex: selectedIndex,
|
||||
destinations: <Widget>[
|
||||
..._mainController.navigationBars.map((e) {
|
||||
return BottomNavigationBarItem(
|
||||
return NavigationDestination(
|
||||
icon: e['icon'],
|
||||
selectedIcon: e['selectIcon'],
|
||||
label: e['label'],
|
||||
);
|
||||
}).toList(),
|
||||
|
||||
Reference in New Issue
Block a user