2020-09-01 21:36:58 +02:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
2020-09-30 19:05:00 +02:00
|
|
|
/// Should be spawned with a showModalBottomSheet, not routed to.
|
2020-09-01 21:36:58 +02:00
|
|
|
class BottomModal extends StatelessWidget {
|
|
|
|
final Widget child;
|
|
|
|
final String title;
|
|
|
|
|
|
|
|
BottomModal({@required this.child, this.title});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2020-09-16 23:22:04 +02:00
|
|
|
final theme = Theme.of(context);
|
2020-09-01 21:36:58 +02:00
|
|
|
|
2020-09-02 16:54:29 +02:00
|
|
|
return SafeArea(
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
2020-09-05 23:48:30 +02:00
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Container(
|
2020-09-09 21:23:58 +02:00
|
|
|
padding: title != null ? const EdgeInsets.only(top: 10) : null,
|
2020-09-05 23:48:30 +02:00
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: theme.scaffoldBackgroundColor,
|
|
|
|
borderRadius: BorderRadius.all(const Radius.circular(10.0)),
|
|
|
|
),
|
|
|
|
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,
|
|
|
|
),
|
2020-09-02 16:54:29 +02:00
|
|
|
),
|
2020-09-05 23:48:30 +02:00
|
|
|
Divider(
|
|
|
|
indent: 20,
|
|
|
|
endIndent: 20,
|
|
|
|
)
|
|
|
|
],
|
|
|
|
child,
|
2020-09-02 16:54:29 +02:00
|
|
|
],
|
2020-09-05 23:48:30 +02:00
|
|
|
),
|
2020-09-02 16:54:29 +02:00
|
|
|
),
|
2020-09-01 21:36:58 +02:00
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|