IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    Flutter 处理 Error Setter not found AsciiChar 问题

    androidyue发表于 2022-10-11 07:35:00
    love 0

    当我们进行了 flutter 升级后,有时候运行程序会发现无法编译,出现下面这样的错误

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    
    [        ] [   +2 ms] ../../../../.pub-cache/hosted/pub.flutter-io.cn/cached_network_image-3.2.0/lib/src/image_provider/multi_image_stream_completer.dart:152:22: Warning: Operand of null-aware operation '?.' has
    type 'SchedulerBinding' which excludes null.
    [        ] [        ]  - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../../code/flutter_3/packages/flutter/lib/src/scheduler/binding.dart').
    [        ] [        ]     SchedulerBinding.instance?.scheduleFrameCallback(_handleAppFrame);
    [        ] [        ]                      ^
    [ +402 ms] [ +414 ms] ../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-2.3.1/lib/src/structs.g.dart:554:31: Error: Member not found: 'UnicodeChar'.
    [        ] [        ]   int get UnicodeChar => Char.UnicodeChar;
    [        ] [        ]                               ^^^^^^^^^^^
    [        ] [        ] ../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-2.3.1/lib/src/structs.g.dart:555:38: Error: Setter not found: 'UnicodeChar'.
    [        ] [        ]   set UnicodeChar(int value) => Char.UnicodeChar = value;
    [        ] [        ]                                      ^^^^^^^^^^^
    [        ] [        ] ../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-2.3.1/lib/src/structs.g.dart:557:29: Error: Member not found: 'AsciiChar'.
    [        ] [        ]   int get AsciiChar => Char.AsciiChar;
    [        ] [        ]                             ^^^^^^^^^
    [        ] [        ] ../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-2.3.1/lib/src/structs.g.dart:558:36: Error: Setter not found: 'AsciiChar'.
    [        ] [        ]   set AsciiChar(int value) => Char.AsciiChar = value;
    [        ] [        ]                                    ^^^^^^^^^
    

    对于这种问题,解决起来也比较简单,执行

    1
    
    flutter pub upgrade
    




沪ICP备19023445号-2号
友情链接