-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
c: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
Description
Use case
Tried to adopt the new Material 3 dialog spec and found that Flutter does not "natively" support it and requires adding unintended widgets (like Column, Icon and SizedBox) in the title parameter to replicate it.
Proposal
Additional parameter/field heroIcon, causing the AlertDialog to adopt the "hero style".
Expected sample code mimicking Material spec render:
AlertDialog(
heroIcon: Icon(Icons.mobile_friendly),
title: Text('Dialog with hero icon'),
content: Text(
'A dialog is a type of modal window that '
'appears in front of app content to provide '
'critical information, or ask for a decision.',
),
actions: [
TextButton(child: Text("Enabled"), onPressed: () {}),
TextButton(child: Text("Enabled"), onPressed: () {}),
]
),By observing the Material specs following things should happen:
titleshould inherittextAlign: TextAlign.centerwhen aheroIconis provided.heroIconshould useThemeData.colorScheme.secondaryas its color.
jongkb, iapicca, werainkhatri and Kaloyanes
Metadata
Metadata
Assignees
Labels
c: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.