flutter_instagram_stories
flutter_instagram_stories copied to clipboard
_CastError (type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'List<dynamic>?' in type cast)
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), ), ); }
@awaik
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 [GETX] GOING TO ROUTE /StoriesSection
════════ Exception caught by widgets library ═══════════════════════════════════ The following _TypeError was thrown building RawGestureDetector(state: RawGestureDetectorState#6fcd5(gestures: [vertical drag])): type '() => Null' is not a subtype of type '(() => StoryItem)?' of 'orElse'
The relevant error-causing widget was
GetMaterialApp
lib/main.dart:44
When the exception was thrown, this was the stack
#0 ListMixin.firstWhere (dart:collection/list.dart)
#1 StoryViewState.initState
package:flutter_instagram_stories/story_view.dart:322
#2 StatefulElement._firstBuild
package:flutter/…/widgets/framework.dart:4942
#3 ComponentElement.mount
package:flutter/…/widgets/framework.dart:4781
... Normal element mounting (32 frames)
#35 Element.inflateWidget
package:flutter/…/widgets/framework.dart:3817
#36 MultiChildRenderObjectElement.inflateWidget
package:flutter/…/widgets/framework.dart:6350
#37 MultiChildRenderObjectElement.mount
package:flutter/…/widgets/framework.dart:6362
... Normal element mounting (29 frames)
#66 Element.inflateWidget
package:flutter/…/widgets/framework.dart:3817
#67 Element.updateChild
package:flutter/…/widgets/framework.dart:3545
#68 ComponentElement.performRebuild
package:flutter/…/widgets/framework.dart:4832
#69 StatefulElement.performRebuild
package:flutter/…/widgets/framework.dart:4977
#70 Element.rebuild
package:flutter/…/widgets/framework.dart:4529
#71 BuildOwner.buildScope
package:flutter/…/widgets/framework.dart:2659
#72 WidgetsBinding.drawFrame
package:flutter/…/widgets/binding.dart:891
#73 RendererBinding._handlePersistentFrameCallback
package:flutter/…/rendering/binding.dart:370
#74 SchedulerBinding._invokeFrameCallback
package:flutter/…/scheduler/binding.dart:1146
#75 SchedulerBinding.handleDrawFrame
package:flutter/…/scheduler/binding.dart:1083
#76 SchedulerBinding._handleDrawFrame
package:flutter/…/scheduler/binding.dart:997
#80 _invoke (dart:ui/hooks.dart:151:10)
#81 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:308:5)
#82 _drawFrame (dart:ui/hooks.dart:115:31)
(elided 3 frames from dart:async) ════════════════════════════════════════════════════════════════════════════════`
@awaik
am having same issue. I have done automatically, that is by generating the data class by vs code pluggin.
Hi, Somehow, I couldn't repeat it with an example project. If you have open-source repo - can you please give me a link to it and I'll try to catch this bug.