-
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
The background color for SnackBarAction should be allowed to change when SnackBarAction.textColor is set to some custom color.
For example, in below code, I have set textColor to Colors.green, and I want the background color (blue in the image) to be set to green with some alpha value.
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: const Text('Awesome Snackbar!'),
action: SnackBarAction(
label: 'Action',
onPressed: () {
// Code to execute.
},
textColor: Colors.green,
),
),
);Proposal
I can think of 2 options:
- Add a parameter to
SnackBarActionwhich can be used to set the background color. - When
SnackBarAction.textColoris set, then set the background color to some alpha value of thistextColor.
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.
