当前位置:网站首页>[flutter] icons component (load the built-in icon of flutter | display the material design icon completely)
[flutter] icons component (load the built-in icon of flutter | display the material design icon completely)
2022-07-03 00:54:00 【Programmer community】
List of articles
- One 、 load Flutter Built in icons
- 3、 ... and 、 Complete code example
- 3、 ... and 、 Related resources
- Four 、Icons Icon reference ( Super long screenshot | Complete display of material design icons )
One 、 load Flutter Built in icons
Flutter Icon component in Icon , Dedicated for displaying icons ;
Flutter Some default icons are built in , Can be in https://material.io/resources/icons/ Interface to query ;
Use Icon Component loading Flutter When the built-in icon , Where dart In the source code file , Need to import material design package ,
import 'package:flutter/material.dart';Use Icon Example :
Center( // load Flutter Built in icon child: Icon(Icons.threed_rotation, size: 200,),),
Running effect :

3、 ... and 、 Complete code example
import 'package:flutter/material.dart';import 'dart:io';import 'package:path_provider/path_provider.dart';import 'package:transparent_image/transparent_image.dart';import 'package:cached_network_image/cached_network_image.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget {
// This widget is the root of your application. @override Widget build(BuildContext context) {
return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: MyHomePage(title: 'Flutter Demo Home Page'), ); }}class MyHomePage extends StatefulWidget {
MyHomePage({
Key key, this.title}) : super(key: key); final String title; @override _MyHomePageState createState() => _MyHomePageState();}class _MyHomePageState extends State<MyHomePage> {
int _counter = 0; void _incrementCounter() {
setState(() {
_counter++; }); } /// SD Card path String sdPath; @override void initState() {
// obtain SD Card path getSdPath(); } void getSdPath() async {
String path = (await getExternalStorageDirectory()).path; setState(() {
sdPath = path; }); } @override Widget build(BuildContext context) {
print("sdPath : $sdPath"); return Scaffold( appBar: AppBar( title: Text(widget.title), ), body: Center( child: ListView( children: [ Center( // load Flutter Built in icon child: Icon(Icons.threed_rotation, size: 200,), ), Stack( children: [ Center( // Display the local resource image when the network is loaded child: FadeInImage.assetNetwork( // Placeholder placeholder: "images/waiting.gif", image: "https://img-blog.csdnimg.cn/20210324110914742.png", ), ) ], ), Stack( children: [ // Progress bar Center(child: CircularProgressIndicator(),), Center( // The gradient appears when the network is loaded child: FadeInImage.memoryNetwork( // Placeholder placeholder: kTransparentImage, image: "https://img-blog.csdnimg.cn/2021032321394771.png", ), ) ], ), Center( // Before the picture is loaded, it shows placeholder , Display network pictures after loading child: CachedNetworkImage( // Content displayed during loading network pictures , The progress bar is displayed here placeholder: (context, url)=>CircularProgressIndicator(), // Network picture address imageUrl: "https://img-blog.csdnimg.cn/20210324100419204.png", ), ), // Picture components , Load a picture from the network Image.network( // Picture address "https://img-blog.csdnimg.cn/2021032313493741.png", ), Image( image: AssetImage("images/sidalin.png"), ), //Image.asset('images/sidalin2.png', ), /// from SD Card loading picture if(sdPath != null) Image.file( File('$sdPath/sidalin3.png'), width: 200, ), ], ) ), floatingActionButton: FloatingActionButton( onPressed: _incrementCounter, tooltip: 'Increment', child: Icon(Icons.add), ), // This trailing comma makes auto-formatting nicer for build methods. ); }}3、 ... and 、 Related resources
Reference material :
- Flutter Official website : https://flutter.dev/
- Flutter Plug in download address : https://pub.dev/packages
- Flutter Developing documents : https://flutter.cn/docs ( Strongly recommend )
- official GitHub Address : https://github.com/flutter
- Flutter The Chinese community : https://flutter.cn/
- Flutter Practical tutorial : https://flutter.cn/docs/cookbook
- Flutter CodeLab : https://codelabs.flutter-io.cn/
- Dart Chinese document : https://dart.cn/
- Dart Developer website : https://api.dart.dev/
- Flutter Chinese net ( unofficial , The translation is very good ) : https://flutterchina.club/ , http://flutter.axuer.com/docs/
- Flutter Related issues : https://flutterchina.club/faq/ ( It is recommended to watch it at the introductory stage )
- GitHub Upper Flutter Open source examples : https://download.csdn.net/download/han1202012/15989510
Blog source download :
GitHub Address : https://github.com/han1202012/flutter_image_widget ( Keep updating with the progress of the blog , There may not be the source code of this blog )
Blog source snapshot : https://download.csdn.net/download/han1202012/16073006 ( The source code snapshot of this blog , You can find the source code of this blog )
Four 、Icons Icon reference ( Super long screenshot | Complete display of material design icons )
Flutter The name of the built-in icon in is roughly similar to that in the following figure , Not exactly the same , But the basic name is similar ;


边栏推荐
- matlab将数字矩阵保存为地理空间数据出错,显示下标索引必须为正整数类型或逻辑类型,解决
- Vulkan-性能及精细化
- How to convert Quanzhi a40i/t3 to can through SPI
- Sentry developer contribution Guide - configure pycharm
- University of Toronto: Anthony coach | the conditions of deep reinforcement learning can induce dynamic risk measurement
- [shutter] image component (load network pictures | load static pictures | load local pictures | path | provider plug-in)
- 【AutoSAR 八 OS】
- [AUTOSAR 11 communication related mechanism]
- The "2022 China Digital Office Market Research Report" can be downloaded to explain the 176.8 billion yuan market in detail
- [AUTOSAR XIII NVM]
猜你喜欢

Thank you for being together for these extraordinary two years!

FPGA - 7系列 FPGA内部结构之Clocking -04- 多区域时钟
![[applet project development -- JD mall] user defined search component of uni app (middle) -- search suggestions](/img/ea/ee1ad50a497478b9d080bb5e4bdfb5.png)
[applet project development -- JD mall] user defined search component of uni app (middle) -- search suggestions

How to systematically learn machine learning

Key detection and sinusoidal signal output developed by Arduino

【AutoSAR 四 BSW概述】

2022中国3D视觉企业(引导定位、分拣场景)厂商名单

An excellent orm in dotnet circle -- FreeSQL

matlab将数字矩阵保存为地理空间数据出错,显示下标索引必须为正整数类型或逻辑类型,解决

【AutoSAR 一 概述】
随机推荐
【日常训练】871. 最低加油次数
【AutoSAR 九 C/S原理架构】
Baidu AI Cloud takes the lead in building a comprehensive and standardized platform for smart cloud
[love crash] neglected details of gibaro
Linux软件:如何安装Redis服务
测试右移:线上质量监控 ELK 实战
Lu Zhe, chief scientist of Shiping information: building data and personnel centered security capabilities
leetcode-849:到最近的人的最大距离
[AUTOSAR eight OS]
【AutoSAR 一 概述】
【JetCache】JetCache的配置说明和注解属性说明
How to systematically learn machine learning
Liad: the consumer end of micro LED products is first targeted at TVs above 100 inches. At this stage, it is still difficult to enter a smaller size
Leetcode-2280: represents the minimum number of line segments of a line graph
Rust string slicing, structs, and enumeration classes
利亚德:Micro LED 产品消费端首先针对 100 英寸以上电视,现阶段进入更小尺寸还有难度
Teach you JDBC hand in hand -- structure separation
leetcode-1964:找出到每个位置为止最长的有效障碍赛跑路线
Set up nacos2 X cluster steps and problems encountered
University of Toronto: Anthony coach | the conditions of deep reinforcement learning can induce dynamic risk measurement