小编Raj*_*j A的帖子

高架按钮主题数据边框 - Flutter

如何通过 themedata 将 sideBorder 实现为levedButton。在此输入图像描述

 elevatedButtonTheme: ElevatedButtonThemeData(
    style: ButtonStyle(side: MaterialStateProperty<BorderSide>//Stuck here),
  ),
Run Code Online (Sandbox Code Playgroud)

flutter flutter-layout flutter-theme

4
推荐指数
1
解决办法
6610
查看次数

Flutter Hive 无法检索 Map{}

我试图在配置单元数据库中存储 Map<String, int>() 。我可以存储但无法检索它提示错误的 Map()

Unhandled Exception: type '_InternalLinkedHashMap<dynamic, dynamic>' is not a subtype of type 'Map<String, int>?' in type cast
Run Code Online (Sandbox Code Playgroud)

代码:

数据控制者


Box<Map<String, int>> hiveBox = Hive.box('SaveBetBox');

  void betStorage({String? matchKey, String? statKey, int? statIndex}) {
    // Checks if the hive box has the data with following key if not adds
    hiveBox.containsKey(matchKey)
        ? null
        : hiveBox.put(
            matchKey,
            Map<String, int>(),
          );
    // Extract hive map to update or add Key values to Map with specific Key
    Map<String, int>? tm = hiveBox.get(matchKey); …
Run Code Online (Sandbox Code Playgroud)

dart flutter flutter-hive

3
推荐指数
1
解决办法
4088
查看次数