Created with <3 with dartpad.dev.
Last active
January 18, 2023 08:08
-
-
Save vital-edu/825104f44446432166803c0473ea4437 to your computer and use it in GitHub Desktop.
Flutter view with two big buttons
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(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter view with two big buttons', | |
debugShowCheckedModeBanner: false, | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
), | |
home: Home(), | |
); | |
} | |
} | |
class Home extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: const Text('Title'), | |
), | |
body: Padding( | |
padding: const EdgeInsets.all(12), | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.stretch, | |
children: <Widget>[ | |
Expanded( | |
child: Padding( | |
padding: const EdgeInsets.all(12), | |
child: OutlinedButton( | |
onPressed: () {}, | |
child: const Text('Button A'), | |
), | |
), | |
), | |
Expanded( | |
child: Padding( | |
padding: const EdgeInsets.all(12), | |
child: OutlinedButton( | |
onPressed: () {}, | |
child: const Text('Button B'), | |
), | |
), | |
) | |
], | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment