Skip to content

ThemeData: Doc on useMaterial3 wrongly says it defaults to false #130761

@chrisbobbe

Description

@chrisbobbe

Is there an existing issue for this?

Steps to reproduce

  1. Run the code sample, which renders a Text under a ThemeData that accepts useMaterial3's default value. The text tells you what the ambient useMaterial3 is.
  2. See that it says "true".
  3. Read the doc on ThemeData.useMaterial3.

Expected results

The doc should say that useMaterial3 defaults to true, not false.

Actual results

The doc says that useMaterial3 defaults to false.

Code sample

Code sample
import 'package:flutter/material.dart';

void main() => runApp(const ExampleApp());

class ExampleApp extends StatelessWidget {
  const ExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Theme(
        data: ThemeData(),
        child: Center(
          child: Builder(builder: (context) => Text(Theme.of(context).useMaterial3.toString())))));
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs

(no errors expected or observed)

Flutter Doctor output

Doctor output
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel main, 3.13.0-3.0.pre.112, on macOS 13.4.1 22F82 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.80.1)
[✓] Connected device (3 available)
    ! Error: Chris’s Apple Watch needs to connect to determine its availability. Check the connection between the
      device and its companion iPhone, and the connection between the iPhone and Xcode. Both devices may also need to
      be restarted and unlocked. (code 1)
[✓] Network resources

• No issues found!

Metadata

Metadata

Assignees

Labels

d: api docsIssues with https://api.flutter.dev/f: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions