Skip to content

Fix fooTheme.of(context); usage docs #98401

@TahaTesser

Description

@TahaTesser

Theme usage doc for some widgets has an incorrect return type.

Actual Results:

/// TextButtonTheme theme = TextButtonTheme.of(context);

The following error is thrown:
A value of type 'TextButtonThemeData' can't be assigned to a variable of type 'TextButtonTheme'.

Expected Results:

/// TextButtonThemeData theme = TextButtonTheme.of(context);

For reference

/// BottomNavigationBarThemeData theme = BottomNavigationBarTheme.of(context);

I've found the following widget theme docs have this issue problem

  • TextButtonTheme
  • ElevatedButtonTheme
  • OutlinedButtonTheme
  • DrawerTheme
  • NavigationBarTheme
  • NavigationRailTheme

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 version

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions