Flutter Widget之Icon

Widget:https://flutter.io/docs/development/ui/widgets
Icon:https://docs.flutter.io/flutter/widgets/Icon-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
import 'package:flutter/material.dart';

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

class _IconDemoPagePageState extends State<IconDemoPage> {
double _volume = 0.0;

@override
void initState() {
super.initState();
}

Widget build(BuildContext context) {
return Scaffold(
appBar: new AppBar(
title: new Text('Icon Demo'),
),
body: SingleChildScrollView(
child: Column(
children: <Widget>[
// IconButton
IconButton(
icon: Icon(Icons.volume_up),
tooltip: 'Increase volume by 10%',
onPressed: () {
setState(() {
_volume *= 1.1;
});
},
),
// IconTheme
// ImageIcon
],
)
)
);
}
}

Flutter Widget Icon

Powered by AppBlog.CN     浙ICP备14037229号

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

访客数 : | 访问量 :