- introPage.dart: Convert fireItems to proper static function closure - mainDrawer.dart: Convert unreadCount int to String for Text widget
50 lines
1.4 KiB
Dart
50 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class CustomBottomAppBar extends StatelessWidget {
|
|
const CustomBottomAppBar(
|
|
{super.key, this.fabLocation,
|
|
this.showNotch = false,
|
|
this.height = 56.0,
|
|
this.color = Colors.black45,
|
|
this.mainAxisAlignment = MainAxisAlignment.center,
|
|
this.actions = const <Widget>[]});
|
|
|
|
final Color color;
|
|
final double height;
|
|
final MainAxisAlignment mainAxisAlignment;
|
|
final FloatingActionButtonLocation? fabLocation;
|
|
final bool showNotch;
|
|
final List<Widget> actions;
|
|
|
|
static final List<FloatingActionButtonLocation> kCenterLocations =
|
|
<FloatingActionButtonLocation>[
|
|
FloatingActionButtonLocation.centerDocked,
|
|
FloatingActionButtonLocation.centerFloat,
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final List<Widget> rowContents = <Widget>[SizedBox(height: height)];
|
|
|
|
if (kCenterLocations.contains(fabLocation)) {
|
|
/* rowContents.add(
|
|
const Expanded(child: const SizedBox()),
|
|
); */
|
|
}
|
|
|
|
rowContents.addAll(actions);
|
|
|
|
return showNotch
|
|
? BottomAppBar(
|
|
color: color,
|
|
shape: const CircularNotchedRectangle(),
|
|
child: Row(
|
|
mainAxisAlignment: mainAxisAlignment, children: rowContents),
|
|
)
|
|
: BottomAppBar(
|
|
color: color,
|
|
child: Row(
|
|
mainAxisAlignment: mainAxisAlignment, children: rowContents),
|
|
);
|
|
}
|
|
}
|