opt: navigationBar展示
This commit is contained in:
@ -127,7 +127,8 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
|
|||||||
},
|
},
|
||||||
children: _mainController.pages,
|
children: _mainController.pages,
|
||||||
),
|
),
|
||||||
bottomNavigationBar: StreamBuilder(
|
bottomNavigationBar: _mainController.navigationBars.length > 1
|
||||||
|
? StreamBuilder(
|
||||||
stream: _mainController.hideTabBar
|
stream: _mainController.hideTabBar
|
||||||
? _mainController.bottomBarStream.stream
|
? _mainController.bottomBarStream.stream
|
||||||
: StreamController<bool>.broadcast().stream,
|
: StreamController<bool>.broadcast().stream,
|
||||||
@ -137,8 +138,7 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
|
|||||||
curve: Curves.easeInOutCubicEmphasized,
|
curve: Curves.easeInOutCubicEmphasized,
|
||||||
duration: const Duration(milliseconds: 500),
|
duration: const Duration(milliseconds: 500),
|
||||||
offset: Offset(0, snapshot.data ? 0 : 1),
|
offset: Offset(0, snapshot.data ? 0 : 1),
|
||||||
child: Obx(
|
child: enableMYBar
|
||||||
() => enableMYBar
|
|
||||||
? NavigationBar(
|
? NavigationBar(
|
||||||
onDestinationSelected: (value) => setIndex(value),
|
onDestinationSelected: (value) => setIndex(value),
|
||||||
selectedIndex: _mainController.selectedIndex,
|
selectedIndex: _mainController.selectedIndex,
|
||||||
@ -147,15 +147,15 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
|
|||||||
return NavigationDestination(
|
return NavigationDestination(
|
||||||
icon: Obx(
|
icon: Obx(
|
||||||
() => Badge(
|
() => Badge(
|
||||||
label:
|
label: _mainController
|
||||||
_mainController.dynamicBadgeType.value ==
|
.dynamicBadgeType.value ==
|
||||||
DynamicBadgeMode.number
|
DynamicBadgeMode.number
|
||||||
? Text(e['count'].toString())
|
? Text(e['count'].toString())
|
||||||
: null,
|
: null,
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.fromLTRB(6, 0, 6, 0),
|
const EdgeInsets.fromLTRB(6, 0, 6, 0),
|
||||||
isLabelVisible:
|
isLabelVisible: _mainController
|
||||||
_mainController.dynamicBadgeType.value !=
|
.dynamicBadgeType.value !=
|
||||||
DynamicBadgeMode.hidden &&
|
DynamicBadgeMode.hidden &&
|
||||||
e['count'] > 0,
|
e['count'] > 0,
|
||||||
child: e['icon'],
|
child: e['icon'],
|
||||||
@ -178,15 +178,15 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
|
|||||||
return BottomNavigationBarItem(
|
return BottomNavigationBarItem(
|
||||||
icon: Obx(
|
icon: Obx(
|
||||||
() => Badge(
|
() => Badge(
|
||||||
label:
|
label: _mainController
|
||||||
_mainController.dynamicBadgeType.value ==
|
.dynamicBadgeType.value ==
|
||||||
DynamicBadgeMode.number
|
DynamicBadgeMode.number
|
||||||
? Text(e['count'].toString())
|
? Text(e['count'].toString())
|
||||||
: null,
|
: null,
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.fromLTRB(6, 0, 6, 0),
|
const EdgeInsets.fromLTRB(6, 0, 6, 0),
|
||||||
isLabelVisible:
|
isLabelVisible: _mainController
|
||||||
_mainController.dynamicBadgeType.value !=
|
.dynamicBadgeType.value !=
|
||||||
DynamicBadgeMode.hidden &&
|
DynamicBadgeMode.hidden &&
|
||||||
e['count'] > 0,
|
e['count'] > 0,
|
||||||
child: e['icon'],
|
child: e['icon'],
|
||||||
@ -198,10 +198,10 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
|
|||||||
}).toList(),
|
}).toList(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
)
|
||||||
|
: null,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -287,7 +287,7 @@ class _StyleSettingState extends State<StyleSetting> {
|
|||||||
ListTile(
|
ListTile(
|
||||||
dense: false,
|
dense: false,
|
||||||
onTap: () => Get.toNamed('/navbarSetting'),
|
onTap: () => Get.toNamed('/navbarSetting'),
|
||||||
title: Text('navbar设置', style: titleStyle),
|
title: Text('底部导航栏设置', style: titleStyle),
|
||||||
),
|
),
|
||||||
if (Platform.isAndroid)
|
if (Platform.isAndroid)
|
||||||
ListTile(
|
ListTile(
|
||||||
|
|||||||
Reference in New Issue
Block a user