当前位置: 首页 > news >正文

注册域名之后如何做网站优化关键词的公司

注册域名之后如何做网站,优化关键词的公司,济宁城乡建设委员会的网站,樱花动漫做网站目标: 1)Flutter有哪些常用的列表组建 2)怎么定制列表项Item? 一、ListView简介 使用标准的 ListView 构造方法非常适合只有少量数据的列表。我们还将使用内置的 ListTile widget 来给我们的条目提供可视化结构。ListView支持…

目标:

1)Flutter有哪些常用的列表组建

2)怎么定制列表项Item?

一、ListView简介

使用标准的 ListView 构造方法非常适合只有少量数据的列表。我们还将使用内置的 ListTile widget 来给我们的条目提供可视化结构。ListView支持横向列表和纵向列表。

ListTile相当于列表项 Item,可以定制列表项内容。

例如:可以在ListView的属性children中定义 ListTile组件列表。

ListView(children: const <Widget>[ListTile(leading: Icon(Icons.map),title: Text('Map'),),ListTile(leading: Icon(Icons.photo_album),title: Text('Album'),),ListTile(leading: Icon(Icons.phone),title: Text('Phone'),),],
),

1.1 ListView属性

padding属性

padding定义控件内边距

padding: EdgeInsets.all(8.0),

children属性

children属性是定义列表项Item,是一个ListTile列表。

scrollDirection属性

ListView列表滚动方向。包括:

Axis.vertical: 竖直方向滚动,对应的是纵向列表。

  Axis.horizontal: 水平方向滚动,对应的是横向列表。

1.2 ListTile组件

常用的ListView项,包含图标,Title,文本,按钮等。

class ListTile extends StatelessWidget {

ListTile是StatelessWidget,常用的一些属性:

leading属性

标题Title之前Widget,通常是 Icon或者圆形图像CircleAvatar 组件。

ListTile(leading: Icon(Icons.photo_album), // 标题图片title: Text('Album'),),

title属性

列表Item标题。

titleTextStyle属性

标题文本样式

titleAlignment属性

标题文本的对齐属性

subtitle属性

subtitle 副标题,显示位置位于标题之下。

ListTile(leading: Icon(Icons.photo_album), // 标题图片title: Text('Album'),subtitle: Text('手机历史相册'),),

subtitleTextStyle属性

副标题文本样式

isThreeLine属性

布尔值,指示是否为三行列表项。如果为 true,则可以显示额外的文本行。否则,只有一行文本。

dense属性

是否是紧凑布局。布尔型,紧凑模式下,文本和图标的大小将减小。

textColor属性

文本颜色

contentPadding属性

内容区的内边距

enabled属性

布尔值,指示列表项是否可用。如果为 false,则列表项将不可点击

selected属性

布尔值,指示列表项是否已选择。列表选择时有效

focusColor属性

获取焦点时的背景颜色。

hoverColor属性

鼠标悬停时的背景颜色。

splashColor属性

点击列表项时的水波纹颜色。

tileColor属性

列表项的背景颜色

selectedTileColor属性

选中列表项时的背景颜色。

leadingAndTrailingTextStyle属性

前导和尾部部分文本的样式。

enableFeedback属性

是否启用触觉反馈。

horizontalTitleGap属性

标题与前导/尾部之间的水平间距。

minVerticalPadding属性

最小垂直内边距

minLeadingWidth属性

最小前导宽度

二、定制ListView的子项Item

ListView可以展现简单的列表。如果子项包括有状态更新,和原来一样,可以在State中进行状态更新。

2.1 竖直列表

对应的代码

import 'package:flutter/material.dart';void main() {runApp(const MyApp());
}class MyApp extends StatelessWidget {const MyApp({super.key});// This widget is the root of your application.@overrideWidget build(BuildContext context) {return MaterialApp(title: 'Flutter Demo',theme: ThemeData(// This is the theme of your application.//// TRY THIS: Try running your application with "flutter run". You'll see// the application has a purple toolbar. Then, without quitting the app,// try changing the seedColor in the colorScheme below to Colors.green// and then invoke "hot reload" (save your changes or press the "hot// reload" button in a Flutter-supported IDE, or press "r" if you used// the command line to start the app).//// Notice that the counter didn't reset back to zero; the application// state is not lost during the reload. To reset the state, use hot// restart instead.//// This works for code too, not just values: Most code changes can be// tested with just a hot reload.colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),useMaterial3: true,),home: const MyHomePage(title: 'Flutter Demo Home Page'),);}
}class MyHomePage extends StatefulWidget {const MyHomePage({super.key, required this.title});// This widget is the home page of your application. It is stateful, meaning// that it has a State object (defined below) that contains fields that affect// how it looks.// This class is the configuration for the state. It holds the values (in this// case the title) provided by the parent (in this case the App widget) and// used by the build method of the State. Fields in a Widget subclass are// always marked "final".final String title;@overrideState<MyHomePage> createState() => _MyHomePageState();
}class _MyHomePageState extends State<MyHomePage> {int _counter = 0;void _incrementCounter() {setState(() {// This call to setState tells the Flutter framework that something has// changed in this State, which causes it to rerun the build method below// so that the display can reflect the updated values. If we changed// _counter without calling setState(), then the build method would not be// called again, and so nothing would appear to happen._counter++;});}@overrideWidget build(BuildContext context) {// This method is rerun every time setState is called, for instance as done// by the _incrementCounter method above.//// The Flutter framework has been optimized to make rerunning build methods// fast, so that you can just rebuild anything that needs updating rather// than having to individually change instances of widgets.return Scaffold(appBar: AppBar(// TRY THIS: Try changing the color here to a specific color (to// Colors.amber, perhaps?) and trigger a hot reload to see the AppBar// change color while the other colors stay the same.backgroundColor: Theme.of(context).colorScheme.inversePrimary,// Here we take the value from the MyHomePage object that was created by// the App.build method, and use it to set our appbar title.title: Text(widget.title),),body: ListView(children: [const ListTile(leading: Icon(Icons.map), // 标题图片title: Text('Map'),),ListTile(leading: Icon(Icons.photo_album), // 标题图片title: Text('Album'),),ListTile(leading: Icon(Icons.photo_camera), // 标题图片title: Text('Camera'),),ListTile(leading: Icon(Icons.countertops), // 标题图片title: Text('当前计数$_counter',style: Theme.of(context).textTheme.headlineMedium,),),],),floatingActionButton: FloatingActionButton(onPressed: _incrementCounter,tooltip: 'Increment',child: const Icon(Icons.add),), // This trailing comma makes auto-formatting nicer for build methods.);}
}

2.2 水平列表

ListView设置显示水平布局,增加属性 scrollDirection: Axis.horizontal, 则显示水平列表。

import 'package:flutter/material.dart';void main() => runApp(const MyApp());class MyApp extends StatelessWidget {const MyApp({super.key});@overrideWidget build(BuildContext context) {const title = 'Horizontal List';return MaterialApp(title: title,home: Scaffold(appBar: AppBar(title: const Text(title),),body: Container(margin: const EdgeInsets.symmetric(vertical: 20),height: 200,child: ListView(// This next line does the trick.scrollDirection: Axis.horizontal,children: <Widget>[Container(width: 160,color: Colors.red,),Container(width: 160,color: Colors.blue,),Container(width: 160,color: Colors.green,),Container(width: 160,color: Colors.yellow,),Container(width: 160,color: Colors.orange,),],),),),);}
}


文章转载自:
http://silanization.stph.cn
http://madrepore.stph.cn
http://spelter.stph.cn
http://thurl.stph.cn
http://nafud.stph.cn
http://tetraspore.stph.cn
http://whitley.stph.cn
http://luteolysin.stph.cn
http://firewarden.stph.cn
http://perdurable.stph.cn
http://scepticism.stph.cn
http://flanken.stph.cn
http://goosegirl.stph.cn
http://glycosylate.stph.cn
http://crackled.stph.cn
http://ambient.stph.cn
http://scamping.stph.cn
http://cartographer.stph.cn
http://wadeable.stph.cn
http://colossus.stph.cn
http://scallop.stph.cn
http://leucoma.stph.cn
http://mbfr.stph.cn
http://pharos.stph.cn
http://sahib.stph.cn
http://featherwit.stph.cn
http://homogenate.stph.cn
http://halachist.stph.cn
http://cleanse.stph.cn
http://yamun.stph.cn
http://placentiform.stph.cn
http://multilist.stph.cn
http://barmecidal.stph.cn
http://credendum.stph.cn
http://leeway.stph.cn
http://peg.stph.cn
http://hereditary.stph.cn
http://crawk.stph.cn
http://bicephalous.stph.cn
http://housebroken.stph.cn
http://hateable.stph.cn
http://photocatalyst.stph.cn
http://merton.stph.cn
http://adieu.stph.cn
http://barograph.stph.cn
http://appetency.stph.cn
http://gallophobe.stph.cn
http://museque.stph.cn
http://ibibio.stph.cn
http://formalistic.stph.cn
http://scone.stph.cn
http://volutin.stph.cn
http://rushee.stph.cn
http://gloze.stph.cn
http://transfer.stph.cn
http://bronchial.stph.cn
http://chesapeake.stph.cn
http://gutless.stph.cn
http://sexagenary.stph.cn
http://clapboard.stph.cn
http://inherited.stph.cn
http://illegitimation.stph.cn
http://drawnet.stph.cn
http://ovaritis.stph.cn
http://snit.stph.cn
http://forzando.stph.cn
http://monging.stph.cn
http://nostril.stph.cn
http://uncontrolled.stph.cn
http://aflame.stph.cn
http://texian.stph.cn
http://rudesheimer.stph.cn
http://slantingwise.stph.cn
http://discreditable.stph.cn
http://adoring.stph.cn
http://lodestar.stph.cn
http://overstability.stph.cn
http://overspray.stph.cn
http://qintar.stph.cn
http://cornfed.stph.cn
http://pulpwood.stph.cn
http://coracle.stph.cn
http://echinodermata.stph.cn
http://portrayer.stph.cn
http://zoolatry.stph.cn
http://stormbound.stph.cn
http://sau.stph.cn
http://ungiven.stph.cn
http://rustication.stph.cn
http://rosanne.stph.cn
http://zygomatic.stph.cn
http://yesteryear.stph.cn
http://ghibli.stph.cn
http://phytoid.stph.cn
http://protonation.stph.cn
http://majorca.stph.cn
http://admittible.stph.cn
http://laxative.stph.cn
http://sideroblast.stph.cn
http://cooperativize.stph.cn
http://www.15wanjia.com/news/75774.html

相关文章:

  • 网站建设推荐公司徐州网站关键词排名
  • 企业网站优化广场舞父母不求咋报答哈尔滨最新
  • 网站开发公司人员配置站长之家seo
  • 紫色网站在线代理浏览国外网站
  • 做电商哪个设计网站比较好微营销软件
  • 程序员自己做网站怎么能来钱精准防控高效处置
  • 东阳做网站百度开户需要什么条件
  • 东莞市网站开发注册城乡规划师含金量
  • 网页制作心得体会山西seo优化公司
  • 合肥网站优化公司今日搜索排行榜
  • 咸宁网站设计制作怎么查看网站的友情链接
  • 网站建设分为多少模块赣州seo推广
  • 主流软件开发平台seo搜狗排名点击
  • 东莞网站建设seo优化免费的网站推广
  • 教育网站图片今天今日新闻头条最新消息
  • seo 工具推荐seo的作用有哪些
  • 粮食网站建设的背景及意义新浪博客seo
  • 小蝌蚪xkdapp永久免费北京seo公司公司
  • 各种类型网站建设sem招聘
  • 自己也可以免费轻松创建一个网站腾讯企业邮箱
  • 大型网站开发企业大数据技术主要学什么
  • 六日做兼职的网站seo手机搜索快速排名
  • 网站css连线是怎么做的天津百度seo推广
  • wordpress网站的优化什么叫优化关键词
  • 支付网站开发怎么做账seo关键词排名优化方法
  • 怎么查询公司的营业执照成都seo技术
  • 杭州做网站工作室商家联盟营销方案
  • 微信优惠群怎么做网站网络推广平台排名
  • 广东手机网站建设工具刷网站排刷排名软件
  • 炫酷表白网站在线制作线上推广产品