Commit 655bf6a2 authored by Hans Muller's avatar Hans Muller Committed by liyuqian

Update uses of ButtonTheme.bar: pass along the current Theme's colorScheme (#22827)

* Update uses of ButtonTheme.bar

* updated gallery themes

* Remove unnecessary const

Fixes #22789
parent 874df1ec
...@@ -129,6 +129,7 @@ class TravelDestinationItem extends StatelessWidget { ...@@ -129,6 +129,7 @@ class TravelDestinationItem extends StatelessWidget {
), ),
// share, explore buttons // share, explore buttons
ButtonTheme.bar( ButtonTheme.bar(
colorScheme: theme.colorScheme,
child: ButtonBar( child: ButtonBar(
alignment: MainAxisAlignment.start, alignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
......
...@@ -24,15 +24,17 @@ TextTheme _buildTextTheme(TextTheme base) { ...@@ -24,15 +24,17 @@ TextTheme _buildTextTheme(TextTheme base) {
ThemeData _buildDarkTheme() { ThemeData _buildDarkTheme() {
const Color primaryColor = Color(0xFF0175c2); const Color primaryColor = Color(0xFF0175c2);
const Color secondaryColor = Color(0xFF13B9FD);
final ThemeData base = ThemeData.dark(); final ThemeData base = ThemeData.dark();
final ColorScheme colorScheme = const ColorScheme.dark().copyWith( final ColorScheme colorScheme = const ColorScheme.dark().copyWith(
primary: primaryColor, primary: primaryColor,
secondary: secondaryColor,
); );
return base.copyWith( return base.copyWith(
primaryColor: primaryColor, primaryColor: primaryColor,
buttonColor: primaryColor, buttonColor: primaryColor,
indicatorColor: Colors.white, indicatorColor: Colors.white,
accentColor: const Color(0xFF13B9FD), accentColor: secondaryColor,
canvasColor: const Color(0xFF202124), canvasColor: const Color(0xFF202124),
scaffoldBackgroundColor: const Color(0xFF202124), scaffoldBackgroundColor: const Color(0xFF202124),
backgroundColor: const Color(0xFF202124), backgroundColor: const Color(0xFF202124),
...@@ -49,8 +51,10 @@ ThemeData _buildDarkTheme() { ...@@ -49,8 +51,10 @@ ThemeData _buildDarkTheme() {
ThemeData _buildLightTheme() { ThemeData _buildLightTheme() {
const Color primaryColor = Color(0xFF0175c2); const Color primaryColor = Color(0xFF0175c2);
const Color secondaryColor = Color(0xFF13B9FD);
final ColorScheme colorScheme = const ColorScheme.light().copyWith( final ColorScheme colorScheme = const ColorScheme.light().copyWith(
primary: primaryColor, primary: primaryColor,
secondary: secondaryColor,
); );
final ThemeData base = ThemeData.light(); final ThemeData base = ThemeData.light();
return base.copyWith( return base.copyWith(
...@@ -60,7 +64,7 @@ ThemeData _buildLightTheme() { ...@@ -60,7 +64,7 @@ ThemeData _buildLightTheme() {
indicatorColor: Colors.white, indicatorColor: Colors.white,
splashColor: Colors.white24, splashColor: Colors.white24,
splashFactory: InkRipple.splashFactory, splashFactory: InkRipple.splashFactory,
accentColor: const Color(0xFF13B9FD), accentColor: secondaryColor,
canvasColor: Colors.white, canvasColor: Colors.white,
scaffoldBackgroundColor: Colors.white, scaffoldBackgroundColor: Colors.white,
backgroundColor: Colors.white, backgroundColor: Colors.white,
......
...@@ -952,6 +952,7 @@ class _DatePickerDialogState extends State<_DatePickerDialog> { ...@@ -952,6 +952,7 @@ class _DatePickerDialogState extends State<_DatePickerDialog> {
), ),
); );
final Widget actions = ButtonTheme.bar( final Widget actions = ButtonTheme.bar(
colorScheme: theme.buttonTheme.colorScheme,
child: ButtonBar( child: ButtonBar(
children: <Widget>[ children: <Widget>[
FlatButton( FlatButton(
......
...@@ -274,6 +274,7 @@ class AlertDialog extends StatelessWidget { ...@@ -274,6 +274,7 @@ class AlertDialog extends StatelessWidget {
if (actions != null) { if (actions != null) {
children.add(ButtonTheme.bar( children.add(ButtonTheme.bar(
colorScheme: Theme.of(context).colorScheme,
child: ButtonBar( child: ButtonBar(
children: actions, children: actions,
), ),
...@@ -625,4 +626,4 @@ Future<T> showDialog<T>({ ...@@ -625,4 +626,4 @@ Future<T> showDialog<T>({
transitionDuration: const Duration(milliseconds: 150), transitionDuration: const Duration(milliseconds: 150),
transitionBuilder: _buildMaterialDialogTransitions, transitionBuilder: _buildMaterialDialogTransitions,
); );
} }
\ No newline at end of file
...@@ -400,6 +400,7 @@ class PaginatedDataTableState extends State<PaginatedDataTable> { ...@@ -400,6 +400,7 @@ class PaginatedDataTableState extends State<PaginatedDataTable> {
opacity: 0.54 opacity: 0.54
), ),
child: ButtonTheme.bar( child: ButtonTheme.bar(
colorScheme: themeData.colorScheme,
child: Ink( child: Ink(
height: 64.0, height: 64.0,
color: _selectedRowCount > 0 ? themeData.secondaryHeaderColor : null, color: _selectedRowCount > 0 ? themeData.secondaryHeaderColor : null,
......
...@@ -1605,6 +1605,7 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin { ...@@ -1605,6 +1605,7 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin {
), ),
child: SafeArea( child: SafeArea(
child: ButtonTheme.bar( child: ButtonTheme.bar(
colorScheme: themeData.colorScheme,
child: SafeArea( child: SafeArea(
top: false, top: false,
child: ButtonBar( child: ButtonBar(
......
...@@ -212,6 +212,7 @@ class SnackBar extends StatelessWidget { ...@@ -212,6 +212,7 @@ class SnackBar extends StatelessWidget {
]; ];
if (action != null) { if (action != null) {
children.add(ButtonTheme.bar( children.add(ButtonTheme.bar(
colorScheme: theme.colorScheme,
padding: const EdgeInsets.symmetric(horizontal: _kSnackBarPadding), padding: const EdgeInsets.symmetric(horizontal: _kSnackBarPadding),
textTheme: ButtonTextTheme.accent, textTheme: ButtonTextTheme.accent,
child: action, child: action,
......
...@@ -1541,6 +1541,7 @@ class _TimePickerDialogState extends State<_TimePickerDialog> { ...@@ -1541,6 +1541,7 @@ class _TimePickerDialogState extends State<_TimePickerDialog> {
); );
final Widget actions = ButtonTheme.bar( final Widget actions = ButtonTheme.bar(
colorScheme: theme.colorScheme,
child: ButtonBar( child: ButtonBar(
children: <Widget>[ children: <Widget>[
FlatButton( FlatButton(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment