1
0
mirror of https://github.com/krawieck/lemmur/ synced 2024-12-13 00:56:13 +01:00
lemmur-app-android/lib/widgets/bottom_modal.dart
2021-01-03 18:43:39 +00:00

51 lines
1.5 KiB
Dart

import 'package:flutter/material.dart';
/// Should be spawned with a showModalBottomSheet, not routed to.
class BottomModal extends StatelessWidget {
final Widget child;
final String title;
const BottomModal({@required this.child, this.title});
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return SafeArea(
child: Padding(
padding: const EdgeInsets.all(8),
child: SingleChildScrollView(
child: Container(
padding: title != null ? const EdgeInsets.only(top: 10) : null,
decoration: BoxDecoration(
color: theme.scaffoldBackgroundColor,
borderRadius: const BorderRadius.all(Radius.circular(10)),
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (title != null) ...[
Padding(
padding: const EdgeInsets.only(left: 70),
child: Text(
title,
style: theme.textTheme.subtitle2,
textAlign: TextAlign.left,
),
),
const Divider(
indent: 20,
endIndent: 20,
)
],
child,
],
),
),
),
),
);
}
}