上一页 1 2 3 4 5 6 ··· 14 下一页
摘要: 《Flutter实战·第二版》 Flutter APP 安装包中会包含代码和 assets(资源)两部分。Assets 是会打包到程序安装包中的,可在运行时访问。常见类型的 assets 包括静态数据(例如JSON文件)、配置文件、图标和图片等。 指定assets 以及assets变体 assets 阅读全文
posted @ 2024-07-11 21:30 ayubene 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 参考文章1 参考文章2 是在自己本地(http://localhost:5171/)、调后端本地的接口(http://193.0.1.2:20011/ 随便编的,但应该类似) 最开始是这样写的: // 这个是get的封装 export function get(url, data) { return 阅读全文
posted @ 2024-07-11 13:27 ayubene 阅读(55) 评论(0) 推荐(0) 编辑
摘要: 《Flutter实战·第二版》 简介 类似node的npm 配置文件是pubspec.yaml name:应用或包名称。 description: 应用或包的描述、简介。 version:应用或包的版本号。 dependencies:应用或包依赖的其他包或插件。 dev_dependencies:开 阅读全文
posted @ 2024-07-09 23:11 ayubene 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 《Flutter实战·第二版》 简单示例-跳转页面 import 'package:flutter/material.dart'; import 'dart:ui'; // import 'package:flutter/cupertino.dart'; // void main() { // ru 阅读全文
posted @ 2024-07-09 22:53 ayubene 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 《Flutter实战·第二版》 Widget管理自身状态:自己继承StatefulWidget,自己内部设置变量(State)并进行管理 父Widget管理子Widget的状态:parent继承自StatefulWidget,设置变量及函数,传递给child;child继承自StatelessWid 阅读全文
posted @ 2024-07-07 23:05 ayubene 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 给设置宽高的Container包一个父组件(如Center)即可 参考文章-写了为什么会这样 原代码 class TapboxA extends StatefulWidget { TapboxA({Key? key}) : super(key: key); @override _TapboxASta 阅读全文
posted @ 2024-07-07 16:39 ayubene 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 学习链接 什么是widget 描述UI元素的配置信息 Widget类本身是一个抽象类,其中最核心的就是定义了createElement()接口,在 Flutter 开发中,我们一般都不用直接继承Widget类来实现一个新组件,相反,我们通常会通过继承StatelessWidget或StatefulW 阅读全文
posted @ 2024-07-07 11:49 ayubene 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 在使用cupertino的时候出现了这个问题,不过使用其他组件库也是类似的 原代码: import 'package:flutter/cupertino.dart'; void main() => runApp(const CupertinoTestRoute()); class Cupertino 阅读全文
posted @ 2024-07-07 11:48 ayubene 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 原代码 class ContextRoute extends StatelessWidget { const ContextRoute(); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( 阅读全文
posted @ 2024-07-06 15:20 ayubene 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 原来的代码 class ContextRoute extends StatelessWidget { const ContextRoute(); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBa 阅读全文
posted @ 2024-07-06 15:01 ayubene 阅读(6) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 14 下一页