Flutter Widget之Stepper

Widget:https://flutter.io/docs/development/ui/widgets
Stepper:https://docs.flutter.io/flutter/material/Stepper-class.html

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
import 'package:flutter/material.dart';

class StepperDemoPage extends StatefulWidget {
@override
State<StatefulWidget> createState() => new _StepperDemoPagePageState();
}

class _StepperDemoPagePageState extends State<StepperDemoPage> {
@override
void initState() {
super.initState();
}

Widget build(BuildContext context) {
return Scaffold(
appBar: new AppBar(
title: new Text('Stepper Demo'),
),
body: Align(
alignment: Alignment.topCenter,
child: new Stepper(
currentStep: 0, //激活的下标
type: StepperType.vertical,
steps: <Step>[
new Step(
title: new Text('第一步'),
content: new Text('第一步内容'),
state: StepState.complete,
isActive: true,
subtitle: new Text('第一步小标题'),
),
new Step(
title: new Text('第二步'),
content: new Text('第二步内容'),
),
new Step(
title: new Text('第三步'),
content: new Text('第三步内容'),
),
],
onStepTapped: (int step) {
print("onStepTapped: $step");
},
onStepCancel: () {
print("onStepCancel");
},
onStepContinue: () {
print("onStepContinue");
}
)
),
);
}
}

Flutter Widget Stepper

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :