syedmurtaza108 / chucker-flutter

An HTTP requests inspector inspired by Chucker Android
https://pub.dev/packages/chucker_flutter
MIT License
54 stars 32 forks source link

Unsupported operation: Cannot modify unmodifiable map #14

Open irwancannadys opened 2 years ago

irwancannadys commented 2 years ago

Describe the bug Got the error screen when i click popup chuck

To Reproduce Steps to reproduce the behavior:

  1. hit api
  2. show your pop up chuck
  3. click popup
  4. crash Unsupported operation: Cannot modify unmodifiable map

Screenshots

Screen Shot 2022-06-30 at 16 38 41

Version (please complete the following information):

syedmurtaza108 commented 2 years ago

@irwancannadys Please add logs here too, so that I can identify what went wrong in your device. Also please mention the library version you are using. You can find library version in your project's pubspec file.

alann-maulana commented 1 year ago

By using example project, I can reproduce the error by adding 2 lines below before runApp :

Intl.defaultLocale = 'id_ID';
await initializeDateFormatting(Intl.defaultLocale);
Exception ``` ======== Exception caught by widgets library ======================================================= The following UnsupportedError was thrown building MediaQuery(MediaQueryData(size: Size(360.0, 732.0), devicePixelRatio: 3.0, textScaleFactor: 0.9, platformBrightness: Brightness.light, padding: EdgeInsets(0.0, 27.0, 0.0, 0.0), viewPadding: EdgeInsets(0.0, 27.0, 0.0, 0.0), viewInsets: EdgeInsets.zero, alwaysUse24HourFormat: true, accessibleNavigation: false, highContrast: false, disableAnimations: false, invertColors: false, boldText: false, navigationMode: traditional, gestureSettings: DeviceGestureSettings(touchSlop: 8.0), displayFeatures: [])): Unsupported operation: Cannot modify unmodifiable map The relevant error-causing widget was: MaterialApp-[<'chucker_material_app'>] MaterialApp:file:///Users/Maulana/packages/chucker-flutter/lib/src/view/helper/chucker_ui_helper.dart:86:31 When the exception was thrown, this was the stack: #0 _UnmodifiableMapMixin.[]= (dart:collection/maps.dart:269:5) #1 initializeDateFormattingCustom (package:intl/date_symbol_data_custom.dart:35:19) #2 loadDateIntlDataIfNotLoaded. (package:flutter_localizations/src/utils/date_localizations.dart:25:33) #3 CastMap.forEach. (dart:_internal/cast.dart:288:8) #4 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:539:8) #5 CastMap.forEach (dart:_internal/cast.dart:287:13) #6 loadDateIntlDataIfNotLoaded (package:flutter_localizations/src/utils/date_localizations.dart:21:8) #7 _MaterialLocalizationsDelegate.load. (package:flutter_localizations/src/material_localizations.dart:728:12) #8 _LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:453:23) #9 _MaterialLocalizationsDelegate.load (package:flutter_localizations/src/material_localizations.dart:727:32) #10 _loadAll (package:flutter/src/widgets/localizations.dart:55:49) #11 _LocalizationsState.load (package:flutter/src/widgets/localizations.dart:532:62) #12 _LocalizationsState.initState (package:flutter/src/widgets/localizations.dart:497:5) #13 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4893:57) #14 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4729:5) #15 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3790:14) #16 Element.updateChild (package:flutter/src/widgets/framework.dart:3524:20) #17 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4780:16) #18 Element.rebuild (package:flutter/src/widgets/framework.dart:4477:5) #19 ProxyElement.update (package:flutter/src/widgets/framework.dart:5108:5) #20 Element.updateChild (package:flutter/src/widgets/framework.dart:3501:15) #21 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4780:16) #22 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4928:11) #23 Element.rebuild (package:flutter/src/widgets/framework.dart:4477:5) #24 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2659:19) #25 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:882:21) #26 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:363:5) #27 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144:15) #28 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1081:9) #29 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:995:5) #33 _invoke (dart:ui/hooks.dart:151:10) #34 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:308:5) #35 _drawFrame (dart:ui/hooks.dart:115:31) (elided 3 frames from dart:async) ==================================================================================================== ```

Check the complete example code here

syedmurtaza108 commented 1 year ago

Thank you @alann-maulana for giving details on this bug👏. Surely gonna check this.

alann-maulana commented 1 year ago

This happen on our project too. I hope this minimal repro code can be helpful to find the bug 😁

gaganugraha33 commented 1 year ago

same issue when using GetMaterialApp on Getx