上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 21 下一页
摘要: Card是卡片组件块,内容可以由大多数类型的Widget构成,Card具有圆角和阴影,这让它看起来有立 体感。 Card实现一个通讯录的卡片 class MyApp2 extends StatelessWidget { const MyApp2({super.key}); @override Wid 阅读全文
posted @ 2023-11-20 11:20 鲤斌 阅读(158) 评论(0) 推荐(0) 编辑
摘要: AspectRatio的作用是根据设置调整子元素child的宽高比。 childAspectRatio 是 GridView 和 AspectRatio 控件中的一个参数 AspectRatio首先会在布局限制条件允许的范围内尽可能的扩展,widget的高度是由宽度和比率决定 的,类似于BoxFit 阅读全文
posted @ 2023-11-20 10:15 鲤斌 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Flutter Stack组件 Stack表示堆的意思,我们可以用Stack或者Stack结合Align或者Stack结合 Positiond来实现页面的定位 布局 Alignment(对齐)类是用于表示相对于父容器的对齐方式的; Alignment 类的常见用法: Alignment.topLef 阅读全文
posted @ 2023-11-17 21:06 鲤斌 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 自定义的IconContainer class IconContainer extends StatelessWidget { Color color; IconData icon; // IconContainer(this.icon ,{super.key,required this.color 阅读全文
posted @ 2023-11-16 19:43 鲤斌 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 自定义的IconContainer void main() { runApp(MaterialApp( theme: ThemeData(primarySwatch: Colors.yellow), home: Scaffold( appBar: AppBar(title: const Text(" 阅读全文
posted @ 2023-11-16 18:53 鲤斌 阅读(21) 评论(0) 推荐(0) 编辑
摘要: Padding组件处理容器与子元素之间的间距。 class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return Containe 阅读全文
posted @ 2023-11-16 10:46 鲤斌 阅读(6) 评论(0) 推荐(0) 编辑
摘要: GridView创建网格列表主要有下面三种方式 1、可以通过GridView.count 实现网格布局 一行的 Widget 数量 class HomePage extends StatelessWidget { const HomePage({Key? key}) : super(key: key 阅读全文
posted @ 2023-11-15 18:52 鲤斌 阅读(260) 评论(0) 推荐(0) 编辑
摘要: public class RegexUtils { /** * 是否是无效手机格式 * @param phone 要校验的手机号 * @return true:符合,false:不符合 */ public static boolean isPhoneInvalid(String phone){ re 阅读全文
posted @ 2023-11-12 23:34 鲤斌 阅读(24) 评论(0) 推荐(0) 编辑
摘要: SortedSet类型 特性 1.可排序 2.元素不重复性 3.查询速度快 与普通的集合类型相比,SortedSet 主要有以下两个特点: 有序性:根据分数对元素进行排序,便于范围查找等操作。 不重复性:即使添加了相同的元素,也只会保留一个。 SortedSet 提供了许多常用的操作方法,包括添加元 阅读全文
posted @ 2023-11-12 15:37 鲤斌 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 常用函数 concat(): 连接两个或多个数组,返回连接后的新数组。 示例:const arr1 = [1, 2, 3]; const arr2 = [4, 5, 6]; const arr3 = arr1.concat(arr2); // 返回 [1, 2, 3, 4, 5, 6] copyWi 阅读全文
posted @ 2023-11-10 19:04 鲤斌 阅读(596) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 21 下一页