Created
July 13, 2020 14:23
-
-
Save joramkimata/e4177551bf508b43a261f26146cc0c18 to your computer and use it in GitHub Desktop.
Toast Flutter Plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:getwidget/getwidget.dart'; | |
class App extends StatefulWidget { | |
@override | |
_AppState createState() => _AppState(); | |
} | |
class _AppState extends State<App> { | |
bool _dismissable = false; | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: Scaffold( | |
appBar: AppBar( | |
title: Text("ToastApp"), | |
), | |
body: GFFloatingWidget( | |
horizontalPosition: 0.0, | |
verticalPosition: 230, | |
child: GFToast( | |
alignment: Alignment.bottomCenter, | |
width: 380, | |
type: GFToastType.fullWidth, | |
text: 'This item already has the label “travel”', | |
button: GFButton( | |
onPressed: () { | |
setState(() { | |
_dismissable = true; | |
}); | |
}, | |
text: 'Close', | |
type: GFButtonType.transparent, | |
color: GFColors.SUCCESS, | |
), | |
autoDismiss: _dismissable, | |
), | |
//body: Text('body or any kind of widget here..'), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment