Skip to content

Instantly share code, notes, and snippets.

@ademar111190
Last active July 9, 2022 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ademar111190/05ca5a28de419cf66479c6d4fc825049 to your computer and use it in GitHub Desktop.
Save ademar111190/05ca5a28de419cf66479c6d4fc825049 to your computer and use it in GitHub Desktop.
A fill view port single child scroll view for flutter
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