【问题标题】:getx RxMap fluttergetx RxMap 颤动
【发布时间】:2021-10-21 16:47:18
【问题描述】:

你能帮我吗,使用包getx,当我使用带有add方法的RxMap时,它不允许我添加到RxMap中,检查getx包,但是add方法不在rxmap中

【问题讨论】:

    标签: flutter flutter-getx


    【解决方案1】:

    你可以简单地使用 RxMap 来做这样的事情,而不是像这样添加使用

    final mapObject = RxMap();
    mapObject['test'] = 'item';
    print(mapObject);
    

    输出:

    {test: item}
    

    所以,在你的情况下

    void addMapItem(){
    mapItems[DateTime.now().toString()] = DateTime.now().toString();
    }
    

    【讨论】:

      猜你喜欢
      • 2023-01-04
      • 2022-01-05
      • 2021-08-18
      • 2021-11-13
      • 1970-01-01
      • 2021-11-19
      • 2021-12-07
      • 2021-10-06
      • 2021-10-05
      相关资源
      最近更新 更多