Last active
June 6, 2024 04:19
-
-
Save ulisseshen/0bf7bbda810630b93d9e9ecb3035bfbc to your computer and use it in GitHub Desktop.
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'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
debugShowCheckedModeBanner: false, | |
home: Scaffold( | |
appBar: AppBar(title: Text("Column tips")), | |
body: Column(children:[ | |
MyColumn(), | |
SizedBox(height: 16), | |
MyColumnStretch() | |
]) | |
), | |
); | |
} | |
} | |
class MyColumnStretch extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Padding( | |
padding: const EdgeInsets.all(16.0), | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.stretch, | |
children: <Widget>[ | |
Text("Com strech"), | |
ElevatedButton( | |
onPressed: () { | |
}, | |
child: Text('Button Um'), | |
) | |
], | |
), | |
); | |
} | |
} | |
class MyColumn extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Padding( | |
padding: const EdgeInsets.all(16.0), | |
child: Column( | |
children: <Widget>[ | |
Text("Sem strech"), | |
ElevatedButton( | |
onPressed: () { | |
}, | |
child: Text('Button Um'), | |
) | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment