当前位置:网站首页>10 useful flutter widgets
10 useful flutter widgets
2022-06-09 11:21:00 【Hua Weiyun】
Trying to learn a new language can be frightening and boring . A lot of times , We hope we know some of the features that existed earlier . In today's article , I'll tell you some of the most convenient things I'd like to know earlier Flutter The widget .
Spacer
Spacer Create an adjustable blank space , It occupies Flex Any remaining space between small parts of the container , For example, rows or columns .
Row( children: const <Widget>[ Text('Begin'), Spacer(), // Defaults to a flex of one. Text('Middle'), // Gives twice the space between Middle and End than Begin and Middle. Spacer(flex: 2), Text('End'), ], ),When creating a button with an icon , This widget replaces the need to use rows . You must provide icons and labels .
TextButton.icon( onPressed: () {}, icon: Icon(Icons.home), label: Text('Home') ),Wrap
It displays its children horizontally or vertically according to the direction value provided . It can be used instead of Gridview. This widget is responsive , You don't have to do much to adapt to different screen sizes .
Wrap( direction: Axis.horizontal, alignment: WrapAlignment.start, spacing: 2.0, runSpacing: 3.0, children: [], )AnimatedSwitcher
This widget animates a new widget to replace another . It provides a good transition , Make the application very smooth . Always add a key to its child widget to make sure it works .
SafeArea
This widget adds padding to your widget , Make sure your application doesn't interact with the operating system and device display functions ( Such as the status bar ) conflict .
SafeArea(child: Container())RefreshIndicator
Use the scrollable widget as a child . When the child is over rolled , The animated circular progress indicator fades into the view and invokes the future to update scrollable content .
RefreshIndicator(child: ListView(), onRefresh: () async {}),RichText
This allows us to display text with different styles on the same sentence or paragraph . You can include inline links 、 Underline text 、 Color text, etc .
Transform
This widget takes your animation game to a whole new level . It can realize simple animation , Such as rotating and scaling to more complex animation , Such as 3D And tilt animation . It provides useful named constructors , For example, rotation 、 Zoom and pan , So as to realize .
InteractiveViewer
Introducing scaling on widgets 、 translation 、 The simplest way to drag and knead functions . It can be highly customized according to your needs .
Flow
This widget uses the power of transformation to provide cool animation . It is one of the widgets you must see in practice to understand its functionality . see For more insights .
Chip
This is a simple widget , Display simple data in an organized and elegant way . It has several variants , for example InputChip、ChoiceChip、FilterChip and ActionChip.
Chip( avatar: CircleAvatar( backgroundColor: Colors.grey.shade800, child: const Text('AB'), ), label: const Text('Aaron Burr'), )Now you know some really cool widgets , Let's make better use of Flutter Come on! .
边栏推荐
- Document writing specification
- 使用 KubeKey 搭建 Kubernetes/KubeSphere 环境的“心路(累)历程“
- 4. 软件工程:航空行李托运费计算
- Cyclodextrin metal organic framework loaded low molecular weight heparin and adriamycin (MOF metal organic framework loaded biological macromolecular drugs)
- This article takes you to understand gaussdb (DWS) [Gauss is not a mathematician this time]
- After ten years of deep cultivation, Xuanwu cloud technology finally sits firmly at the leading position of FMCG SaaS
- 4.【素短语,最左素短语】
- 处理链加载数据出错的可能原因-process chain loading error
- BigDecimal使用不当,造成P0事故!
- QT char to realize dynamic waveform display
猜你喜欢

福建土楼沟文化旅游开发有限公司6%股权转让,来自塔米狗分享

Cyclodextrin metal organic framework loaded low molecular weight heparin and adriamycin (MOF metal organic framework loaded biological macromolecular drugs)

MOF-53NPs负载抗菌药物分子万古霉素(MOF金属有机骨架负载蛋白多肽类药物)

C# 图片验证码简单例子

自己建设网站需要做哪些准备

How much do you know, deep analysis, worth collecting

PerfDog发布全新指标,为游戏量身打造
![[pyhton practice] - batch [Dragon Boat Festival] poster Download](/img/75/80d157d7917881a72127daaacbfb90.png)
[pyhton practice] - batch [Dragon Boat Festival] poster Download

物联网低代码平台如何使用操作日志?

Harbor正确密码登录不上去
随机推荐
Float float simulates double precision computation on CPU and GPU
flutter setState() called after dispose()
MySQL learning notes - Chapter 5 - data backup and recovery, MySQL logs
全局组织结构控制之抢滩登陆
[advanced MySQL] optimize SQL by using the execution plan explain (2)
redis中数据结构的学习笔记
MySQL 学习笔记-第五篇-数据备份与恢复、MySQL 日志
Is Huatai Securities safe? I want to open an account
TemplateDoesNotExist at /users/register/
基于华为云君可归烈士寻亲系统开发实战【华为云至简致远】
NFT市场进入聚合时代,OKALEIDO成BNB Chain上的首个聚合平台
Matlab相关函数知识点(三)-floor函数+点除运算符+矩阵索引规则
DM platform management - NETCORE
[pyhton practice] - batch [Dragon Boat Festival] poster Download
Multi engine database management tool DataGrid 2022.1.5 Chinese version
Quartz multiple schedulers + thread pool mode to schedule tasks separately
This article takes you to understand gaussdb (DWS) [Gauss is not a mathematician this time]
MySQL learning notes - Part 3 - indexes, stored procedures and functions, views, triggers
从“无人问津”到全面竞争,复盘国内工控安全的第一个10年
音乐创作工具Steinberg Cubase Pro