280 |
281 |
282 |
283 |
284 | DefaultToastWidget
285 |
286 | |
287 |
288 |
289 |
290 | FadeAnim
291 |
292 | |
293 |
294 |
295 |
296 | SlideFromTopAnim
297 |
298 | |
299 |
300 |
301 |
302 |
303 |
304 | SlideFromBottomAnim
305 |
306 | |
307 |
308 |
309 |
310 | SlideFromLeftAnim
311 |
312 | |
313 |
314 |
315 |
316 | SlideFromRightAnim
317 |
318 | |
319 |
320 |
321 |
322 |
323 |
324 | ScaleAnim
325 |
326 | |
327 |
328 |
329 |
330 | FadeScaleAnim
331 |
332 | |
333 |
334 |
335 |
336 | RotateAnim
337 |
338 | |
339 |
340 |
341 |
342 |
343 |
344 | FadeRotateAnim
345 |
346 | |
347 |
348 |
349 |
350 | ScaleRotateAnim
351 |
352 | |
353 |
354 |
355 |
356 | OnDismiss
357 |
358 | |
359 |
360 |
361 |
362 |
363 |
364 | CustomToastWidget
365 |
366 | |
367 |
368 |
369 |
370 | CustomFailToastWidget
371 |
372 | |
373 |
374 |
375 |
376 | CustomSuccessToastWidget
377 |
378 | |
379 |
380 |
381 |
382 |
383 | ### StyledToast param
384 |
385 | property | description
386 | ---------------------|----------------------------
387 | locale | Locale (Not Null)(required You have to set this parameters to your locale)
388 | child | Widget (Not Null)(required)
389 | textAlign | TextAlign (default TextAlign.center)
390 | textDirection | TextDirection (default TextDirection.ltr)
391 | borderRadius | BorderRadius (BorderRadius.circular(5.0))
392 | backgroundColor | Color (default Color(0x99000000))
393 | textPadding | EdgeInsetsGeometry (default EdgeInsets.symmetric(horizontal: 17.0,vertical: 8.0))
394 | toastHorizontalMargin| double (default 50.0)
395 | textStyle | TextStyle (default TextStyle(fontSize: 16.0,fontWeight: FontWeight.normal,color: Colors.white))
396 | shapeBorder | ShapeBorder (default RoundedRectangleBorder(borderRadius: borderRadius))
397 | duration | Duration (default 2.3s)(When set [duration] to Duration.zero, toast won't dismiss automatically)
398 | animDuration | Duration (default 400 milliseconds, animDuration * 2 <= duration, conditions must be met for toast to display properly)
399 | toastPositions | StyledToastPosition (default StyledToastPosition.bottom)
400 | toastAnimation | StyledToastAnimation (default StyledToastAnimation.fade)
401 | reverseAnimation | StyledToastAnimation
402 | alignment | AlignmentGeometry (default Alignment.center)
403 | axis | Axis (default Axis.vertical)
404 | startOffset | Offset
405 | endOffset | Offset
406 | reverseStartOffset | Offset
407 | reverseEndOffset | Offset
408 | curve | Curve (default Curves.linear)
409 | reverseCurve | Curve (default Curves.linear)
410 | dismissOtherOnShow | bool (default true)
411 | onDismiss | VoidCallback (Invoked when toast dismiss)
412 | fullWidth | bool (default false)(Full width parameter that the width of the screen minus the width of the margin.)
413 | isHideKeyboard | bool (default false)(Is hide keyboard when toast show)
414 | animationBuilder | CustomAnimationBuilder (Builder method for custom animation)
415 | reverseAnimBuilder | CustomAnimationBuilder (Builder method for custom reverse animation)
416 | isIgnoring | bool (default true)
417 | onInitState | OnInitStateCallback (When toast widget [initState], this callback will be called)
418 |
419 |
420 |
421 | ### showToast param
422 |
423 | property | description
424 | ---------------------|----------------------------
425 | msg | String (Not Null)(required)
426 | context | BuildContext (If you don't wrap app with StyledToast, context is required, otherwise, is not)
427 | duration | Duration (default 2.3s)(When set [duration] to Duration.zero, toast won't dismiss automatically)
428 | animDuration | Duration (default 400 milliseconds, animDuration * 2 <= duration, conditions must be met for toast to display properly)
429 | position | StyledToastPosition (default StyledToastPosition.bottom)
430 | textStyle | TextStyle (default TextStyle(fontSize: 16.0,fontWeight: FontWeight.normal,color: Colors.white))
431 | textPadding | EdgeInsetsGeometry (default EdgeInsets.symmetric(horizontal: 17.0,vertical: 8.0))
432 | backgroundColor | Color (default Color(0x99000000))
433 | borderRadius | BorderRadius (BorderRadius.circular(5.0))
434 | shapeBorder | ShapeBorder (default RoundedRectangleBorder(borderRadius: borderRadius))
435 | onDismiss | VoidCallback (Invoked when toast dismiss)
436 | textDirection | TextDirection (default TextDirection.ltr)
437 | dismissOtherOnShow | bool (default true)
438 | toastAnimation | StyledToastAnimation (default StyledToastAnimation.fade)
439 | reverseAnimation | StyledToastAnimation
440 | alignment | AlignmentGeometry (default Alignment.center)
441 | axis | Axis (default Axis.vertical)
442 | startOffset | Offset
443 | endOffset | Offset
444 | reverseStartOffset | Offset
445 | reverseEndOffset | Offset
446 | textAlign | TextAlign (default TextAlign.center)
447 | curve | Curve (default Curves.linear)
448 | reverseCurve | Curve (default Curves.linear)
449 | fullWidth | bool (default false)(Full width parameter that the width of the screen minus the width of the margin)
450 | isHideKeyboard | bool (default false)(Is hide keyboard when toast show)
451 | animationBuilder | CustomAnimationBuilder (Builder method for custom animation)
452 | reverseAnimBuilder | CustomAnimationBuilder (Builder method for custom reverse animation)
453 | isIgnoring | bool (default true)(Is the input ignored for the toast)
454 | onInitState | OnInitStateCallback (When toast widget [initState], this callback will be called)
455 |
456 |
457 |
458 | ### showToastWidget param
459 |
460 | property | description
461 | ---------------------|----------------------------
462 | widget | Widget (Not Null)(required)
463 | context | BuildContext (If you don't wrap app with StyledToast, context is required, otherwise, is not)
464 | duration | Duration (default 2.3s)(When set [duration] to Duration.zero, toast won't dismiss automatically)
465 | animDuration | Duration (default 400 milliseconds, animDuration * 2 <= duration, conditions must be met for toast to display properly)
466 | onDismiss | VoidCallback (Invoked when toast dismiss)
467 | dismissOtherOnShow | bool (default true)
468 | textDirection | TextDirection (default TextDirection.ltr)
469 | position | StyledToastPosition (default )
470 | animation | StyledToastAnimation (default StyledToastAnimation.fade)
471 | reverseAnimation | StyledToastAnimation
472 | alignment | AlignmentGeometry (default Alignment.center)
473 | axis | Axis (default Axis.vertical)
474 | startOffset | Offset
475 | endOffset | Offset
476 | reverseStartOffset | Offset
477 | reverseEndOffset | Offset
478 | curve | Curve (default Curves.linear)
479 | reverseCurve | Curve (default Curves.linear)
480 | isHideKeyboard | bool (default false)(Is hide keyboard when toast show)
481 | animationBuilder | CustomAnimationBuilder (Builder method for custom animation)
482 | reverseAnimBuilder | CustomAnimationBuilder (Builder method for custom reverse animation)
483 | isIgnoring | bool (default true )(Is the input ignored for the toast)
484 | onInitState | OnInitStateCallback (When toast widget [initState], this callback will be called)
485 |
486 |
487 | ## Example
488 | [example](https://github.com/JackJonson/flutter_styled_toast/blob/master/example/lib/main.dart)
489 |
490 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | include: package:flutter_lints/flutter.yaml
2 |
3 | linter:
4 | rules:
5 | avoid_print: true
6 | annotate_overrides: true
7 | hash_and_equals: true
8 | prefer_is_not_empty: true
9 | prefer_relative_imports: true
10 | prefer_single_quotes: true
11 | sort_child_properties_last: false
12 | use_build_context_synchronously: false
13 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # Visual Studio Code related
19 | .vscode/
20 |
21 | # Flutter/Dart/Pub related
22 | **/doc/api/
23 | .dart_tool/
24 | .flutter-plugins
25 | .packages
26 | .pub-cache/
27 | .pub/
28 | /build/
29 | pubspec.lock
30 |
31 | # Android related
32 | **/android/**/gradle-wrapper.jar
33 | **/android/.gradle
34 | **/android/captures/
35 | **/android/gradlew
36 | **/android/gradlew.bat
37 | **/android/local.properties
38 | **/android/**/GeneratedPluginRegistrant.java
39 |
40 | # iOS/XCode related
41 | **/ios/**/*.mode1v3
42 | **/ios/**/*.mode2v3
43 | **/ios/**/*.moved-aside
44 | **/ios/**/*.pbxuser
45 | **/ios/**/*.perspectivev3
46 | **/ios/**/*sync/
47 | **/ios/**/.sconsign.dblite
48 | **/ios/**/.tags*
49 | **/ios/**/.vagrant/
50 | **/ios/**/DerivedData/
51 | **/ios/**/Icon?
52 | **/ios/**/Pods/
53 | **/ios/**/.symlinks/
54 | **/ios/**/profile
55 | **/ios/**/xcuserdata
56 | **/ios/.generated/
57 | **/ios/Flutter/App.framework
58 | **/ios/Flutter/Flutter.framework
59 | **/ios/Flutter/Generated.xcconfig
60 | **/ios/Flutter/app.flx
61 | **/ios/Flutter/app.zip
62 | **/ios/Flutter/flutter_assets/
63 | **/ios/ServiceDefinitions.json
64 | **/ios/Runner/GeneratedPluginRegistrant.*
65 | **/ios/Flutter/flutter_export_environment.sh
66 |
67 | # Exceptions to above rules.
68 | !**/ios/**/default.mode1v3
69 | !**/ios/**/default.mode2v3
70 | !**/ios/**/default.pbxuser
71 | !**/ios/**/default.perspectivev3
72 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
73 |
--------------------------------------------------------------------------------
/example/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 7a4c33425ddd78c54aba07d86f3f9a4a0051769b
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # example
2 |
3 | A new Flutter application.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13 |
14 | For help getting started with Flutter, view our
15 | [online documentation](https://flutter.dev/docs), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
26 |
27 | android {
28 | compileSdkVersion 28
29 |
30 | lintOptions {
31 | disable 'InvalidPackage'
32 | }
33 |
34 | defaultConfig {
35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
36 | applicationId "com.jackjonson.example"
37 | minSdkVersion 16
38 | targetSdkVersion 28
39 | versionCode flutterVersionCode.toInteger()
40 | versionName flutterVersionName
41 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
42 | }
43 |
44 | buildTypes {
45 | release {
46 | // TODO: Add your own signing config for the release build.
47 | // Signing with the debug keys for now, so `flutter run --release` works.
48 | signingConfig signingConfigs.debug
49 | }
50 | }
51 | }
52 |
53 | flutter {
54 | source '../..'
55 | }
56 |
57 | dependencies {
58 | testImplementation 'junit:junit:4.12'
59 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
60 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
61 | }
62 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |