-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Closed
Labels
c: contributor-productivityTeam-specific productivity, code health, technical debt.Team-specific productivity, code health, technical debt.dependency: dartDart team may need to help usDart team may need to help usframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
Description
I was just doing some testing and changed the colour in the Stocks app and hot reloaded:
switch (_configuration.stockMode) {
case StockMode.optimistic:
return new ThemeData(
brightness: Brightness.light, primarySwatch: Colors.black);// This was Colors.blue
case StockMode.pessimistic:
return new ThemeData(
brightness: Brightness.dark, accentColor: Colors.redAccent);
}
assert(_configuration.stockMode != null);
return null;When I hit hot reload I got this:
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
type 'Color' is not a subtype of type 'MaterialColor' of 'primarySwatch' where
Color is from dart:ui
MaterialColor is from package:flutter/src/material/colors.dart
int is from dart:core
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
When the exception was thrown, this was the stack:
════════════════════════════════════════════════════════════════════════════════════════════════════
Reloaded 13 of 506 libraries in 871ms.
I don't know if this is actually a Flutter issue or not, but it seems like if it's not valid to use Colors.black that it shouldn't be in the code-completion and it should provide an error in the editor?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
c: contributor-productivityTeam-specific productivity, code health, technical debt.Team-specific productivity, code health, technical debt.dependency: dartDart team may need to help usDart team may need to help usframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.