mirror of
https://github.com/flutter/samples.git
synced 2025-11-10 23:08:59 +00:00
next_gen_ui_demo: Make the tape player analogy complete (#1859)
This commit is contained in:
@@ -111,9 +111,17 @@ class _NextGenAppState extends State<NextGenApp> {
|
|||||||
floatingActionButton: Row(
|
floatingActionButton: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Visibility(
|
if (step > 0) ...[
|
||||||
visible: step > 0,
|
FloatingActionButton(
|
||||||
child: FloatingActionButton(
|
child: const Icon(Icons.first_page),
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
step = 0;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const Gap(24),
|
||||||
|
FloatingActionButton(
|
||||||
child: const Icon(Icons.arrow_back),
|
child: const Icon(Icons.arrow_back),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
@@ -121,14 +129,10 @@ class _NextGenAppState extends State<NextGenApp> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
Visibility(
|
if (step > 0 && step + 1 < steps.length) const Gap(24),
|
||||||
visible: step > 0 && step + 1 < steps.length,
|
if (step + 1 < steps.length) ...[
|
||||||
child: const Gap(24),
|
FloatingActionButton(
|
||||||
),
|
|
||||||
Visibility(
|
|
||||||
visible: step + 1 < steps.length,
|
|
||||||
child: FloatingActionButton(
|
|
||||||
child: const Icon(Icons.arrow_forward),
|
child: const Icon(Icons.arrow_forward),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
@@ -136,24 +140,16 @@ class _NextGenAppState extends State<NextGenApp> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
|
||||||
Visibility(
|
|
||||||
visible: step + 1 == steps.length,
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
const Gap(24),
|
const Gap(24),
|
||||||
FloatingActionButton(
|
FloatingActionButton(
|
||||||
child: const Icon(Icons.restart_alt),
|
child: const Icon(Icons.last_page),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
step = 0;
|
step = steps.length - 1;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
backgroundColor: Colors.black,
|
backgroundColor: Colors.black,
|
||||||
|
|||||||
Reference in New Issue
Block a user