flutter 五点一点五:MaterialApp Theme一堆主题

news2024/10/7 4:32:49

一堆主题 大部分都是统一设置组件的默认样式的主题

  • 具体属性基本上与相关组件一致 具体再学习组件时 说明
 IconThemeData? iconTheme, // 设置icon的颜色 Appbar中的icon无效
IconThemeData primaryIconTheme, // 与primaryColor形成对比的图标主题
 IconThemeData accentIconTheme, // 与accentColor形成对比的图标主题。
TextTheme? primaryTextTheme, //与primary color形成对比的文本主题
TextTheme? textTheme, // 文本的颜色与卡片和画布的颜色形成对比。
Typography typography, // 用于配置TextTheme、primaryTextTheme和accentTextTheme的颜色和几何TextTheme值。
 ActionIconThemeData? actionIconTheme, //它用[ActionIconTheme.of]或整个[Theme]的[ThemeData.ActionIconTheme]覆盖[BackButton]、[CloseButton]、[DrawerButton和[EndDrawerButton的默认图标。
AppBarTheme appBarTheme, // 用于自定义Appbar的颜色、高度、亮度、iconTheme和textTheme的主题。
BadgeThemeData? badgeTheme,  //用于定义Badge小部件主题
MaterialBannerThemeData? bannerTheme,   //定义[MaterialBanner] 主题  Defines the visual properties of [MaterialBanner] widgets.
    BottomAppBarTheme? bottomAppBarTheme, //BottomAppBar主题   Defines default property values for descendant [BottomAppBar] widgets.
    BottomNavigationBarThemeData? bottomNavigationBarTheme,//BottomNavigationBar主题  Defines default property values for descendant [BottomNavigationBar] widgets. 
    BottomSheetThemeData? bottomSheetTheme, 
    //Defines default property values for [BottomSheet]'s [Material].
    ButtonBarThemeData? buttonBarTheme,  // Defines the visual properties of [ButtonBar] widgets.
    
    ButtonThemeData? buttonTheme, //计划在将来的版本中弃用此类。
    请改用以下一个或多个按钮和相关主题:[TextButton], [TextButtonTheme], [TextButtonThemeData],  [ElevatedButton], 
    [ElevatedButtonTheme], [ElevatedButtonThemeData],[OutlinedButton], [OutlinedButtonTheme], [OutlinedButtonThemeData]
    
    CardTheme? cardTheme, // Defines default property values for descendant [Card] widgets.
    定义子代[Card]小部件的默认属性值。

    CheckboxThemeData? checkboxTheme, // Defines default property values for descendant [Checkbox] widget
    定义子代[Checkbox]小部件的默认属性值
    
    ChipThemeData? chipTheme,  //Use this class to configure a [ChipTheme] widget, or to set the  [ThemeData.chipTheme] for a [Theme] widget.
    用于chip类组件的样式
    ///  * [Chip], a chip that displays information and can be deleted.
///  * [InputChip], a chip that represents a complex piece of information, such
///    as an entity (person, place, or thing) or conversational text, in a
///    compact form.
///  * [ChoiceChip], allows a single selection from a set of options. Choice
///    chips contain related descriptive text or categories.
///  * [FilterChip], uses tags or descriptive words as a way to filter content.
///  * [ActionChip], represents an action related to primary content.
///  * [CircleAvatar], which shows images or initials of entities.
///  * [Wrap], A widget that displays its children in multiple horizontal or
///    vertical runs.
///  * [ChipTheme] widget, which can override the chip theme of its
///    children.
///  * [Theme] widget, which performs a similar function to [ChipTheme],
///    but for overall themes.
///  * [ThemeData], which has a default [ChipThemeData].


    DataTableThemeData? dataTableTheme, // Defines default property values for descendant [DataTable] widgets
定义子代[DataTable]小部件的默认属性值

    DatePickerThemeData? datePickerTheme, // Overrides the default values of visual properties for descendant [DatePickerDialog] widgets.
覆盖子代[DatePickerDialog]小部件的视觉属性的默认值。

    DialogTheme? dialogTheme, // Defines a theme for [Dialog] widgets.

    DividerThemeData? dividerTheme, // Defines the visual properties of [Divider], [VerticalDivider], dividers between [ListTile]s, and dividers between rows in [DataTable]s. 定义[Divider]、[VerticalDivider]、[ListTile]之间的分隔符以及[DataTable]中行之间的分隔器的视觉属性。


    DrawerThemeData? drawerTheme, // Defines default property values for descendant [Drawer] widgets.


    DropdownMenuThemeData? dropdownMenuTheme, // Overrides the default values of visual properties for descendant [DropdownMenu] widgets.


    ElevatedButtonThemeData? elevatedButtonTheme, // A [ButtonStyle] that overrides the default appearance of [ElevatedButton]s when it's used with [ElevatedButtonTheme] or with the overall [Theme]'s [ThemeData.elevatedButtonTheme].
一个[ButtonStyle],当它与[ElectedButtonTheme]或整个[Theme]的[ThemeData.electedButton Theme]一起使用时,它会覆盖[ElectedButton]的默认外观。

    ExpansionTileThemeData? expansionTileTheme, // Used with [ExpansionTileTheme] to define default property values for descendant [ExpansionTile] widgets.
/与[ExpansionTileTheme]一起使用,为后代[ExpansionTile]小部件定义默认属性值。

    FilledButtonThemeData? filledButtonTheme, //  A [ButtonStyle] that overrides the default appearance of	[FilledButton]s when it's used with [FilledButtonTheme] or with the overall [Theme]'s [ThemeData.filledButtonTheme]. // Defines default property values for descendant [FloatingActionButton] widgets.

    FloatingActionButtonThemeData? floatingActionButtonTheme, //  A [ButtonStyle] that overrides the default appearance of [IconButton]s when it's used with the [IconButton], the [IconButtonTheme] or the overall [Theme]'s [ThemeData.iconButtonTheme].
    
    IconButtonThemeData? iconButtonTheme, // A [ButtonStyle] that overrides the default appearance of [IconButton]s when it's used with the [IconButton], the [IconButtonTheme] or the overall [Theme]'s [ThemeData.iconButtonTheme]. 
    
    ListTileThemeData? listTileTheme, // Used with [ListTileTheme] to define default property values for descendant [ListTile] widgets, as well as classes that build [ListTile]s, like [CheckboxListTile], [RadioListTile], and [SwitchListTile].
    
    MenuBarThemeData? menuBarTheme, //  A data class that [MenuBarTheme] uses to define the visual properties of [MenuBar] widgets.
    
    MenuButtonThemeData? menuButtonTheme, // A [ButtonStyle] theme that overrides the default appearance of [SubmenuButton]s and [MenuItemButton]s when it's used with a [MenuButtonTheme] or with the overall [Theme]'s [ThemeData.menuTheme].
    
    MenuThemeData? menuTheme, //  Defines the configuration of the submenus created by the [SubmenuButton], [MenuBar], or [MenuAnchor] widgets.
    
    NavigationBarThemeData? navigationBarTheme, // Defines default property values for descendant [NavigationBar] widgets.
    
    NavigationDrawerThemeData? navigationDrawerTheme, //  Defines default property values for descendant [NavigationDrawer] widgets.
    
    NavigationRailThemeData? navigationRailTheme, // Defines default property values for descendant [NavigationRail] widgets.
    
    OutlinedButtonThemeData? outlinedButtonTheme, //  A [ButtonStyle] that overrides the default appearance of [OutlinedButton]s when it's used with [OutlinedButtonTheme] or with the  overall [Theme]'s [ThemeData.outlinedButtonTheme].
    
    PopupMenuThemeData? popupMenuTheme, // Defines the visual properties of the routes used to display popup menus as well as [PopupMenuItem] and [PopupMenuDivider] widgets.
    
    ProgressIndicatorThemeData? progressIndicatorTheme, // Defines the visual properties of [ProgressIndicator] widgets.
    
    RadioThemeData? radioTheme, // Defines default property values for descendant [Radio] widgets.
    
    SearchBarThemeData? searchBarTheme, // Defines default property values for descendant [SearchBar] widgets.
    
    SearchViewThemeData? searchViewTheme, // Defines the configuration of the search views created by the [SearchAnchor] widget.
    
    SegmentedButtonThemeData? segmentedButtonTheme, // Overrides the default values of visual properties for descendant [SegmentedButton] widgets.
    
    SliderThemeData? sliderTheme,//Use this class to configure a [SliderTheme] widget, or to set the [ThemeData.sliderTheme] for a [Theme] widget.
    
    SnackBarThemeData? snackBarTheme,//Customizes default property values for [SnackBar] widgets.
    
    SwitchThemeData? switchTheme,//Defines default property values for descendant [Switch] widgets.
    
    TabBarTheme? tabBarTheme,//Defines a theme for [TabBar] widgets.
    
    TextButtonThemeData? textButtonTheme,//  A [ButtonStyle] that overrides the default appearance of  [TextButton]s when it's used with [TextButtonTheme] or with the overall [Theme]'s [ThemeData.textButtonTheme].
    一个[ButtonStyle],当它与[TextButtonTheme]或整体[Theme]的[ThemeData.TextButtonTheme]一起使用时,它覆盖[TextButton]的默认外观。
    
    TextSelectionThemeData? textSelectionTheme,// Defines the visual properties needed for text selection in [TextField] and [SelectableText] widgets.
    
    TimePickerThemeData? timePickerTheme,//Defines the visual properties of the widget displayed with [showTimePicker].
    
    ToggleButtonsThemeData? toggleButtonsTheme,//Defines the color and border properties of [ToggleButtons] widgets.

    TooltipThemeData? tooltipTheme,// Defines the visual properties of [Tooltip] widgets. 
    定义[Tooltip]小部件的视觉属性。



iconTheme:IconThemeData 设置icon的颜色 Appbar中的icon无效

 iconTheme: IconThemeData(
         color: Colors.deepPurple
       )
  Icon(Icons.abc,size: 50,),
            IconButton(onPressed: (){}, icon: Icon(Icons.ac_unit)),

在这里插入图片描述

  • 换个颜色
 iconTheme: IconThemeData(
         color: Colors.deepOrangeAccent
       )

在这里插入图片描述

ActionIconThemeData? actionIconTheme,

  • 它用[ActionIconTheme.of]或整个[Theme]的[ThemeData.ActionIconTheme]覆盖[BackButton]、[CloseButton]、[DrawerButton和[EndDrawerButton的默认图标。
    以下例子将返回按钮改为ABC图标
 actionIconTheme: ActionIconThemeData(
          backButtonIconBuilder: (context){
            return Icon(Icons.abc,size: 50,color: Colors.deepPurple,);
          }
        )
 BackButton(),
  IconButton(icon: Icon(Icons.access_alarms), onPressed: () {}),

在这里插入图片描述

BadgeThemeData? badgeTheme, 用于定义Badge小部件主题

 Badge(
              child: Icon(Icons.abc),
              backgroundColor: Colors.yellow,
              textColor: Colors.deepPurple,
              label: Text("122"),
            ),

在这里插入图片描述

 Badge(
              child: Icon(Icons.abc),
              label: Text("122"),
            ),
badgeTheme: BadgeThemeData(
            textColor:Colors.deepOrange,
          smallSize: 100,
          backgroundColor: Colors.deepPurple
        )

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1423615.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

arcgis 如何计算线的长度和面的面积

一、线要素长度计算 1.打开线shp图层,右键图层-打开属性表(CtrlT) 2.在表选项里选添加字段 添加成功后,属性表多了一个新添加的字段 3.右键点击长度选择计算几何 二、面要素面积计算 面积计算跟长度计算一样,…

linux jenkins相关命令

1.jenkins启动命令 [rootlocalhost /]#service jenkins start 2.jenkins停止命令 [rootlocalhost /]#service jenkins stop 3.查询jenkins状态命令 [rootlocalhost /]#service jenkins status 4.重启jenkins命令 [rootlocalhost /]#service jenkins restart Jenkins默认的端口号…

WINDOWS中电源设置小工具

你可以使用WinPowerSet,玩CS2之前,把电源设置为“高性能”,玩后设置为“平衡”。 WinPowerSet 下载地址: 链接:https://pan.baidu.com/s/1iOp29c4ica9L47t_l9lZ2w?pwdd248 提取码:d248 最近新配了一台12…

flutter 搜索框实现,键盘搜索按钮,清空,防抖

import package:flutter/material.dart; import package:flutter_screenutil/flutter_screenutil.dart; import package:flutter_svg/svg.dart; import package:sy_project/config/app_colors.dart; import package:sy_project/core/assets.dart;/// 搜索textview class Custom…

Qt 基础之QDataTime

Qt 基础之QDataTime 引言一、获取(设定)日期和时间二、时间戳三、时间计算 (重载运算符) 引言 QDataTime是Qt框架中用于处理日期和时间的类。它提供了操作和格式化日期、时间和日期时间组合的功能。QDataTime可以用于存储和检索日期和时间、比较日期和时间、对日期和时间执行算…

C语言字符串操作函数详解①strlen函数的讲解与三种模拟实现方法(建议三连收藏)

目录 ​编辑 前言 1.strlen函数介绍 2.模拟实现strlen 2.1计数器做法 2.2不创建临时变量,通过递归的方法 2.3利用两个指针相减 3.结语 前言 C语言中对字符和字符串的处理很是频繁,但是C语言本身是没有字符串类型的,字符串通常放在常量…

DC-磁盘配额(23国赛真题)

2023全国职业院校技能大赛网络系统管理赛项–模块B:服务部署(WindowServer2022) 文章目录 DC-磁盘配额题目配置步骤验证查看DC2驱动器C:\的磁盘配额,限制磁盘空间,警告等级等配置 DC-磁盘配额 题目 在DC2驱动器C:\上…

C#: form 添加窗体最小化事件,添加系统托盘图标,点击后可以打开、最小软件窗口

说明: 1.实现窗体在最小化后触发一个事件,可以去实现需要的功能。 2.最小化后软件图标出现在系统右下角的托盘串口。 3.点击托盘口的图标可以实现软件弹出窗口和最小化的切换。 1.参考办法 以下是判断C#窗体最小化到状态栏的状态的方法:…

机器学习 低代码 ML:PyCaret 的使用

✅作者简介:人工智能专业本科在读,喜欢计算机与编程,写博客记录自己的学习历程。 🍎个人主页:小嗷犬的个人主页 🍊个人网站:小嗷犬的技术小站 🥭个人信条:为天地立心&…

Spark SQL的高级用法

一. 快速生成多行的序列 需求:请生成一列数据, 内容为 1 , 2 , 3 , 4 ,5 -- 快速生成多行的序列 -- 方式一 select explode(split("1,2,3,4,5",",")); --方式二 /*序列函数sequence(start,stop,step):生成指定返回的列表数据[start,stop]必须传入,step步…

充电桩项目实战:搞定多数据源!

你好,我是田哥 最近,我在对充电桩项目进行微服务升级中,既然是项目升级,难免会遇到各种各样的问题。比如:分布式事务问题、多数据源问题、分布式锁问题等。 项目技术栈: SpringSpring BootSpring Cloud Ali…

实战教程:使用Spring Boot和Vue.js开发社区团购管理系统

✍✍计算机编程指导师 ⭐⭐个人介绍:自己非常喜欢研究技术问题!专业做Java、Python、微信小程序、安卓、大数据、爬虫、Golang、大屏等实战项目。 ⛽⛽实战项目:有源码或者技术上的问题欢迎在评论区一起讨论交流! ⚡⚡ Java实战 |…

【Docker】了解Docker Desktop桌面应用程序,TA是如何管理和运行Docker容器(1)

欢迎来到《小5讲堂》,大家好,我是全栈小5。 这是《Docker容器》序列文章,每篇文章将以博主理解的角度展开讲解, 特别是针对知识点的概念进行叙说,大部分文章将会对这些概念进行实际例子验证,以此达到加深对…

linux安装mongodb数据库启动报错? 都是冰红茶滴水儿

先展示报错信息 网上一大推说是关闭不正确导致的,然后给出的解决方法是 ./mongod -f mongodb.conf --repair吊用没有,还是报错: about to fork child process, waiting until server is ready for connections. forked process: 302226 ERROR: child process failed, exited…

资深Android逆袭、华为鸿蒙为安卓程序员开辟了一条新道路

本文章主要从以下5个方面来展开聊聊这个话题: 1.什么是鸿蒙 2.鸿蒙系统发展时间线 3.鸿蒙是套壳Android吗? 4.鸿蒙的生态(用户以及开发者) 5.一些建议 1月18日,在鸿蒙生态千帆启航仪式上,华为宣布了继鸿蒙4…

【原创】VMware创建子网,并使用软路由获得访问互联网的能力,并通过静态路由让上层网络访问位于虚拟机的子网

前言 一看标题就很离谱,确实内容也有点复杂,我的初衷是为后面搞软路由做准备,先通过VMware进行可行性验证,确定方案是否可行,再做下一步的计划。结论当然可以的,能通能访问,强的不行。 网络拓…

jdk17新特性—— 密封类(Sealed Classes)

目录 一、密封类(Sealed Classes)的概述1.1、概述1.2、特性1.3、注意事项 二、密封类(Sealed Classes)代码示例2.1、密封类(Sealed Classes)代码结构示例2.2、密封类(Sealed Classes)代码示例 三、密封类(Sealed Classes)接口代码示例3.1、密封类(Sealed Classes)接口代码结构示…

项目解决方案:4G/5G看交通数字化视频服务平台技术方案

目 录 1.总体描述 2.系统结构图 3.系统功能 3.1 信息交互 3.2 语音对讲 3.3 实时码流转换 3.4 流媒体集群和扩容 3.5 负载均衡 3.6 流媒体分发 3.7 流媒体点播 4.系统标准 4.1 流媒体传输 4.2 视频格式 4.3 质量标准 5.设备清单 1.总体描述 视频监控平…

LabVIEW潜油电泵数据采集系统

LabVIEW潜油电泵数据采集系统 介绍一个基于LabVIEW的潜油电泵数据采集系统。该系统目的是通过高效的数据采集和处理,提高潜油电泵的性能监控和故障诊断能力。 系统由硬件和软件两部分组成。硬件部分主要包括数据采集卡、传感器和电泵等,而软件部分则是…

STM32实时时钟(RTC)的配置和使用方法详解

实时时钟(RTC)是STM32系列微控制器上的一个重要模块,用于提供准确的时间和日期信息。在本文中,我们将详细介绍STM32实时时钟的配置和使用方法。 ✅作者简介:热爱科研的嵌入式开发者,修心和技术同步精进 ❤欢…