简体   繁体   English

Flutter Https 未处理异常:无效参数

[英]Flutter Https Unhandled Exception: Invalid argument(s)

I want to show data in listview (example as hardcode)我想在列表视图中显示数据(例如硬代码) 在此处输入图像描述

When I want to get the value it's not working当我想获得它不起作用的价值时

I/flutter ( 9640): [{"No":0,"interest":"0.00","balance":"11,000,000,000.00","principal":"0.00","Installment":"0.00","Status":true},{"No":1,"interest":"110,000,000.00","balance":"0.00","principal":"11,000,000,000.00","Installment":"11,110,000,000.00","Status":true}]
I/flutter ( 9640): true
E/flutter ( 9640): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Invalid argument(s)
E/flutter ( 9640): #0      _StringBase.+ (dart:core-patch/string_patch.dart:272:57)

here is FetchData async这是 FetchData 异步

 List<LoanModel> _loanmodel = <LoanModel>[];

  Future<LoanModel> _fetchData() async {
    setState(() {
      loading = true;
    });
    final response =
    await http.get("http://192.168.0.23/Api/loansimulation.php?periodtime=" + periodtime + "&interestpermonth=" + interestpermonth + "&loanamountrequest=" +loanamountrequest); //with hardcode working fine
    if (response.statusCode == 200) {
      final data = jsonDecode(response.body);
      setState(() {
        for (Map i in data) {
          _loanmodel.add(LoanModel.fromJson(i));
        }
        loading = false;
      });
    }
  }

How to get the value of periodtime, interestpermonth and loanamountrequest from API and get value based on input value in flutter?如何从 API 获取 periodtime、interestpermonth 和 loanamountrequest 的值,并根据 flutter 中的输入值获取值?

So I mentioned the below example how can you show the data you can fetch from this function.所以我提到了下面的例子,你如何显示你可以从这个 function 中获取数据

    listView.Builder(

     itemcount=_loanmodel.length;
     builder(context,index)
    {
     return Container(
    child:Column(
    childern[
    Text(_loanmodel[index].balance)
    ])
    );
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 未处理的异常:无效参数 Flutter - Unhandled Exception: Invalid argument(s) Flutter Flutter:未处理的异常:无效的参数 - Flutter : unhandled exception: invalid argument 未处理的异常:无效参数(值):不得为 null Flutter 2 - Unhandled Exception: Invalid argument(s) (value): Must not be null Flutter 2 Flutter 未处理的异常:无效参数(值):不得为 null - Flutter Unhandled Exception: Invalid argument(s) (value): Must not be null 未处理的异常:无效参数:flutter 中“用户”的实例 - Unhandled Exception: Invalid argument: Instance of 'User' in flutter E/flutter(6866):[错误:flutter/lib/ui/ui_dart_state.cc(148)]未处理异常:无效参数 - E/flutter ( 6866): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: Invalid argument(s) Flutter,Dart,FireBase:[错误:颤振/lib/ui/ui_dart_state.cc(199)) - 无效的TAP异常 - Flutter, Dart, FireBase: [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Invalid argument(s) - onTap GestureDetcture 未处理的异常:无效参数(值):不得为 null - Unhandled Exception: Invalid argument(s) (value): Must not be null 未处理的异常:无效参数:“加密”的实例 - Unhandled Exception: Invalid argument: Instance of 'Encrypted' 未处理的异常:无效参数:“未来”的实例<String?> &#39; - Unhandled Exception: Invalid argument: Instance of 'Future<String?>'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM