Skip to content

Commit

Permalink
message of loading can be null
Browse files Browse the repository at this point in the history
  • Loading branch information
shirne committed Jul 1, 2024
1 parent 6a9c09d commit eef30d4
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [4.7.4]
* The message of loading can be null

## [4.7.3]
* improve code style
* improve dropdown animate
Expand Down
38 changes: 38 additions & 0 deletions example/lib/custom_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,44 @@ class ToastInnerPage extends StatelessWidget {
],
),
const SizedBox(height: 8),
GridView(
shrinkWrap: true,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2),
children: [
Center(
child: ToastWidget(
'测试消息',
),
),
Center(
child: SnackWidget('testaa'),
),
Center(
child: ToastWidget(
'测试消息',
icon: Icon(DialogIcons.checkmarkFill),
),
),
Center(
child: SnackWidget('testaa'),
),
Center(
child: ToastWidget(
'测试消息',
style: ToastStyle(
direction: Axis.vertical,
iconPadding: EdgeInsets.all(24),
iconTheme: IconThemeData(size: 42),
),
icon: Icon(DialogIcons.checkmarkFill),
),
),
Center(
child: SnackWidget('testaa'),
),
],
),
],
),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/src/my_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ class MyDialog {

/// A wrapper of [ShirneDialog.loading]
static ProgressController loading(
String message, {
String? message, {
bool? showProgress,
Duration? duration,

Expand Down Expand Up @@ -772,7 +772,7 @@ class ShirneDialog {
/// show a loading progress within an [OverlayEntry].
/// keep in `time` seconds or manual control it's status by pass 0 to `time`
ProgressController loading(
String message, {
String? message, {
bool? showProgress,
Duration? duration,

Expand Down
17 changes: 9 additions & 8 deletions lib/src/widgets/progress.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,16 @@ class _ProgressWidgetState extends State<ProgressWidget>
),
strokeWidth: widget.style?.strokeWidth ?? 4,
),
const SizedBox(height: 10),
Text(
widget.message!,
style: const TextStyle(
color: Colors.black54,
decoration: TextDecoration.none,
fontSize: 14,
if (widget.message != null) const SizedBox(height: 10),
if (widget.message != null)
Text(
widget.message!,
style: const TextStyle(
color: Colors.black54,
decoration: TextDecoration.none,
fontSize: 14,
),
),
),
],
),
);
Expand Down
8 changes: 4 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: shirne_dialog
description: A flutter package to use alert, toast, popup, snack, imagePreview, loading etc. with customizable style in anywhere.
version: 4.7.3
version: 4.7.4
homepage: https://shirne.github.io/dialog/
repository: https://github.com/shirne/shirne_dialog
screenshots:
- description: 'list of features with some toasts'
screenshots:
- description: "list of features with some toasts"
path: screenshots/preview.jpg
topics:
- dialog
Expand All @@ -30,4 +30,4 @@ flutter:
fonts:
- family: shirne_dialog_icons
fonts:
- asset: assets/fonts/icons.ttf
- asset: assets/fonts/icons.ttf

0 comments on commit eef30d4

Please sign in to comment.