Flutter初学
晴天无痕
一个不咋地的菜鸟程序员
展开
-
flutter 解决弹出键盘异常的问题
包裹: SingleChildScrollView。原创 2023-07-25 11:57:44 · 397 阅读 · 0 评论 -
Flutter默认弹出框
child: Text('暂不更新',style: TextStyle(color: GColors.color153),),Text('请输入正确的图片地址哦。child: Text('去更新'),title: Text('有新版本'),原创 2023-07-20 13:51:44 · 216 阅读 · 0 评论 -
flutter 延时操作
Future.delayed(Duration(milliseconds: 2000), () {//2秒。Navigator.of(context).pop("pop回去数据");原创 2023-07-19 17:48:40 · 251 阅读 · 0 评论 -
textfield右下角字数统计显示
counterText: "",//此处控制最大字符是否显示。原创 2023-07-18 18:02:19 · 235 阅读 · 0 评论 -
关于listview第0个点击不好使的情况
需要在最顶端加一个 空白区域。原创 2023-07-18 17:38:44 · 45 阅读 · 0 评论 -
flutter 全局变量的设置方法
在需要调用的地直接调用即可就是这么简单。原创 2023-07-04 15:15:50 · 546 阅读 · 1 评论 -
flutter 实现蒙版
用到自带的widget。原创 2023-07-03 14:45:32 · 393 阅读 · 0 评论 -
Flutter常见Bug及处理方法汇总
1.解决嵌套listView添加刷新(SmartRefresher属于import 'package:pull_to_refresh/pull_to_refresh.dart';physics: NeverScrollableScrollPhysics(),到listview即可实现listview和SingleChildScrollView的滑动可同时出发。原创 2023-06-08 10:28:40 · 468 阅读 · 0 评论 -
关于flutter第三方刷新pull_to_refresh: ^2.0.0 版本的使用
title: Text("我的救援",style: TextStyle(color: Colors.black),),2.使用地方 import 'package:pull_to_refresh/pull_to_refresh.dart';canLoadingText: '松开刷新',refreshingText: '刷新中',completeText: '刷新完成',releaseText: '松开刷新',loadingText:'刷新中',idleText: '下拉刷新',1.导入本地就不废话了。原创 2023-06-06 13:53:12 · 503 阅读 · 0 评论 -
fluter set get
class Person {late String name;set setName(String name) {this.name = name;}String get getName {return name;}}原创 2021-08-30 16:33:13 · 82 阅读 · 0 评论 -
Dart定义变量
// 变量类型推到var age = 20;// 常量final heiht = 187;//常量const text = 'const';// const 和 final区别 const在运行前需要赋值 而final不需要原创 2021-08-27 16:54:30 · 108 阅读 · 0 评论 -
flutter横向列表
import 'package:flutter/material.dart';void main(List<String> args) {runApp(MyApp());}class MyApp extends StatelessWidget {@overrideWidget build(BuildContext context) {return MaterialApp(title: 'XXX',home: Scaffold(appBar: new原创 2021-08-25 11:25:07 · 437 阅读 · 0 评论 -
flutter 纵向列表
body: new ListView(children: <Widget>[//一个一个控件new Image.network('https://t7.baidu.com/it/u=1819248061,230866778&fm=193&f=GIF',),new ListTile(leading: new Icon(Icons.border_right),title: new Text('neirong'),),new ListTile(原创 2021-08-25 11:03:18 · 66 阅读 · 0 评论 -
flutter Image设置
以网络图为例child: new Image.network('https://IF',scale: 4,//缩放fit: BoxFit.fill, //填充color: Colors.green,//重叠颜色colorBlendMode: BlendMode.darken,//模式repeat: ImageRepeat.repeatY,//纵向填充),原创 2021-08-24 18:14:32 · 374 阅读 · 0 评论 -
flutter文案
child: new Text('hallo',//内容style: TextStyle(//内容设置fontSize: 30,),),原创 2021-08-24 17:22:53 · 74 阅读 · 0 评论 -
flutter边距问题
child: Container(padding: const EdgeInsets.fromLTRB(10, 30, 10, 10),//里边内容边距margin: const EdgeInsets.fromLTRB(10, 30, 10, 10),//距离外部边距)原创 2021-08-24 17:21:27 · 4781 阅读 · 0 评论 -
flutter渐变色
渐变色:decoration: new BoxDecoration(gradient: const LinearGradient(colors: [Colors.lightBlue,Colors.purpleAccent,])),原创 2021-08-24 17:20:03 · 174 阅读 · 0 评论