-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.dart
More file actions
60 lines (54 loc) · 1.63 KB
/
main.dart
File metadata and controls
60 lines (54 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// SPDX-FileCopyrightText: 2022 Iconica
//
// SPDX-License-Identifier: BSD-3-Clause
import 'package:flutter/material.dart';
import 'package:stepper_example/vertical_multi.dart';
import 'package:stepper_example/vertical_single.dart';
void main() {
runApp(const MaterialApp(home: StepperDemo()));
}
class StepperDemo extends StatefulWidget {
const StepperDemo({super.key});
@override
State<StepperDemo> createState() => _StepperDemoState();
}
class _StepperDemoState extends State<StepperDemo> {
bool _showAllSteps = true;
@override
Widget build(BuildContext context) => Scaffold(
backgroundColor: Colors.black,
body: Padding(
padding: EdgeInsets.only(
left: MediaQuery.of(context).size.width * 0.05,
top: MediaQuery.of(context).size.height * 0.05,
),
child: Column(
children: [
Row(
children: [
const Text(
'Show all steps',
style: TextStyle(
color: Colors.white,
),
),
Switch(
value: _showAllSteps,
onChanged: (value) {
setState(() {
_showAllSteps = value;
});
},
),
],
),
if (_showAllSteps) ...[
const Expanded(child: VerticalSinglePageStepper()),
] else ...[
const VerticalMultiPageStepper(),
],
],
),
),
);
}