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