惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
Jina AI
Jina AI
雷峰网
雷峰网
Blog — PlanetScale
Blog — PlanetScale
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
博客园 - 司徒正美
罗磊的独立博客
J
Java Code Geeks
Engineering at Meta
Engineering at Meta
WordPress大学
WordPress大学
Vercel News
Vercel News
A
About on SuperTechFans
I
InfoQ
D
DataBreaches.Net
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
aimingoo的专栏
aimingoo的专栏
宝玉的分享
宝玉的分享
P
Proofpoint News Feed
Microsoft Azure Blog
Microsoft Azure Blog
美团技术团队

时间的朋友

Windows 命令行密码重置 Anaconda安装 typescript 注解解读1 Konvajs Shape加载自定义图片 sshpass 使用 why-is-node-running webgl笔记 SharedArrayBuffer is not defined blender 常用快捷键 | 时间的朋友 vue -- v3.4commit提交记录2 vue2 升级vue3报错问题整理 着色器 expressjs 源码 hyper-V arch linux 网络配置 element input数字格式化 three 拼接货架 WebAudio笔记 Windows nginx重启bat脚本 vue -- v3.4commit提交记录 URI malformed vue3 -- Class 对象在组件中使用范例 | 时间的朋友 ruby 安装和升级 element-plus 老版本cascader使用卡死问题 vue3 内置Transition组件 | 时间的朋友 前端memo的实现 | 时间的朋友 Vue -- vue-class-component源码 | 时间的朋友 linux 优化脚本 typescript 装饰器 | 时间的朋友 microbundle 源码 | 时间的朋友 WSL2问题解决WslRegisterDistribution failed with error: 0x800701bc
flutter 问题整理 | 时间的朋友
2022-10-16 · via 时间的朋友

Published: · LastMod: December 11, 2022 · 717 words

Undefined name ‘OutlineButton’. 🔗

使用TextButton代替

Try adding either an explicit non-’null’ default value or the ‘required’ modifier. 🔗

空安全报错,一旦sdk升级到2.12以上之后,那么就会执行空安全检查

  1. 添加关键字 required
  2. 添加默认值

flutter 运行时 “Your session has expired. Please log in.” 🔗

image.png

Xcode ——>Preferences…——> accounts 重新登录 ——> fix

Failed assertion: line 4680 pos 14: ‘owner!._debugCurrentBuildTarget == this’: is not true. 🔗

出现在使用CustomScrollView的时候

Sliver名称说明
SliverAppBar对应 AppBar,主要是为了在 CustomScrollView 中使用。
SliverToBoxAdapter一个适配器,可以将 RenderBox 适配为 Sliver,后面介绍。
SliverPersistentHeader滑动到顶部时可以固定住,后面介绍。

常规组件需要使用SliverToBoxAdapter包裹一层

Error: The default value of an optional parameter must be constant 🔗

当在声明Color类型时, 使用Colors.grey.shade600会报错,查询后需要定义成常量,前面加const

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
class CardPanelHeader extends StatelessWidget {
  final String leadingPanelText;
  final Color leadingPanelTextColor;
  final String trailingPanelText;
  final Color trailingPanelTextColor;

  const CardPanelHeader({
    Key key,
    this.leadingPanelText,
    this.leadingPanelTextColor = Colors.black87,
    this.trailingPanelText,
    this.trailingPanelTextColor = const Colors.grey.shade600,
  }) : super(key: key);

生成对应的应用图标 🔗

https://icon.wuruihong.com/

Column children中动态添加元素 🔗

children中进行if判断

1
2
3
4
5
6
7
8
Column(
     children: <Widget>[
     if(condition1)
      widget1,
     if(condition2)
     widget2,
_    ..._getWeatherDataWidgets(),
],)

The method ‘[]’ can’t be unconditionally invoked because the receiver can be ’null 🔗

简单判断

1
2
3
4
var list = someList;
if (list != null) {
  int a = list[0]; // No error
}

使用**?** and ??:

1
int a = someList?[0] ?? -1;

如果是数组中进行索引,加个!进行强制判断

背景色渐变 🔗

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Container(
  width: 60,
  height: 60,
  decoration: BoxDecoration(
      borderRadius: BorderRadius.all(Radius.circular(30)),
      boxShadow: [
        BoxShadow(
          color: Color.fromARGB(255, 111, 187, 249),
          blurRadius: 5,
          spreadRadius: 0.0,
        ),
      ],
      gradient: LinearGradient(
          begin: Alignment.topCenter,
          end: Alignment.bottomCenter,
          colors: [
            Color.fromARGB(255, 80, 174, 252),
            Color.fromARGB(255, 32, 131, 212),
          ])),
  child: Icon(
    Icons.edit_rounded,
    color: Colors.white,
    size: 30,
  ),
),

行平均4等份 🔗

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
Row(
  children: [
    Expanded(
      flex: 1, // you can play with this value, by default it is 1
      child: Child1(),
    ),
    Expanded(
      flex: 1, 
      child: Child2(),
    ),
    Expanded(
      flex: 1, 
      child: Child3(),
    ),
    Expanded(
      flex: 1, 
      child: Child4(),
    ),
  ],
);

Unable to upgrade Flutter: no origin repository configured 🔗

1
2
flutter channel stable
flutter upgrade --force