2021-01-26 23:16:47 +01:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class BottomSafe extends StatelessWidget {
|
|
|
|
final double additionalPadding;
|
2021-09-23 19:25:03 +02:00
|
|
|
|
|
|
|
static const fabPadding =
|
|
|
|
// FAB size + FAB margin, 56 is as per https://material.io/components/buttons-floating-action-button#anatomy
|
|
|
|
56 + kFloatingActionButtonMargin;
|
|
|
|
|
2021-01-26 23:16:47 +01:00
|
|
|
const BottomSafe([this.additionalPadding = 0]);
|
2021-09-23 19:25:03 +02:00
|
|
|
const BottomSafe.fab() : this(fabPadding);
|
2021-01-26 23:16:47 +01:00
|
|
|
|
|
|
|
@override
|
2021-09-23 19:25:03 +02:00
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return SizedBox(
|
|
|
|
height: MediaQuery.of(context).padding.bottom + additionalPadding,
|
|
|
|
);
|
|
|
|
}
|
2021-01-26 23:16:47 +01:00
|
|
|
}
|