cake_wallet/lib/src/widgets/scollable_with_bottom_section.dart

51 lines
1.5 KiB
Dart
Raw Normal View History

2020-01-04 19:31:52 +00:00
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ScrollableWithBottomSection extends StatefulWidget {
ScrollableWithBottomSection(
{this.content,
this.bottomSection,
this.contentPadding,
this.bottomSectionPadding});
2020-01-08 12:26:34 +00:00
final Widget content;
final Widget bottomSection;
final EdgeInsets contentPadding;
final EdgeInsets bottomSectionPadding;
2020-01-04 19:31:52 +00:00
@override
ScrollableWithBottomSectionState createState() =>
ScrollableWithBottomSectionState();
}
class ScrollableWithBottomSectionState
extends State<ScrollableWithBottomSection> {
@override
Widget build(BuildContext context) {
return LayoutBuilder(builder: (context, constraints) {
return SingleChildScrollView(
// physics:
// const AlwaysScrollableScrollPhysics(), // const NeverScrollableScrollPhysics(), //
child: ConstrainedBox(
constraints: BoxConstraints(
minHeight: constraints.heightConstraints().maxHeight),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Padding(
padding: widget.contentPadding ??
EdgeInsets.only(left: 20, right: 20),
child: widget.content,
),
Padding(
padding: widget.bottomSectionPadding ??
EdgeInsets.only(bottom: 20, right: 20, left: 20),
child: widget.bottomSection)
],
),
),
);
});
}
}