Flutter学习
Flutter学习笔记
小溪彼岸
万里长征,日进一步 , 好记性不如烂笔头
展开
-
Flutter笔记-Http网络请求基于
参考资料:https://blog.csdn.net/u011272795/article/details/827655441、安装diopubspec.yamldependencies: flutter: sdk: flutter dio: 1.0.9 #dio: x.x.x latest version(这个方式报错) 网络请求框架2、请求工具类/** * 网...原创 2018-11-29 15:20:13 · 1287 阅读 · 0 评论 -
Flutter笔记-There are multiple heroes that share the same tag within a subtree
在使用FloatingActionButton时报错了floatingActionButton: Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: <Widget>[ FloatingActionButton( onPressed: () =原创 2020-07-09 15:16:34 · 355 阅读 · 0 评论 -
Flutter笔记-引入CupertinoAlertDialog报‘The getter alertDialogLabel was called on null’问题
报错的主要是因为Flutter国际化和ios风格Dialog冲突造成的。解决方案:1、在MaterialApp中添加FallbackCupertinoLocalisationsDelegatelocalizationsDelegates: [ GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate, // 在国际化时造成和Dialog冲突解决方案 FallbackCupertinoLoc原创 2020-06-15 09:55:00 · 331 阅读 · 0 评论 -
Flutter笔记-实现圆角的几种方式
裁剪ClipRRectClipRRect组件可以对子组件进行圆角裁剪,默认圆角半径为0。ClipRRect定义如下:ClipRRect ClipRRect({ Key key, BorderRadius borderRadius, // 圆角 CustomClipper<RRect> clipper, Clip clipBehavior, Widget child // 子内容})设置单边圆角new ClipRRect( child: Image.n原创 2020-06-12 17:22:36 · 4145 阅读 · 0 评论 -
Mac vscode配置flutter&创建项目
1、将项目clone到/Users/xx/git clone -b dev https://github.com/flutter/flutter.git2、配置flutter路径vim ~/.bash_profile添加以下配置 export PUB_HOSTED_URL=https://pub.flutter-io.cn export FLUTTER_STORAGE_BASE...原创 2018-09-20 21:07:20 · 10623 阅读 · 0 评论 -
第一个Flutter App
简单构建一个页面代码如下:import 'package:flutter/material.dart';// app 入口void main() => runApp(new MyApp());class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { r...原创 2018-09-20 21:50:43 · 459 阅读 · 0 评论 -
Flutter笔记-页面跳转
push操作核心代码Navigator.push(context, new MaterialPageRoute(builder: (context)=> new SecondPage()));pop操作核心代码Navigator.pop(context);完整代码import 'package:flutter/material.dart';void main(){ ru...原创 2018-11-26 17:31:52 · 493 阅读 · 0 评论 -
Flutter笔记-Android&iOS原生交互
Flutter同React Native一样,可以调用原生方法。Flutter 代码如下:import 'package:flutter/material.dart';import 'package:flutter/services.dart';import 'dart:async'; // 异步void main() => runApp(new MyApp());...原创 2018-11-23 18:38:38 · 3822 阅读 · 0 评论 -
Flutter笔记-Http网络请求
参考资料:https://blog.csdn.net/duo_shine/article/details/81280614flutter http网络请求,可以使用已有的插件来完成。插件版本: http: ^0.11.3+16插件引入:pubspec.yamldependencies: flutter: sdk: flutter http: ^0.11.3+16htt...原创 2018-11-27 18:50:15 · 2398 阅读 · 0 评论