Skip to content

Upgrading fluttertoast 6 to 7

Breaking6.0.1 → 7.1.8Breaking2New3Changed2Fixed20Other2

BreakingUpgrade verdict

2 breaking changes.

  • If you use the FToast popup toast, you must set it up with the current screen context before showing a toast.
  • The package goes back to its older way of showing toasts.
2 items need code or config changes
Breaking2
FToast now requires calling FToast.init(context) before showToast.
FToastFToast.init()showToast
Reverts to the old Fluttertoast code path.
Fluttertoast

Generated by DepDelta from published Dart source. Not mixed with prose notes.

  • removed: class FlutterToast
  • removed: ctor FlutterToast(BuildContext context)
  • removed: field FlutterToast.context: BuildContext
  • removed: method FlutterToast.removeCustomToast()
  • removed: method FlutterToast.removeQueuedCustomToasts()
  • removed: method FlutterToast.showToast({ @required Widget child, Duration toastDuration, ToastGravity gravity, }): void
  • changed: static method Fluttertoast.showToast(BuildContext context, {ToastGravity gravity = …, String msg, int toastDuration = …}): void → static method Fluttertoast.showToast({ @required String msg, Toast toastLength, int timeInSecForIosWeb = …, double fontSize, ToastGravity gravity, Color backgroundColor, Color textColor, bool webShowClose = …, webBgColor = …, webPosition = …, }): Future<bool>
  • added: class FToast
  • added: class ToastStateFulState extends State<_ToastStateFul> with SingleTickerProviderStateMixin
  • added: ctor FToast()
  • added: field FToast.context: BuildContext
  • added: member ToastGravity.SNACKBAR
  • added: method FToast.init(BuildContext context)
  • added: method FToast.removeCustomToast()
  • added: method FToast.removeQueuedCustomToasts()
  • added: method FToast.showToast({ @required Widget child, PositionedToastBuilder positionedToastBuilder, Duration toastDuration, ToastGravity gravity, }): void
  • added: method ToastStateFulState.build(BuildContext context): Widget
  • added: method ToastStateFulState.deactivate(): void
  • added: method ToastStateFulState.dispose(): void
  • added: method ToastStateFulState.hideIt()
  • added: method ToastStateFulState.initState(): void
  • added: method ToastStateFulState.showIt()
  • added: static method Fluttertoast.cancel(): Future<bool>
  • added: typedef PositionedToastBuilder = Widget Function( BuildContext context, Widget child)
  • added: class FluttertoastWebPlugin
  • added: ctor FluttertoastWebPlugin()
  • added: method FluttertoastWebPlugin.addHtmlToast( {String msg = …, String gravity = …, String position = …, String bgcolor = …, int time = …, bool showClose = …, int textColor})
  • added: method FluttertoastWebPlugin.handleMethodCall(MethodCall call): Future<dynamic>
  • added: method FluttertoastWebPlugin.injectCssAndJSLibraries(): Future<void>
  • added: method FluttertoastWebPlugin.showToast(args)
  • added: static method FluttertoastWebPlugin.registerWith(Registrar registrar): void