From 7bfb39a1d2c5794fbe061803dc817afe05652e80 Mon Sep 17 00:00:00 2001 From: "Maverick G. Fabroa" Date: Sat, 2 Apr 2022 23:55:35 +0800 Subject: [PATCH] docs: replace deprecated widgets to updates ones --- README.md | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index f49c11f..2e6b767 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ backgroundColor | Flushbar background color. Will be ignored if [backgroundGradi leftBarIndicatorColor | If not null, shows a left vertical bar to better indicate the humor of the notification. It is not possible to use it with a [Form] and I do not recommend using it with [LinearProgressIndicator]. boxShadows | The shadows generated by Flushbar. Leave it null if you don't want a shadow. You can use more than one if you feel the need. Check [this example](https://github.com/flutter/flutter/blob/main/packages/flutter/lib/src/material/shadows.dart) backgroundGradient | Flushbar background gradient. Makes [backgroundColor] be ignored. -mainButton | Use if you need an action from the user. [FlatButton] is recommended here. +mainButton | Use if you need an action from the user. [TextButton] is recommended here. onTap | A callback that registers the user's click anywhere. An alternative to [mainButton] duration | How long until Flushbar will hide itself (be dismissed). To make it indefinite, leave it null. isDismissible | Determines if the user can swipe or click the overlay (if [routeBlur] > 0) to dismiss. It is recommended that you set [duration] != null if this is false. If the user swipes to dismiss or clicks the overlay, no value will be returned. @@ -132,7 +132,7 @@ Flushbar( Icons.check, color: Colors.greenAccent, ), - mainButton: FlatButton( + mainButton: TextButton( onPressed: () {}, child: Text( "CLAP", @@ -277,23 +277,22 @@ bool _wasButtonClicked; flush = Flushbar( title: "Hey Ninja", message: "Lorem Ipsum is simply dummy text of the printing and typesetting industry", - icon: Icon( - Icons.info_outline, - color: Colors.blue,), - mainButton: FlatButton( - onPressed: () { - flush.dismiss(true); // result = true - }, - child: Text( - "ADD", - style: TextStyle(color: Colors.amber), - ), - ),) // is the type of the result passed to dismiss() and collected by show().then((result){}) - ..show(context).then((result) { - setState(() { // setState() is optional here - _wasButtonClicked = result; - }); + icon: Icon(Icons.info_outline, color: Colors.blue), + mainButton: TextButton( + onPressed: () { + flush.dismiss(true); // result = true + }, + child: Text( + "ADD", + style: TextStyle(color: Colors.amber), + ) + ) + ) // is the type of the result passed to dismiss() and collected by show().then((result){}) + ..show(context).then((result) { + setState(() { // setState() is optional here + _wasButtonClicked = result; }); + }); }, ), ),