skip to Main Content

Flutter – Changing the state

I have a function checkAvailability that changes the state of variable isTaken to true if the condition matches . checkAvailabiltiy(String text){ for(var snapshot in allData){ var name = snapshot['username'].toString().toLowerCase(); if(text.toLowerCase() == name){ setState(() { isTaken =true; }); } else{ }…

VIEW QUESTION

Flutter – Type 'String' can't be assigned to the parameter type 'Map<String, dynamic>? Tried some solutions but still Stuck

Here is my code: Map<String, dynamic>? myMap = { 'conversationId': iD, 'type': 'text', 'data': _controller.text.toString(), 'msgLength':_controller.text.length, 'senderId': Provider.of( context,listen: false).id, 'createdOn': 190823, 'messageState': 'delivered', 'isDeleted': 0, 'id': 3048, }; String encoded = json.encode(myMap); // Make the POST request and wait…

VIEW QUESTION
Back To Top
Search