Progress
class ProgressDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.all(10),
child: Column(
children: [
LinearProgressIndicator(
value: .5,
valueColor: AlwaysStoppedAnimation(Colors.red),
),
SizedBox(height: 16),
Container(
height: 100,
width: 100,
child: CircularProgressIndicator(
// value: .5,
valueColor: AlwaysStoppedAnimation(Colors.red),
),
),
SizedBox(
height: 16,
),
CupertinoActivityIndicator(),
],
),
);
}
}

Simulator Screen Shot - iPhone 12 - 2021-06-10 at 22.18.51.png
手势
class ClickDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
print("onTap");
},
onDoubleTap: () {
print("onDoubleTap");
},
onLongPress: () {
print("onLongPress");
},
child: Text("Data"),
);
}
}

Simulator Screen Shot - iPhone 12 - 2021-06-10 at 22.19.59.png

WX20210610-222005@2x.png
文本输入
class InputDemo extends StatefulWidget {
@override
_InputDemoState createState() => _InputDemoState();
}
class _InputDemoState extends State<InputDemo> {
GlobalKey _key = GlobalKey<FormState>();
TextEditingController _controller = TextEditingController();
@override
void initState() {
// TODO: implement initState
super.initState();
}
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_controller.dispose();
}
@override
Widget build(BuildContext context) {
return Form(
key: _key,
child: Column(
children: [
TextField(
controller: _controller,
)
],
));
}
}
网友评论