Last active
July 9, 2022 18:43
-
-
Save ademar111190/05ca5a28de419cf66479c6d4fc825049 to your computer and use it in GitHub Desktop.
A fill view port single child scroll view for flutter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class FillViewPortColumnScrollView extends StatelessWidget { | |
final List<Widget> children; | |
const FillViewPortColumnScrollView({ | |
Key? key, | |
required this.children, | |
}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return LayoutBuilder( | |
builder: (context, constraints) { | |
return SingleChildScrollView( | |
child: ConstrainedBox( | |
constraints: BoxConstraints( | |
minHeight: constraints.maxHeight, | |
), | |
child: IntrinsicHeight( | |
child: Column( | |
mainAxisSize: MainAxisSize.max, | |
crossAxisAlignment: CrossAxisAlignment.stretch, | |
children: children, | |
), | |
), | |
), | |
); | |
}, | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment