Commit f4e7b4e1 by Anuj Committed by GitHub

Fixed center problem of buttons. (#459)

* Fixed center problem of buttons of the issue #458

* Fixed center problem of buttons of the issue #458 for toast_context page
parent c91a2268
......@@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
......@@ -25,29 +25,31 @@ class _MyAppState extends State<MyApp> {
appBar: AppBar(
title: Text("Toast"),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => ToastNoContext(),
));
},
child: Text("Flutter Toast No Context"),
),
SizedBox(
height: 24.0,
),
ElevatedButton(
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => ToastContext(),
));
},
child: Text("Flutter Toast Context"),
),
],
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => ToastNoContext(),
));
},
child: Text("Flutter Toast No Context"),
),
SizedBox(
height: 24.0,
),
ElevatedButton(
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => ToastContext(),
));
},
child: Text("Flutter Toast Context"),
),
],
),
),
);
}
......
......@@ -139,60 +139,62 @@ class _ToastContextState extends State<ToastContext> {
appBar: AppBar(
title: Text("Custom Toasts"),
),
body: Column(
children: [
SizedBox(
height: 24.0,
),
ElevatedButton(
child: Text("Show Custom Toast"),
onPressed: () {
_showToast();
},
),
ElevatedButton(
child: Text("Show Custom Toast via PositionedToastBuilder"),
onPressed: () {
_showBuilderToast();
},
),
SizedBox(
height: 24.0,
),
ElevatedButton(
child: Text("Custom Toast With Close Button"),
onPressed: () {
_showToastCancel();
},
),
SizedBox(
height: 24.0,
),
ElevatedButton(
child: Text("Queue Toasts"),
onPressed: () {
_queueToasts();
},
),
SizedBox(
height: 24.0,
),
ElevatedButton(
child: Text("Cancel Toast"),
onPressed: () {
_removeToast();
},
),
SizedBox(
height: 24.0,
),
ElevatedButton(
child: Text("Remove Queued Toasts"),
onPressed: () {
_removeAllQueuedToasts();
},
),
],
body: Center(
child: Column(
children: [
SizedBox(
height: 24.0,
),
ElevatedButton(
child: Text("Show Custom Toast"),
onPressed: () {
_showToast();
},
),
ElevatedButton(
child: Text("Show Custom Toast via PositionedToastBuilder"),
onPressed: () {
_showBuilderToast();
},
),
SizedBox(
height: 24.0,
),
ElevatedButton(
child: Text("Custom Toast With Close Button"),
onPressed: () {
_showToastCancel();
},
),
SizedBox(
height: 24.0,
),
ElevatedButton(
child: Text("Queue Toasts"),
onPressed: () {
_queueToasts();
},
),
SizedBox(
height: 24.0,
),
ElevatedButton(
child: Text("Cancel Toast"),
onPressed: () {
_removeToast();
},
),
SizedBox(
height: 24.0,
),
ElevatedButton(
child: Text("Remove Queued Toasts"),
onPressed: () {
_removeAllQueuedToasts();
},
),
],
),
),
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment