Flutter 3.29.0 新特性 CupertinoNavigationBar 可配置bottom属性

news/2025/2/21 0:12:49/

Flutter 3.29版本优化了开发流程并提升了性能,对 Impeller、Cupertino、DevTools 等进行了更新。

CupertinoNavigationBar和CupertinoSliverNavigationBar现在接受底部小部件,通常是搜索字段或分段控件。

例如本小节内容就是放置了一个输入框(当然也是官方的Demo):

class NavBarExample extends StatefulWidget {const NavBarExample({super.key});State<NavBarExample> createState() => _NavBarExampleState();
}class _NavBarExampleState extends State<NavBarExample> {Widget build(BuildContext context) {return CupertinoPageScaffold(navigationBar: const CupertinoNavigationBar(middle: Text('CupertinoNavigationBar Sample'),//核心在这里bottom: _NavigationBarSearchField(),automaticBackgroundVisibility: false,),child: Column(children: <Widget>[Container(height: 50, color: CupertinoColors.systemRed),Container(height: 50, color: CupertinoColors.systemGreen),Container(height: 50, color: CupertinoColors.systemBlue),Container(height: 50, color: CupertinoColors.systemYellow),],),);}
}

_NavigationBarSearchField 的定义如下:

class _NavigationBarSearchField extends StatelessWidgetimplements PreferredSizeWidget {const _NavigationBarSearchField();static const double padding = 8.0;static const double searchFieldHeight = 35.0;Widget build(BuildContext context) {return const Padding(padding: EdgeInsets.symmetric(horizontal: padding, vertical: padding),child: SizedBox(height: searchFieldHeight,child: CupertinoSearchTextField(),),);}Size get preferredSize =>const Size.fromHeight(searchFieldHeight + padding * 2);
}

在这里插入图片描述


http://www.ppmy.cn/news/1573336.html

相关文章

PostgreSQL 添加索引导致崩溃,参数调整需谨慎--文档未必完全覆盖场景

开头还是介绍一下群&#xff0c;如果感兴趣PolarDB ,MongoDB ,MySQL ,PostgreSQL ,Redis, OceanBase, Sql Server等有问题&#xff0c;有需求都可以加群群内有各大数据库行业大咖&#xff0c;可以解决你的问题。加群请联系 liuaustin3 &#xff0c;&#xff08;共2720人左右 1 …

初识Linux(9):程序地址空间

实验&#xff1a; 1 #include <stdio.h>2 #include <sys/types.h>3 #include <unistd.h>4 #include <string.h>5 6 int g_val 100;7 8 int main()9 {10 printf("我是一个进程: pid:%d,ppid:%d\n",getpid(),getppid());11 pid_t id for…

postgresql FSM页面怎么组织

PostgreSQL 的空闲空间映射&#xff08;Free Space Map&#xff0c;FSM&#xff09;是用于跟踪堆和索引关系中可用空间的数据结构。FSM 的设计目标是快速定位到有足够空间容纳新元组的页面&#xff0c;或者决定是否需要扩展新的页面。 FSM 页面的组织方式 存储结构 每个堆和索…

什么是AI Agent、Chat、RAG、MoE

什么是AI Agent、Chat、RAG、MoE 目录 什么是AI Agent、Chat、RAG、MoE定义与原理功能特点应用场景AI Agent有哪些关键组成部分感知模块决策模块知识模块行动模块学习模块AI Agent、Chat、RAG、MoE是人工智能领域中不同的概念和技术,它们在功能、原理和应用等方面存在一些区别…

matlab齿轮传动

实现齿轮啮合分析&#xff0c;齿轮传动非线性分析&#xff0c;对扭转振动方程组进行求解&#xff0c;可得到齿轮扭转角随时间变化相关参数 列表 齿轮传动非线性分析&#xff0c;对扭转振动方程组进行求解&#xff0c;可得到齿轮扭转角随时间变化相关参数/niu_gou_yuan_Rg.m , …

人工智能(AI)在癌症休眠研究及精准肿瘤学中的应用|顶刊速递·25-02-18

小罗碎碎念 推文速览 癌症休眠是导致癌症复发转移的关键因素&#xff0c;当前治疗策略对其效果不佳&#xff0c;因此深入探究癌症休眠机制并开发针对性疗法至关重要。 文章首先阐述癌症休眠的基本概念&#xff0c;包括肿瘤块休眠和细胞休眠两种类型&#xff0c;详细介绍癌细胞…

WebSocket 小白快速入门(2025)

目录 一、websocket 背景和特性 二、websocket 和 ajax区别是什么 &#xff1f; 三、传统方案和 websocket 方案对比 服务端推送web方案 1.短轮询 2.长轮询 3.Websocket长连接 四、websocket 代码实现方案 1.tomcat实现websocket 2.netty实现websocket 为啥选netty…

基于单片机ht7038 demo

单片机与ht7038 demo&#xff0c;三相电能表&#xff0c;电量数据包括电流电压功能&#xff0c;采用免校准方法 列表 ht7038模块/CORE/core_cm3.c , 17273 ht7038模块/CORE/core_cm3.h , 85714 ht7038模块/CORE/startup_stm32f10x_hd.s , 15503 ht7038模块/CORE/startup_stm32…