Repository navigation
I GOT ERROR The following assertion was thrown building: type 'String' is not a subtype of type 'int' of 'index' #56206
Description
Activity
════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The following assertion was thrown building:
type 'String' is not a subtype of type 'int' of 'index'Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=BUG.mdWhen the exception was thrown, this was the stack:
#0 _CalendarPageState.tacheUser (package:ilm/src/screens/calendar/calendar_page.dart:193:33)
#1 _CalendarPageState.build. (package:ilm/src/screens/calendar/calendar_page.dart:162:39)
#2 SliverChildBuilderDelegate.build (package:flutter/src/widgets/sliver.dart:446:15)
#3 SliverMultiBoxAdaptorElement._build. (package:flutter/src/widgets/sliver.dart:1260:67)
#4 _HashMap.putIfAbsent (dart:collection-patch/collection_patch.dart:139:29)
...
════════════════════════════════════════════════════════════════════════════════════════════════════
I/flutter ( 4251): {"color":"Colors.teal","debut":9,"description":"DESCRIPTION 1......","fin":20,"jourDebut":"Lun","jourFin":"Mer","title":"TITRE 2"}════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
type 'String' is not a subtype of type 'int' of 'index'
════════════════════════════════════════════════════════════════════════════════════════════════════════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
type 'String' is not a subtype of type 'int' of 'index'
════════════════════════════════════════════════════════════════════════════════════════════════════════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
type 'String' is not a subtype of type 'int' of 'index'
════════════════════════════════════════════════════════════════════════════════════════════════════════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
type 'String' is not a subtype of type 'int' of 'index'
════════════════════════════════════════════════════════════════════════════════════════════════════════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
type 'String' is not a subtype of type 'int' of 'index'
════════════════════════════════════════════════════════════════════════════════════════════════════════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
type 'String' is not a subtype of type 'int' of 'index'
════════════════════════════════════════════════════════════════════════════════════════════════════
Reloaded 7 of 634 libraries in 942ms.
I/chatty ( 4251): uid=10089(com.example.ilm) Thread-2 identical 4 lines
I/flutter ( 4251): {"color":"Colors.teal","debut":9,"description":"DESCRIPTION 1......","fin":20,"jourDebut":"Lun","jourFin":"Mer","title":"TITRE 2"}change
{"color":"Colors.teal"...
to
{"color": Colors.teal...and
Color color = Color(devoirs["color"] ?? 0xFF42A5F5);
to
Color color = devoirs["color"] ?? Color(0xFF42A5F5);Reacted by imeDevelopersThe Github issue tracker is for bugs and features requests for the Flutter SDK. Help and support questions like these are better suited for Q&A sites like StackOverflow or on one of the flutter community sites at https://flutter.dev/community .
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Aug 21, 2021
Widget tacheUser(devoirs) {
print(devoirs);
Color color = Color(devoirs["color"] ?? 0xFF42A5F5);
}
}
Steps to Reproduce
flutter create bug.Expected results:
Actual results:
Logs