Address flutter analyze warnings (#766)
This CL addresses analyzer warnings that show up after members of ThemeData got deprecated as well as an unnecessary null-aware ? operator.
diff --git a/lib/feature_discovery/feature_discovery.dart b/lib/feature_discovery/feature_discovery.dart
index 7852a03..59a45a5 100644
--- a/lib/feature_discovery/feature_discovery.dart
+++ b/lib/feature_discovery/feature_discovery.dart
@@ -243,7 +243,7 @@
status = FeatureDiscoveryStatus.closed;
openController.forward(from: 0.0);
});
- Overlay.of(context)?.insert(entry);
+ Overlay.of(context).insert(entry);
});
}
}
diff --git a/lib/studies/crane/theme.dart b/lib/studies/crane/theme.dart
index 318a1f4..d89b7ad 100644
--- a/lib/studies/crane/theme.dart
+++ b/lib/studies/crane/theme.dart
@@ -20,13 +20,13 @@
colorScheme: const ColorScheme.light().copyWith(
primary: cranePurple800,
secondary: craneRed700,
+ error: craneErrorOrange,
),
primaryColor: cranePurple800,
hintColor: craneWhite60,
indicatorColor: cranePrimaryWhite,
scaffoldBackgroundColor: cranePrimaryWhite,
cardColor: cranePrimaryWhite,
- errorColor: craneErrorOrange,
highlightColor: Colors.transparent,
textTheme: _buildCraneTextTheme(base.textTheme),
textSelectionTheme: const TextSelectionThemeData(
diff --git a/lib/studies/shrine/theme.dart b/lib/studies/shrine/theme.dart
index 2f12071..2dc2474 100644
--- a/lib/studies/shrine/theme.dart
+++ b/lib/studies/shrine/theme.dart
@@ -26,11 +26,12 @@
systemOverlayStyle: SystemUiOverlayStyle.dark,
elevation: 0,
),
- colorScheme: _shrineColorScheme,
+ colorScheme: _shrineColorScheme.copyWith(
+ error: shrineErrorRed,
+ ),
primaryColor: shrinePink100,
scaffoldBackgroundColor: shrineBackgroundWhite,
cardColor: shrineBackgroundWhite,
- errorColor: shrineErrorRed,
primaryIconTheme: _customIconTheme(base.iconTheme),
inputDecorationTheme: const InputDecorationTheme(
border: CutCornersBorder(
diff --git a/lib/themes/material_demo_theme_data.dart b/lib/themes/material_demo_theme_data.dart
index a2be17b..a1bea3e 100644
--- a/lib/themes/material_demo_theme_data.dart
+++ b/lib/themes/material_demo_theme_data.dart
@@ -7,12 +7,13 @@
class MaterialDemoThemeData {
static final themeData = ThemeData(
- colorScheme: _colorScheme,
+ colorScheme: _colorScheme.copyWith(
+ background: Colors.white,
+ ),
canvasColor: _colorScheme.background,
highlightColor: Colors.transparent,
indicatorColor: _colorScheme.onPrimary,
primaryColor: _colorScheme.primary,
- backgroundColor: Colors.white,
scaffoldBackgroundColor: _colorScheme.background,
secondaryHeaderColor: _colorScheme.background,
typography: Typography.material2018(