skip to Main Content

I want to create a List and add values like this, but im new with flutter so i don’t know

     {
        'studAttId': 'null',
        'divisionId': '4365eb0b-fb48-42f9-be4e-e9c1c695aeab',
        'id': 'e49d6d0d-0036-417c-a0ff-330e51cb947d',
        'forenoon': 'P',
        'afternoon': 'P',
        'admNo': '496',
        'rollNo': 'null',
        'name': 'A M MUHAMMED AFSAL',
        'terminatedStatus': 'null'
      },

2

Answers


  1. do this

    yourList.add({
            'studAttId': 'null',
            'divisionId': '4365eb0b-fb48-42f9-be4e-e9c1c695aeab',
            'id': 'e49d6d0d-0036-417c-a0ff-330e51cb947d',
            'forenoon': 'P',
            'afternoon': 'P',
            'admNo': '496',
            'rollNo': 'null',
            'name': 'A M MUHAMMED AFSAL',
            'terminatedStatus': 'null'
          });
    
    Login or Signup to reply.
  2. First, preferably you can reformat the type of your map like this:

    Map<String, dynamic> yourMap = { 
        'studAttId': 'null',
        'divisionId': '4365eb0b-fb48-42f9-be4e-e9c1c695aeab',
        'id': 'e49d6d0d-0036-417c-a0ff-330e51cb947d',
        }
    
    
    
     List<dynamic> yourList = []
     yourList.addAll(yourMap.values)
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search