-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_CastError (type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'List<dynamic>?' in type cast) #16
Comments
I solved the above problem, this time it gives this error _TypeError (type '() => Null' is not a subtype of type '(() => StoryItem)?' of 'orElse') |
@awaik this issue is still persesting _TypeError (type '() => Null' is not a subtype of type '(() => StoryItem)?' of 'orElse') |
Can you please provide full error log? |
`[GETX] OPEN BOTTOMSHEET 71736793 ════════ Exception caught by widgets library ═══════════════════════════════════ The relevant error-causing widget was (elided 3 frames from dart:async) |
am having same issue. I have done automatically, that is by generating the data class by vs code pluggin. |
Hi, |
I too am getting the same bug |
I solved the problem. You can solve it by following the steps below. error: _TypeError (type '() => Null' is not a subtype of type '(() => StoryItem)?' of 'orElse') solution: I used firstWhereOrNull instead of 'firstWhere' everywhere in 'story_view.dart', function from 'collection' package and it solved my problem. Below is an example usage. Replace firstWhere with firstWhereOrNull |
Stories _$StoriesFromJson(Map<String, dynamic> json) {
return Stories(
storyId: json['storyId'] as String?,
date: json['date'] == null ? null : DateTime.parse(json['date'] as String),
file: (json['file'] as List<dynamic>?)?.map((e) => StoryData.fromJson(e as Map<String, dynamic>)).toList(),
previewImage: json['previewImage'] as String?,
previewTitle: (json['previewTitle'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(k, e as String),
),
);
}
The text was updated successfully, but these errors were encountered: