Skip to content

Commit

Permalink
Fix assertion in typography.dart
Browse files Browse the repository at this point in the history
Fixes:
flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
flutter: The following assertion was thrown building GalleryApp(dirty, state: _GalleryAppState#91f52):
flutter: 'package:flutter/src/material/typography.dart': Failed assertion: line 124 pos 14: 'black != null':
flutter: is not true.
flutter:
flutter: Either the assertion indicates an error in the framework itself, or we should provide substantially
flutter: more information in this error message to help you determine and fix the underlying cause.
flutter: In either case, please report this assertion by filing a bug on GitHub:
flutter:   https://github.com/flutter/flutter/issues/new?template=BUG.md
flutter:
flutter: Widget creation tracking is currently disabled. Enabling it enables improved error messages. It can
flutter: be enabled by passing `--track-widget-creation` to `flutter run` or `flutter test`.
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #2      new Typography._ (package:flutter/src/material/typography.dart:124:14)
flutter: #3      new Typography (package:flutter/src/material/typography.dart:120:23)
flutter: #4      new ThemeData (package:flutter/src/material/theme_data.dart:303:20)
flutter: #5      _buildLightTheme (package:flutter_gallery/gallery/themes.dart:58:26)
flutter: #6      kLightGalleryTheme (package:flutter_gallery/gallery/themes.dart:7:38)
flutter: #7      kLightGalleryTheme (package:flutter_gallery/gallery/themes.dart:7:17)
flutter: #8      _GalleryAppState.build (package:flutter_gallery/gallery/app.dart:137:16)
flutter: #9      StatefulElement.build (package:flutter/src/widgets/framework.dart:4040:27)
flutter: #10     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3934:15)
flutter: #11     Element.rebuild (package:flutter/src/widgets/framework.dart:3731:5)
flutter: #12     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3917:5)
flutter: #13     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4081:11)
flutter: #14     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3912:5)
flutter: #15     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3094:14)
flutter: #16     Element.updateChild (package:flutter/src/widgets/framework.dart:2897:12)
flutter: #17     RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:1027:16)
flutter: #18     RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:998:5)
flutter: #19     RenderObjectToWidgetAdapter.attachToRenderTree.<anonymous closure> (package:flutter/src/widgets/binding.dart:941:17)
flutter: #20     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2321:19)
flutter: #21     RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:940:13)
flutter: #22     WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:821:7)
flutter: #23     WidgetsBinding.scheduleAttachRootWidget.<anonymous closure> (package:flutter/src/widgets/binding.dart:806:7)
flutter: #32     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:382:19)
flutter: #33     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:416:5)
flutter: #34     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
flutter: (elided 10 frames from class _AssertionError, package dart:async, and package dart:async-patch)
flutter:
  • Loading branch information
dwrobel committed Sep 20, 2019
1 parent 17c816a commit a88eb30
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/flutter/lib/src/material/typography.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class Typography extends Diagnosticable {
black ??= blackCupertino;
white ??= whiteCupertino;
break;
case TargetPlatform.linux:
case TargetPlatform.android:
case TargetPlatform.fuchsia:
black ??= blackMountainView;
Expand Down

0 comments on commit a88eb30

Please sign in to comment.