nc-photos/lib/widget/viewer_bottom_app_bar.dart

43 lines
1 KiB
Dart
Raw Normal View History

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
2021-08-13 19:30:47 +02:00
/// Button bar near the bottom of viewer
///
/// Buttons are spread evenly across the horizontal axis
class ViewerBottomAppBar extends StatelessWidget {
2021-09-15 08:58:06 +02:00
const ViewerBottomAppBar({
Key? key,
2021-08-13 19:30:47 +02:00
required this.children,
2021-09-15 08:58:06 +02:00
}) : super(key: key);
@override
build(BuildContext context) {
return Container(
height: kToolbarHeight,
alignment: Alignment.center,
2021-09-15 08:58:06 +02:00
decoration: const BoxDecoration(
gradient: LinearGradient(
2021-09-15 08:58:06 +02:00
begin: Alignment(0, -1),
end: Alignment(0, 1),
colors: [
Color.fromARGB(0, 0, 0, 0),
Color.fromARGB(192, 0, 0, 0),
],
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
2021-08-13 19:30:47 +02:00
children: children
.map((e) => Expanded(
flex: 1,
child: e,
))
.toList(),
),
);
}
2021-08-13 19:30:47 +02:00
final List<Widget> children;
}