mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-08-03 17:20:16 +08:00
@@ -74,65 +74,61 @@ class FloatingNavigationBar extends StatelessWidget {
|
||||
|
||||
final padding = MediaQuery.viewPaddingOf(context);
|
||||
|
||||
return UnconstrainedBox(
|
||||
child: Padding(
|
||||
padding: .fromLTRB(
|
||||
padding.left,
|
||||
0,
|
||||
padding.right,
|
||||
bottomPadding + padding.bottom,
|
||||
),
|
||||
child: SizedBox(
|
||||
height: _kNavigationHeight,
|
||||
width: destinations.length * _kIndicatorWidth,
|
||||
child: DecoratedBox(
|
||||
decoration: ShapeDecoration(
|
||||
color: ElevationOverlay.applySurfaceTint(
|
||||
backgroundColor ??
|
||||
navigationBarTheme.backgroundColor ??
|
||||
defaults.backgroundColor!,
|
||||
surfaceTintColor ??
|
||||
navigationBarTheme.surfaceTintColor ??
|
||||
defaults.surfaceTintColor,
|
||||
elevation ??
|
||||
navigationBarTheme.elevation ??
|
||||
defaults.elevation!,
|
||||
),
|
||||
shape: RoundedSuperellipseBorder(
|
||||
side: defaults.borderSide,
|
||||
borderRadius: _kBorderRadius,
|
||||
),
|
||||
return Padding(
|
||||
padding: .fromLTRB(
|
||||
padding.left,
|
||||
0,
|
||||
padding.right,
|
||||
bottomPadding + padding.bottom,
|
||||
),
|
||||
child: SizedBox(
|
||||
height: _kNavigationHeight,
|
||||
width: destinations.length * _kIndicatorWidth,
|
||||
child: DecoratedBox(
|
||||
decoration: ShapeDecoration(
|
||||
color: ElevationOverlay.applySurfaceTint(
|
||||
backgroundColor ??
|
||||
navigationBarTheme.backgroundColor ??
|
||||
defaults.backgroundColor!,
|
||||
surfaceTintColor ??
|
||||
navigationBarTheme.surfaceTintColor ??
|
||||
defaults.surfaceTintColor,
|
||||
elevation ?? navigationBarTheme.elevation ?? defaults.elevation!,
|
||||
),
|
||||
child: Padding(
|
||||
padding: _kIndicatorPadding,
|
||||
child: Row(
|
||||
crossAxisAlignment: .stretch,
|
||||
children: <Widget>[
|
||||
for (int i = 0; i < destinations.length; i++)
|
||||
Expanded(
|
||||
child: _SelectableAnimatedBuilder(
|
||||
duration: animationDuration,
|
||||
isSelected: i == selectedIndex,
|
||||
builder: (context, animation) {
|
||||
return _NavigationDestinationInfo(
|
||||
index: i,
|
||||
selectedIndex: selectedIndex,
|
||||
totalNumberOfDestinations: destinations.length,
|
||||
selectedAnimation: animation,
|
||||
labelBehavior: effectiveLabelBehavior,
|
||||
indicatorColor: indicatorColor,
|
||||
indicatorShape: indicatorShape,
|
||||
overlayColor: overlayColor,
|
||||
onTap: _handleTap(i),
|
||||
labelTextStyle: labelTextStyle,
|
||||
labelPadding: labelPadding,
|
||||
child: destinations[i],
|
||||
);
|
||||
},
|
||||
),
|
||||
shape: RoundedSuperellipseBorder(
|
||||
side: defaults.borderSide,
|
||||
borderRadius: _kBorderRadius,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: _kIndicatorPadding,
|
||||
child: Row(
|
||||
crossAxisAlignment: .stretch,
|
||||
children: <Widget>[
|
||||
for (int i = 0; i < destinations.length; i++)
|
||||
Expanded(
|
||||
child: _SelectableAnimatedBuilder(
|
||||
duration: animationDuration,
|
||||
isSelected: i == selectedIndex,
|
||||
builder: (context, animation) {
|
||||
return _NavigationDestinationInfo(
|
||||
index: i,
|
||||
selectedIndex: selectedIndex,
|
||||
totalNumberOfDestinations: destinations.length,
|
||||
selectedAnimation: animation,
|
||||
labelBehavior: effectiveLabelBehavior,
|
||||
indicatorColor: indicatorColor,
|
||||
indicatorShape: indicatorShape,
|
||||
overlayColor: overlayColor,
|
||||
onTap: _handleTap(i),
|
||||
labelTextStyle: labelTextStyle,
|
||||
labelPadding: labelPadding,
|
||||
child: destinations[i],
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user