flutter_styled_toast 1.2.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 84

flutter_styled_toast #

A Styled Toast Flutter package. You can highly customize toast ever. Beautify toast with a series of animations and make toast more beautiful.

demo #

Getting Started #

dependencies:
  flutter_styled_toast: ^1.2.0
import 'package:flutter_styled_toast/flutter_styled_toast.dart';
StyledToast(
  textStyle: TextStyle(fontSize: 16.0, color: Colors.white),
  backgroundColor: Color(0x99000000),
  borderRadius: BorderRadius.circular(5.0),
  textPadding: EdgeInsets.symmetric(horizontal: 17.0, vertical: 10.0),
  toastAnimation: StyledToastAnimation.fade,
  reverseAnimation: StyledToastAnimation.fade,
  curve: Curves.fastOutSlowIn,
  reverseCurve: Curves.fastLinearToSlowEaseIn,
  dismissOtherOnShow: true,
  movingOnWindowChange: true,
  child: MaterialApp(
          title: appTitle,
          showPerformanceOverlay: showPerformance,
          home: LayoutBuilder(
            builder: (BuildContext context, BoxConstraints constraints) {
              return MyHomePage(
                title: appTitle,
                onSetting: onSettingCallback,
              );
            },
          ),
        ),
);
//general use
showToast("hello styled toast");

// Customize toast content widget
showToastWidget(Text('hello styled toast'));

🚀 Roadmap #


DefaultToastWidget

FadeAnim

SlideFromTopAnim

SlideFromBottomAnim

SlideFromLeftAnim

SlideFromRightAnim

ScaleAnim

FadeScaleAnim

RotateAnim

FadeRotateAnim

ScaleRotateAnim

OnDismiss

CustomToastWidget

CustomFailToastWidget

CustomSuccessToastWidget

StyledToast param #

propertydescription
childWidget (Not Null)(required)
textAlignTextAlign (default TextAlign.center)
textDirectionTextDirection (default TextDirection.ltr)
borderRadiusBorderRadius (BorderRadius.circular(5.0))
backgroundColorColor (default Color(0x99000000))
textPaddingEdgeInsetsGeometry (default EdgeInsets.symmetric(horizontal: 17.0,vertical: 8.0))
toastHorizontalMargindouble (default 50.0)
textStyleTextStyle (default TextStyle(fontSize: 16.0,fontWeight: FontWeight.normal,color: Colors.white))
shapeBorderShapeBorder (default RoundedRectangleBorder(borderRadius: borderRadius))
durationDuration (default 2.3s)
animDurationDuration (default 400 milliseconds, animDuration * 2 <= duration, conditions must be met for toast to display properly)
toastPositionsStyledToastPosition (default StyledToastPosition.bottom)
toastAnimationStyledToastAnimation (default StyledToastAnimation.fade)
reverseAnimationStyledToastAnimation
alignmentAlignmentGeometry (default Alignment.center)
axisAxis (default Axis.vertical)
startOffsetOffset
endOffsetOffset
reverseStartOffsetOffset
reverseEndOffsetOffset
curveCurve (default Curves.linear)
reverseCurveCurve (default Curves.linear)
dismissOtherOnShowbool (default true)
movingOnWindowChangebool (default true)
onDismissVoidCallback (Invoked when toast dismiss)

showToast param #

propertydescription
msgString (Not Null)(required)
contextBuildContext (If you don't wrap app with StyledToast, context is required, otherwise, is not)
durationDuration (default 2.3s)
animDurationDuration (default 400 milliseconds, animDuration * 2 <= duration, conditions must be met for toast to display properly)
positionStyledToastPosition (default StyledToastPosition.bottom)
textStyleTextStyle (default TextStyle(fontSize: 16.0,fontWeight: FontWeight.normal,color: Colors.white))
textPaddingEdgeInsetsGeometry (default EdgeInsets.symmetric(horizontal: 17.0,vertical: 8.0))
backgroundColorColor (default Color(0x99000000))
borderRadiusBorderRadius (BorderRadius.circular(5.0))
shapeBorderShapeBorder (default RoundedRectangleBorder(borderRadius: borderRadius))
onDismissVoidCallback (Invoked when toast dismiss)
textDirectionTextDirection (default TextDirection.ltr)
dismissOtherOnShowbool (default true)
movingOnWindowChangebool (default true)
toastAnimationStyledToastAnimation (default StyledToastAnimation.fade)
reverseAnimationStyledToastAnimation
alignmentAlignmentGeometry (default Alignment.center)
axisAxis (default Axis.vertical)
startOffsetOffset
endOffsetOffset
reverseStartOffsetOffset
reverseEndOffsetOffset
textAlignTextAlign (default TextAlign.center)
curveCurve (default Curves.linear)
reverseCurveCurve (default Curves.linear)

showToastWidget param #

propertydescription
widgetWidget (Not Null)(required)
contextBuildContext (If you don't wrap app with StyledToast, context is required, otherwise, is not)
durationDuration (default 2.3s)
animDurationDuration (default 400 milliseconds, animDuration * 2 <= duration, conditions must be met for toast to display properly)
onDismissVoidCallback (Invoked when toast dismiss)
dismissOtherOnShowbool (default true)
movingOnWindowChangebool (default true)
textDirectionTextDirection (default TextDirection.ltr)
positionStyledToastPosition (default )
animationStyledToastAnimation (default StyledToastAnimation.fade)
reverseAnimationStyledToastAnimation
alignmentAlignmentGeometry (default Alignment.center)
axisAxis (default Axis.vertical)
startOffsetOffset
endOffsetOffset
reverseStartOffsetOffset
reverseEndOffsetOffset
curveCurve (default Curves.linear)
reverseCurveCurve (default Curves.linear)

Example #

example

Thanks for #

OkToast

[1.2.0]

Add axis, alignment support to rotate and size animation. Add start offset, end offset, reverse start offset, reverse end offset to slide animation.

[1.1.0+5]

Fix bugs.

[1.1.0+4]

Modify README.

[1.1.0+3]

Fix bugs.

[1.1.0]

Adding size animation sizeFade animation, fix bugs.

[1.0.0]

First release version features: showToast showToastWidget toast animation and reverse animation.

[0.0.1]

initial project

example/README.md

example #

A new Flutter application.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_styled_toast: ^1.2.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_styled_toast/flutter_styled_toast.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
68
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
84
Learn more about scoring.

We analyzed this package on Oct 18, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test