fromMap (dynamic message) is not defined

Asked 2 years ago, Updated 2 years ago, 392 views

It is defined as follows:

static LocationData fromMap(dynamic message){
    final Map<dynamic, dynamic>dataMap=message;
}

However, if you write the following code in the main file, it says that fromMap is not defined.What should I do?

 locationData: LocationData.fromMap(data['position']!),

flutter dart

2022-09-30 22:00

1 Answers

static LocationData fromMap(dynamic message){
    final Map<dynamic, dynamic>dataMap=message;
}

This function is not returning, otherwise nothing will happen.


2022-09-30 22:00

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.