fromMap (dynamic message) is not defined

Asked 1 years ago, Updated 1 years ago, 371 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.