提交 2daeba60 编写于 作者: bluesofy's avatar bluesofy 🎏

🎏 增加export辅助类

上级 a3b10122
## 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
......
# 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.
<br>
用于Flutter项目的吐司,非调用原生Toast,纯Dart层实现。
## Feature
- 非调用原生Toast,Dart实现;
- 交互和动效接近原生Toast,不触发遮罩点击事件,跨页仍显示;
- 其他
## Get Started
### Add Dependency
```yaml
dependencies:
bytoast: ^1.0.2
bytoast: ^1.1.0
```
### Usage
......
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<MyHomePage> {
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<MyHomePage> {
);
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(
......
......@@ -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:
......
......@@ -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: ../
......
......@@ -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,
......
......@@ -68,7 +68,7 @@ class ToastLayerState extends State<ToastLayer>
columnWidgets
..add(_holder.iconPathTop)
..add(
SizedBox(height: 8.0),
SizedBox(height: 12.0),
);
}
columnWidgets.add(Row(
......@@ -97,7 +97,7 @@ class ToastLayerState extends State<ToastLayer>
blurRadius: 2,
spreadRadius: 1)
],
borderRadius: new BorderRadius.all(Radius.circular(4)),
borderRadius: new BorderRadius.all(Radius.circular(2)),
),
child: _buildContent(),
);
......
......@@ -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);
......
......@@ -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:
......
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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册