title: Unhandled Exception: type 'List<dynamic>' is not a subtype of type 'List<CustomerTransactionDetail>'
body: <pre><code>customerDetailGet['customer_transaction_detail'] 
  </code></pre>
  <p>receive list of array
  how assign list of array to  List of CustomerTransactionDetail which is model</p>
  <p>full code</p>
  <p>actually using Provider. I have model of Customer Transaction Detail so i want to assign new receive array of list also add in previous list of CustomerTransactionDetail
  but error</p>
  <pre><code>var url = Uri.https(BaseUrl.apiBaseUrl,
            BaseUrl.apiBaseUrlSecond + 'add_customer.php', {});
        Map object = {
          &quot;c_name&quot;: nameController.text,
          &quot;c_mobile&quot;: mobileController.text,
          &quot;c_address&quot;: addressController.text,
          &quot;login_id&quot;: Constants.loginId,
        };
        var source = await http.post(url, body: jsonEncode(object));
        if (source.statusCode == 200) {
          if (jsonDecode(source.body)[&quot;status&quot;] == 200) {
            var message = jsonDecode(source.body)[&quot;result&quot;][&quot;message&quot;];
            var customerDetailGet =
                jsonDecode(source.body)[&quot;result&quot;][&quot;customer_detail&quot;];
            var customerDetail = CustomerDetail(
              accountType: customerDetailGet['account_type'],
              address: customerDetailGet['address'],
              conversationNo: customerDetailGet['conversation_no'],
              currentBalance: customerDetailGet['current_balance'],
              customerTransactionDetail: customerDetailGet['customer_transaction_detail'], // error line
              id: customerDetailGet['id'],
              mobile: customerDetailGet['mobile'],
              name: customerDetailGet['name'],
              status: customerDetailGet['status'],
            );
            int debitBalance = jsonDecode(source.body)[&quot;result&quot;]
                [&quot;credit_debit_balance&quot;][&quot;debit_balance&quot;];
            int creditBalance = jsonDecode(source.body)[&quot;result&quot;]
                [&quot;credit_debit_balance&quot;][&quot;credit_balance&quot;];
            Provider.of&lt;CustomerAndTransactionClassProvider&gt;(context,
                    listen: false)
                .addCustomer(customerDetail, debitBalance, creditBalance);
            setState(() {
              responseResult = message;
              isLoadding = false;
            });
            Navigator.pop(context);
          } else if (jsonDecode(source.body)[&quot;status&quot;] == 202) {
            setState(() {
              responseResult = jsonDecode(source.body)[&quot;result&quot;][&quot;message&quot;];
              isLoadding = false;
            });
          } else {
            setState(() {
              responseResult = &quot;sorry try again&quot;;
              isLoadding = false;
            });
          }}
  </code></pre>