Skip to content

Commit 1ab62bc

Browse files
authored
Buttons Added
1 parent 4b946a3 commit 1ab62bc

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

data/draft/flutter.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,3 +891,61 @@ class SnackBarPage extends StatelessWidget {
891891
}
892892
}
893893
```
894+
## Buttons
895+
```dart
896+
import 'package:flutter/material.dart';
897+
898+
void main() => runApp(ButtonsDemo());
899+
900+
class ButtonsDemo extends StatelessWidget {
901+
@override
902+
Widget build(BuildContext context) {
903+
return MaterialApp(
904+
title: 'Buttons Demo',
905+
home: Scaffold(
906+
appBar: AppBar(
907+
title: Text('Buttons Demo'),
908+
),
909+
body: ButtonsDemoPage(),
910+
),
911+
);
912+
}
913+
}
914+
915+
class ButtonsDemoPage extends StatelessWidget {
916+
@override
917+
Widget build(BuildContext context) {
918+
return Column(
919+
children:[
920+
// Text Button
921+
922+
TextButton(
923+
onPressed: () {
924+
// Respond to button press
925+
},
926+
child: Text("TEXT BUTTON"),
927+
),
928+
929+
// Outlined Button
930+
931+
OutlinedButton(
932+
onPressed: () {
933+
// Respond to button press
934+
},
935+
child: Text("OUTLINED BUTTON"),
936+
),
937+
938+
// Elevated Button
939+
940+
ElevatedButton(
941+
onPressed: () {
942+
// Respond to button press
943+
},
944+
child: Text('CONTAINED BUTTON'),
945+
),
946+
]
947+
);
948+
}
949+
}
950+
```
951+

0 commit comments

Comments
 (0)