Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pandora
ByToast
提交
2daeba60
B
ByToast
项目概览
Pandora
/
ByToast
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
ByToast
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
2daeba60
编写于
6月 12, 2020
作者:
bluesofy
🎏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
🎏
增加export辅助类
上级
a3b10122
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
33 addition
and
23 deletion
+33
-23
CHANGELOG.md
CHANGELOG.md
+5
-0
README.md
README.md
+8
-4
example/lib/main.dart
example/lib/main.dart
+5
-5
example/pubspec.lock
example/pubspec.lock
+2
-2
example/pubspec.yaml
example/pubspec.yaml
+2
-2
lib/bytoast.dart
lib/bytoast.dart
+6
-5
lib/core/toast_layer.dart
lib/core/toast_layer.dart
+2
-2
lib/core/toast_style.dart
lib/core/toast_style.dart
+1
-1
pubspec.lock
pubspec.lock
+1
-1
pubspec.yaml
pubspec.yaml
+1
-1
未找到文件。
CHANGELOG.md
浏览文件 @
2daeba60
## 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
...
...
README.md
浏览文件 @
2daeba60
# 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
...
...
example/lib/main.dart
浏览文件 @
2daeba60
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
(
...
...
example/pubspec.lock
浏览文件 @
2daeba60
...
...
@@ -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.1
5
"
version: "0.2.1
6
"
typed_data:
dependency: transitive
description:
...
...
example/pubspec.yaml
浏览文件 @
2daeba60
...
...
@@ -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
:
../
...
...
lib/bytoast.dart
浏览文件 @
2daeba60
...
...
@@ -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
,
...
...
lib/core/toast_layer.dart
浏览文件 @
2daeba60
...
...
@@ -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
(),
);
...
...
lib/core/toast_style.dart
浏览文件 @
2daeba60
...
...
@@ -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:
1
4
,
bottom:
14
);
EdgeInsets
.
only
(
left:
20
,
right:
20
,
top:
1
6
,
bottom:
16
);
// Duration
static
const
Duration
shortDuration
=
Duration
(
milliseconds:
2400
);
...
...
pubspec.lock
浏览文件 @
2daeba60
...
...
@@ -120,7 +120,7 @@ packages:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.1
5
"
version: "0.2.1
6
"
typed_data:
dependency: transitive
description:
...
...
pubspec.yaml
浏览文件 @
2daeba60
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录