From 2daeba602371c85b17f6e0044577acf9721c6b19 Mon Sep 17 00:00:00 2001 From: Byk Date: Fri, 12 Jun 2020 17:56:09 +0800 Subject: [PATCH] =?UTF-8?q?:flags:=20=E5=A2=9E=E5=8A=A0export=E8=BE=85?= =?UTF-8?q?=E5=8A=A9=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 5 +++++ README.md | 12 ++++++++---- example/lib/main.dart | 10 +++++----- example/pubspec.lock | 4 ++-- example/pubspec.yaml | 4 ++-- lib/bytoast.dart | 11 ++++++----- lib/core/toast_layer.dart | 4 ++-- lib/core/toast_style.dart | 2 +- pubspec.lock | 2 +- pubspec.yaml | 2 +- 10 files changed, 33 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c701a1..9dcbcd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.1.0 - 2020/06/12 + +* Export the Other Classes in *bytoast.dart*, so just import *bytoast.dart* is okay + + ## 1.0.2 - 2020/05/13 * Slightly Adjust the UI diff --git a/README.md b/README.md index c2585ce..577ced2 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,19 @@ # ByToast -[![pub package](https://img.shields.io/badge/pub-v1.0.1-brightgreen?style=flat&logo=flutter)](https://pub.dev/packages/bytoast) +[![pub package](https://img.shields.io/badge/pub-v1.0.1-brightgreen?style=flat&logo=flutter)](https://pub.dev/packages/bytoast) +[![author](https://img.shields.io/badge/author-:byk-4189d5?style=flat&logo=github)](https://github.com/bluesofy) A Toast Widget for Flutter. -
-用于Flutter项目的吐司,非调用原生Toast,纯Dart层实现。 + +## Feature +- 非调用原生Toast,Dart实现; +- 交互和动效接近原生Toast,不触发遮罩点击事件,跨页仍显示; +- 其他 ## Get Started ### Add Dependency ```yaml dependencies: - bytoast: ^1.0.2 + bytoast: ^1.1.0 ``` ### Usage diff --git a/example/lib/main.dart b/example/lib/main.dart index 77010ab..f1c3737 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,5 +1,4 @@ import 'package:bytoast/bytoast.dart'; -import 'package:bytoast/core/toast_style.dart'; import 'package:flutter/material.dart'; import 'base/page_widget.dart'; @@ -50,8 +49,10 @@ class _MyHomePageState extends BasePageState { toast(context, 'This is a Toast'); break; case 1: - toast(context, - 'This is a Long Long Long Long Long Long Long Long Long Long Long Long Long Toast'); + toast( + context, + 'This is a Long Long Long Long Long Long Long Long Long Long Long Long Long Toast', + ); break; case 2: ByToast.withIcon( @@ -62,8 +63,7 @@ class _MyHomePageState extends BasePageState { ); break; case 3: - ByToast.withIcon( - context, 'U Got a new Msg', Icon(Icons.alarm, color: Colors.white)); + ByToast.withIcon(context, 'U Got a new Msg', Icon(Icons.alarm, color: Colors.white)); break; case 4: ByToast.more( diff --git a/example/pubspec.lock b/example/pubspec.lock index 59729bb..0169b18 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -21,7 +21,7 @@ packages: path: ".." relative: true source: path - version: "1.0.2" + version: "1.1.0" charcode: dependency: transitive description: @@ -134,7 +134,7 @@ packages: name: test_api url: "https://pub.flutter-io.cn" source: hosted - version: "0.2.15" + version: "0.2.16" typed_data: dependency: transitive description: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 55cc5ac..1665893 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.2+102 +version: 1.1.0+110 environment: sdk: ">=2.7.0 <3.0.0" @@ -30,7 +30,7 @@ dependencies: cupertino_icons: ^0.1.3 # ByToast -# bytoast: ^1.0.2 +# bytoast: ^1.1.0 bytoast: path: ../ diff --git a/lib/bytoast.dart b/lib/bytoast.dart index 8a91fc6..975ff85 100644 --- a/lib/bytoast.dart +++ b/lib/bytoast.dart @@ -6,12 +6,15 @@ import 'core/toast_data.dart'; import 'core/toast_mgr.dart'; import 'core/toast_style.dart'; +export 'core/toast_data.dart'; +export 'core/toast_mgr.dart'; +export 'core/toast_style.dart'; + class ByToast { ByToast._(); /// Show Normal Toast - static void short(BuildContext context, String msg) => - more(context, msg: msg); + static void short(BuildContext context, String msg) => more(context, msg: msg); /// Show Long Shown Toast static void long(BuildContext context, String msg) => more( @@ -21,9 +24,7 @@ class ByToast { ); /// Show Toast with Icon on Left/Top - static void withIcon(BuildContext context, String msg, Widget icon, - {isOnTop = false}) => - more( + static void withIcon(BuildContext context, String msg, Widget icon, {isOnTop = false}) => more( context, msg: msg, iconPathLeft: isOnTop ? null : icon, diff --git a/lib/core/toast_layer.dart b/lib/core/toast_layer.dart index e2c3ee6..04e9166 100644 --- a/lib/core/toast_layer.dart +++ b/lib/core/toast_layer.dart @@ -68,7 +68,7 @@ class ToastLayerState extends State columnWidgets ..add(_holder.iconPathTop) ..add( - SizedBox(height: 8.0), + SizedBox(height: 12.0), ); } columnWidgets.add(Row( @@ -97,7 +97,7 @@ class ToastLayerState extends State blurRadius: 2, spreadRadius: 1) ], - borderRadius: new BorderRadius.all(Radius.circular(4)), + borderRadius: new BorderRadius.all(Radius.circular(2)), ), child: _buildContent(), ); diff --git a/lib/core/toast_style.dart b/lib/core/toast_style.dart index 18d8393..b825b4d 100644 --- a/lib/core/toast_style.dart +++ b/lib/core/toast_style.dart @@ -9,7 +9,7 @@ class ToastStyle { static const EdgeInsetsGeometry textPadding = EdgeInsets.only(left: 32, right: 32, top: 10, bottom: 10); static const EdgeInsetsGeometry textWithIconPadding = - EdgeInsets.only(left: 20, right: 20, top: 14, bottom: 14); + EdgeInsets.only(left: 20, right: 20, top: 16, bottom: 16); // Duration static const Duration shortDuration = Duration(milliseconds: 2400); diff --git a/pubspec.lock b/pubspec.lock index 43732ee..0af7bbb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -120,7 +120,7 @@ packages: name: test_api url: "https://pub.flutter-io.cn" source: hosted - version: "0.2.15" + version: "0.2.16" typed_data: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 6e68657..b08f394 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: bytoast description: A Toast Widget for Flutter. Pure Dart Code. Both Android and iOS. Can Show Simple Text Toast or with Image or Customize. -version: 1.0.2 +version: 1.1.0 homepage: https://github.com/PandoraMaze/ByToast environment: -- GitLab