Unverified Commit 6346edba authored by Hans Muller's avatar Hans Muller Committed by GitHub

Removed accentColor refs from API docs (#78375)

parent 79862c48
...@@ -50,7 +50,8 @@ import 'theme.dart'; ...@@ -50,7 +50,8 @@ import 'theme.dart';
/// ///
/// ```dart /// ```dart
/// Widget build(BuildContext context) { /// Widget build(BuildContext context) {
/// final TextStyle textStyle = Theme.of(context).textTheme.bodyText2!; /// final ThemeData theme = Theme.of(context);
/// final TextStyle textStyle = theme.textTheme.bodyText2!;
/// final List<Widget> aboutBoxChildren = <Widget>[ /// final List<Widget> aboutBoxChildren = <Widget>[
/// const SizedBox(height: 24), /// const SizedBox(height: 24),
/// RichText( /// RichText(
...@@ -63,7 +64,7 @@ import 'theme.dart'; ...@@ -63,7 +64,7 @@ import 'theme.dart';
/// 'from a single codebase. Learn more about Flutter at ' /// 'from a single codebase. Learn more about Flutter at '
/// ), /// ),
/// TextSpan( /// TextSpan(
/// style: textStyle.copyWith(color: Theme.of(context).accentColor), /// style: textStyle.copyWith(color: theme.colorScheme.primary),
/// text: 'https://flutter.dev' /// text: 'https://flutter.dev'
/// ), /// ),
/// TextSpan( /// TextSpan(
......
...@@ -90,9 +90,9 @@ class MaterialAccentColor extends ColorSwatch<int> { ...@@ -90,9 +90,9 @@ class MaterialAccentColor extends ColorSwatch<int> {
/// [color palette](https://material.io/design/color/). /// [color palette](https://material.io/design/color/).
/// ///
/// Instead of using an absolute color from these palettes, consider using /// Instead of using an absolute color from these palettes, consider using
/// [Theme.of] to obtain the local [ThemeData] structure, which exposes the /// [Theme.of] to obtain the local [ThemeData.colorScheme], which defines
/// colors selected for the current theme, such as [ThemeData.primaryColor] and /// the colors that most of the Material components use by default.
/// [ThemeData.accentColor] (among many others). ///
/// ///
/// Most swatches have colors from 100 to 900 in increments of one hundred, plus /// Most swatches have colors from 100 to 900 in increments of one hundred, plus
/// the color 50. The smaller the number, the more pale the color. The greater /// the color 50. The smaller the number, the more pale the color. The greater
......
...@@ -151,19 +151,26 @@ enum MaterialTapTargetSize { ...@@ -151,19 +151,26 @@ enum MaterialTapTargetSize {
/// ///
/// {@tool snippet} /// {@tool snippet}
/// ///
/// This sample creates a [MaterialApp] widget that stores `ThemeData` and /// This sample creates a [MaterialApp] with a [Theme] whose
/// passes the `ThemeData` to descendant widgets. The [AppBar] widget uses the /// [ColorScheme] is based on [Colors.blue], but with the color
/// [primaryColor] to create a blue background. The [Text] widget uses the /// scheme's [ColorScheme.secondary] color overridden to be green. The
/// [TextTheme.bodyText2] to create purple text. The [FloatingActionButton] widget /// [AppBar] widget uses the color scheme's [ColorScheme.primary] as
/// uses the [accentColor] to create a green background. /// its default background color and the [FloatingActionButton] widget
/// uses the color scheme's [ColorScheme.secondary] for its default
/// background. By default, the [Text] widget uses
/// [TextTheme.bodyText2], and the color of that [TextStyle] has been
/// changed to purple.
/// ///
/// ![](https://flutter.github.io/assets-for-api-docs/assets/material/material_app_theme_data.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/material_app_theme_data.png)
/// ///
/// ```dart /// ```dart
/// MaterialApp( /// MaterialApp(
/// theme: ThemeData( /// theme: ThemeData(
/// primaryColor: Colors.blue, /// colorScheme: ColorScheme.fromSwatch(
/// accentColor: Colors.green, /// primarySwatch: Colors.blue,
/// ).copyWith(
/// secondary: Colors.green,
/// ),
/// textTheme: const TextTheme(bodyText2: TextStyle(color: Colors.purple)), /// textTheme: const TextTheme(bodyText2: TextStyle(color: Colors.purple)),
/// ), /// ),
/// home: Scaffold( /// home: Scaffold(
......
...@@ -30,7 +30,8 @@ import 'ticker_provider.dart'; ...@@ -30,7 +30,8 @@ import 'ticker_provider.dart';
/// Created automatically by [ScrollBehavior.buildViewportChrome] on platforms /// Created automatically by [ScrollBehavior.buildViewportChrome] on platforms
/// (e.g., Android) that commonly use this type of overscroll indication. /// (e.g., Android) that commonly use this type of overscroll indication.
/// ///
/// In a [MaterialApp], the edge glow color is the [ThemeData.accentColor]. /// In a [MaterialApp], the edge glow color is the overall theme's
/// [ColorScheme.secondary] color.
/// ///
/// ## Customizing the Glow Position for Advanced Scroll Views /// ## Customizing the Glow Position for Advanced Scroll Views
/// ///
......
...@@ -694,7 +694,8 @@ class BouncingScrollPhysics extends ScrollPhysics { ...@@ -694,7 +694,8 @@ class BouncingScrollPhysics extends ScrollPhysics {
/// * [GlowingOverscrollIndicator], which is used by [ScrollConfiguration] to /// * [GlowingOverscrollIndicator], which is used by [ScrollConfiguration] to
/// provide the glowing effect that is usually found with this clamping effect /// provide the glowing effect that is usually found with this clamping effect
/// on Android. When using a [MaterialApp], the [GlowingOverscrollIndicator]'s /// on Android. When using a [MaterialApp], the [GlowingOverscrollIndicator]'s
/// glow color is specified to use [ThemeData.accentColor]. /// glow color is specified to use the overall theme's
/// [ColorScheme.secondary] color.
class ClampingScrollPhysics extends ScrollPhysics { class ClampingScrollPhysics extends ScrollPhysics {
/// Creates scroll physics that prevent the scroll offset from exceeding the /// Creates scroll physics that prevent the scroll offset from exceeding the
/// bounds of the content. /// bounds of the content.
......
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