Unverified Commit 5ab34744 authored by Darren Austin's avatar Darren Austin Committed by GitHub

Removed the last vestiges of accent color from the FloatingActionButton. (#78296)

parent 93fb2586
......@@ -9,7 +9,6 @@ import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'button.dart';
import 'colors.dart';
import 'floating_action_button_theme.dart';
import 'scaffold.dart';
import 'theme.dart';
......@@ -242,11 +241,6 @@ class FloatingActionButton extends StatelessWidget {
/// [ThemeData.floatingActionButtonTheme] is used. If that property is also
/// null, then the [ColorScheme.onSecondary] color of [ThemeData.colorScheme]
/// is used.
///
/// Although the color of theme's `accentIconTheme` currently provides a
/// default that supersedes the `onSecondary` color, this dependency
/// has been deprecated: https://flutter.dev/go/remove-fab-accent-theme-dependency.
/// It will be removed in the future.
final Color? foregroundColor;
/// The button's background color.
......@@ -429,25 +423,6 @@ class FloatingActionButton extends StatelessWidget {
final ThemeData theme = Theme.of(context);
final FloatingActionButtonThemeData floatingActionButtonTheme = theme.floatingActionButtonTheme;
// Applications should no longer use accentIconTheme's color to configure
// the foreground color of floating action buttons. For more information, see
// https://flutter.dev/go/remove-fab-accent-theme-dependency.
if (this.foregroundColor == null && floatingActionButtonTheme.foregroundColor == null) {
final bool accentIsDark = theme.accentColorBrightness == Brightness.dark;
final Color defaultAccentIconThemeColor = accentIsDark ? Colors.white : Colors.black;
if (theme.accentIconTheme.color != defaultAccentIconThemeColor) {
debugPrint(
'Warning: '
'The support for configuring the foreground color of '
'FloatingActionButtons using ThemeData.accentIconTheme '
'has been deprecated. Please use ThemeData.floatingActionButtonTheme '
'instead. See '
'https://flutter.dev/go/remove-fab-accent-theme-dependency. '
'This feature was deprecated after v1.13.2.'
);
}
}
final Color foregroundColor = this.foregroundColor
?? floatingActionButtonTheme.foregroundColor
?? theme.colorScheme.onSecondary;
......
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