1
0
mirror of https://github.com/krawieck/lemmur/ synced 2024-12-16 10:30:24 +01:00
lemmur-app-android/lib/widgets/bottom_modal.dart
2020-09-09 21:23:58 +02:00

50 lines
1.4 KiB
Dart

import 'package:flutter/material.dart';
class BottomModal extends StatelessWidget {
final Widget child;
final String title;
BottomModal({@required this.child, this.title});
@override
Widget build(BuildContext context) {
var theme = Theme.of(context);
return SafeArea(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: SingleChildScrollView(
child: Container(
padding: title != null ? const EdgeInsets.only(top: 10) : null,
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,
),
),
Divider(
indent: 20,
endIndent: 20,
)
],
child,
],
),
),
),
),
);
}
}