AsukaMaterialBanner.alert constructor
AsukaMaterialBanner.alert(})
Creates a subclass of AsukaMaterialBanner called AsukaMaterialBanner.Alert
passing the key
, content
, setting the color
to Color(0xffFA5456) and the icon
to Icons.report.
This AsukaMaterialBanner was created to with the purpose of supply the user with an alert Snackbar
.
Example:
ElevatedButton(
onPressed: () {
asuka.AsukaMaterialBanner.alert("Alert").show();
},
child: const Text("Show alert"),
)
This code generates an ElevatedButton, when pressed, it calls asuka.AsukaMaterialBanner.alert("Alert").show()
Implementation
factory AsukaMaterialBanner.alert(
String content, {
Key? key,
double? width,
double elevation = 2,
Duration? duration = const Duration(seconds: 4),
}) =>
AsukaMaterialBanner._(
key,
content,
alertConfig.color,
icon: alertConfig.icon,
elevation: elevation,
duration: duration,
);