lemmur-app-android/lib/widgets/bottom_modal.dart

54 lines
1.6 KiB
Dart
Raw Normal View History

import 'package:flutter/material.dart';
2020-09-30 19:05:00 +02:00
/// Should be spawned with a showModalBottomSheet, not routed to.
class BottomModal extends StatelessWidget {
final Widget child;
final String title;
2021-01-03 18:21:56 +01:00
const 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-02 16:54:29 +02:00
return SafeArea(
child: Padding(
2021-01-03 18:03:59 +01:00
padding: const EdgeInsets.all(8),
child: SingleChildScrollView(
child: Container(
2020-09-09 21:23:58 +02:00
padding: title != null ? const EdgeInsets.only(top: 10) : null,
decoration: BoxDecoration(
color: theme.scaffoldBackgroundColor,
borderRadius: const BorderRadius.all(Radius.circular(10)),
border: Border.all(
color: Colors.grey.withOpacity(0.5),
width: 0.2,
)),
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
),
2021-01-03 19:43:39 +01:00
const Divider(
indent: 20,
endIndent: 20,
)
],
child,
2020-09-02 16:54:29 +02:00
],
),
2020-09-02 16:54:29 +02:00
),
),
),
);
}
}