Maintenance (#773)
* Update GTag
* replace deprecations
* update goldens
* restore goldens
diff --git a/lib/feature_discovery/feature_discovery.dart b/lib/feature_discovery/feature_discovery.dart
index 59a45a5..353d758 100644
--- a/lib/feature_discovery/feature_discovery.dart
+++ b/lib/feature_discovery/feature_discovery.dart
@@ -142,7 +142,7 @@
debugCheckHasDirectionality(ctx);
final deviceSize = MediaQuery.of(ctx).size;
- final color = widget.color ?? Theme.of(ctx).primaryColor;
+ final color = widget.color ?? Theme.of(ctx).colorScheme.primary;
// Wrap in transparent [Material] to enable widgets that require one.
return Material(
diff --git a/lib/studies/crane/theme.dart b/lib/studies/crane/theme.dart
index d89b7ad..61651dc 100644
--- a/lib/studies/crane/theme.dart
+++ b/lib/studies/crane/theme.dart
@@ -22,7 +22,6 @@
secondary: craneRed700,
error: craneErrorOrange,
),
- primaryColor: cranePurple800,
hintColor: craneWhite60,
indicatorColor: cranePrimaryWhite,
scaffoldBackgroundColor: cranePrimaryWhite,
diff --git a/lib/studies/rally/app.dart b/lib/studies/rally/app.dart
index 650e280..bfbe1ea 100644
--- a/lib/studies/rally/app.dart
+++ b/lib/studies/rally/app.dart
@@ -64,7 +64,6 @@
elevation: 0,
),
scaffoldBackgroundColor: RallyColors.primaryBackground,
- primaryColor: RallyColors.primaryBackground,
focusColor: RallyColors.focusColor,
textTheme: _buildRallyTextTheme(base.textTheme),
inputDecorationTheme: const InputDecorationTheme(
@@ -77,6 +76,9 @@
focusedBorder: InputBorder.none,
),
visualDensity: VisualDensity.standard,
+ colorScheme: base.colorScheme.copyWith(
+ primary: RallyColors.primaryBackground,
+ ),
);
}
diff --git a/lib/studies/reply/app.dart b/lib/studies/reply/app.dart
index 8a3576d..f1322bb 100644
--- a/lib/studies/reply/app.dart
+++ b/lib/studies/reply/app.dart
@@ -145,7 +145,7 @@
ThemeData _buildReplyLightTheme(BuildContext context) {
final base = ThemeData.light();
return base.copyWith(
- bottomAppBarColor: ReplyColors.blue700,
+ bottomAppBarTheme: const BottomAppBarTheme(color: ReplyColors.blue700),
bottomSheetTheme: BottomSheetThemeData(
backgroundColor: ReplyColors.blue700,
modalBackgroundColor: Colors.white.withOpacity(0.7),
@@ -192,7 +192,9 @@
ThemeData _buildReplyDarkTheme(BuildContext context) {
final base = ThemeData.dark();
return base.copyWith(
- bottomAppBarColor: ReplyColors.darkBottomAppBarBackground,
+ bottomAppBarTheme: const BottomAppBarTheme(
+ color: ReplyColors.darkBottomAppBarBackground,
+ ),
bottomSheetTheme: BottomSheetThemeData(
backgroundColor: ReplyColors.darkDrawerBackground,
modalBackgroundColor: Colors.black.withOpacity(0.7),
diff --git a/lib/studies/shrine/login.dart b/lib/studies/shrine/login.dart
index 9eb97e8..eedd358 100644
--- a/lib/studies/shrine/login.dart
+++ b/lib/studies/shrine/login.dart
@@ -6,14 +6,12 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/gallery_localizations.dart';
-
import 'package:gallery/data/gallery_options.dart';
import 'package:gallery/layout/adaptive.dart';
import 'package:gallery/layout/image_placeholder.dart';
import 'package:gallery/layout/letter_spacing.dart';
import 'package:gallery/layout/text_scale.dart';
import 'package:gallery/studies/shrine/app.dart';
-import 'package:gallery/studies/shrine/colors.dart';
import 'package:gallery/studies/shrine/theme.dart';
const _horizontalPadding = 24.0;
@@ -115,16 +113,14 @@
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;
- return PrimaryColorOverride(
- color: shrineBrown900,
- child: TextField(
- textInputAction: TextInputAction.next,
- restorationId: 'username_text_field',
- cursorColor: colorScheme.onSurface,
- decoration: InputDecoration(
- labelText: GalleryLocalizations.of(context)!.shrineLoginUsernameLabel,
- labelStyle: TextStyle(
- letterSpacing: letterSpacingOrNone(mediumLetterSpacing)),
+ return TextField(
+ textInputAction: TextInputAction.next,
+ restorationId: 'username_text_field',
+ cursorColor: colorScheme.onSurface,
+ decoration: InputDecoration(
+ labelText: GalleryLocalizations.of(context)!.shrineLoginUsernameLabel,
+ labelStyle: TextStyle(
+ letterSpacing: letterSpacingOrNone(mediumLetterSpacing),
),
),
);
@@ -138,16 +134,14 @@
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;
- return PrimaryColorOverride(
- color: shrineBrown900,
- child: TextField(
- restorationId: 'password_text_field',
- cursorColor: colorScheme.onSurface,
- obscureText: true,
- decoration: InputDecoration(
- labelText: GalleryLocalizations.of(context)!.shrineLoginPasswordLabel,
- labelStyle: TextStyle(
- letterSpacing: letterSpacingOrNone(mediumLetterSpacing)),
+ return TextField(
+ restorationId: 'password_text_field',
+ cursorColor: colorScheme.onSurface,
+ obscureText: true,
+ decoration: InputDecoration(
+ labelText: GalleryLocalizations.of(context)!.shrineLoginPasswordLabel,
+ labelStyle: TextStyle(
+ letterSpacing: letterSpacingOrNone(mediumLetterSpacing),
),
),
);
@@ -218,22 +212,3 @@
);
}
}
-
-class PrimaryColorOverride extends StatelessWidget {
- const PrimaryColorOverride({
- super.key,
- this.color,
- required this.child,
- });
-
- final Color? color;
- final Widget child;
-
- @override
- Widget build(BuildContext context) {
- return Theme(
- data: Theme.of(context).copyWith(primaryColor: color),
- child: child,
- );
- }
-}
diff --git a/lib/studies/shrine/theme.dart b/lib/studies/shrine/theme.dart
index 2dc2474..a9261f1 100644
--- a/lib/studies/shrine/theme.dart
+++ b/lib/studies/shrine/theme.dart
@@ -26,10 +26,6 @@
systemOverlayStyle: SystemUiOverlayStyle.dark,
elevation: 0,
),
- colorScheme: _shrineColorScheme.copyWith(
- error: shrineErrorRed,
- ),
- primaryColor: shrinePink100,
scaffoldBackgroundColor: shrineBackgroundWhite,
cardColor: shrineBackgroundWhite,
primaryIconTheme: _customIconTheme(base.iconTheme),
@@ -45,6 +41,10 @@
),
primaryTextTheme: _buildShrineTextTheme(base.primaryTextTheme),
iconTheme: _customIconTheme(base.iconTheme),
+ colorScheme: _shrineColorScheme.copyWith(
+ error: shrineErrorRed,
+ primary: shrinePink100,
+ ),
);
}
diff --git a/lib/studies/starter/app.dart b/lib/studies/starter/app.dart
index 5d88841..092b871 100644
--- a/lib/studies/starter/app.dart
+++ b/lib/studies/starter/app.dart
@@ -29,7 +29,6 @@
StarterApp.defaultRoute: (context) => const _Home(),
},
theme: ThemeData(
- primaryColor: _primaryColor,
highlightColor: Colors.transparent,
colorScheme: const ColorScheme(
primary: _primaryColor,
diff --git a/lib/themes/gallery_theme_data.dart b/lib/themes/gallery_theme_data.dart
index cc66278..02d720a 100644
--- a/lib/themes/gallery_theme_data.dart
+++ b/lib/themes/gallery_theme_data.dart
@@ -20,8 +20,6 @@
return ThemeData(
colorScheme: colorScheme,
textTheme: _textTheme,
- // Matches manifest.json colors and background color.
- primaryColor: const Color(0xFF030303),
appBarTheme: AppBarTheme(
backgroundColor: colorScheme.background,
elevation: 0,
diff --git a/lib/themes/material_demo_theme_data.dart b/lib/themes/material_demo_theme_data.dart
index a1bea3e..1890ecf 100644
--- a/lib/themes/material_demo_theme_data.dart
+++ b/lib/themes/material_demo_theme_data.dart
@@ -13,7 +13,6 @@
canvasColor: _colorScheme.background,
highlightColor: Colors.transparent,
indicatorColor: _colorScheme.onPrimary,
- primaryColor: _colorScheme.primary,
scaffoldBackgroundColor: _colorScheme.background,
secondaryHeaderColor: _colorScheme.background,
typography: Typography.material2018(
diff --git a/web/index.html b/web/index.html
index bdaa846..d515964 100644
--- a/web/index.html
+++ b/web/index.html
@@ -34,13 +34,13 @@
<script src="flutter.js" defer></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
- <script async src="https://www.googletagmanager.com/gtag/js?id=G-MSPWFZR4VM"></script>
+ <script async src="https://www.googletagmanager.com/gtag/js?id=G-V5HG5ZQTYX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
- gtag('config', 'G-MSPWFZR4VM');
+ gtag('config', 'G-V5HG5ZQTYX');
</script>
</head>