Skip to content

Instantly share code, notes, and snippets.

@kunny
Created June 24, 2023 15:28
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 kunny/87f198945a573b7f8520b0b9f6738714 to your computer and use it in GitHub Desktop.
Save kunny/87f198945a573b7f8520b0b9f6738714 to your computer and use it in GitHub Desktop.
Flutter / Material Design / Column
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Column Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: ColumnDemo(),
);
}
}
class ColumnDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: SingleChildScrollView(
child: SizedBox(
height: 2000,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(height: 300, color: Colors.yellow),
const SizedBox(height: 24),
Expanded(
child: Container(color: Colors.red),
),
],
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment