Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
fluttertpc_get
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jonny Borges
2021-11-29 17:41:16 -0300
Browse Files
Options
Browse Files
Download
Plain Diff
Committed by
GitHub
2021-11-29 17:41:16 -0300
Commit
dc353e25433144733906c4e5d4d2e8f6e4eb7559
dc353e25
2 parents
4ef75896
bc6a9e45
Merge pull request #2022 from jonataslaw/4.5.1
bump to 4.5.1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
6 deletions
CHANGELOG.md
lib/get_navigation/src/snackbar/snackbar.dart
pubspec.yaml
test/navigation/snackbar_test.dart
CHANGELOG.md
View file @
dc353e2
## [4.5.1] - Big Update
Fix Snackbar when it have action and icon the same time
## [4.5.0] - Big Update
To have a context-free, page-agnostic snackbar, we used OverlayRoute to display a partial route.
However this had several problems:
...
...
lib/get_navigation/src/snackbar/snackbar.dart
View file @
dc353e2
...
...
@@ -560,7 +560,7 @@ You need to either use message[String], or messageText[Widget] or define a userI
mainAxisSize:
MainAxisSize
.
max
,
children:
[
_buildLeftBarIndicator
(),
if
(
_rowStyle
==
RowStyle
.
icon
)
if
(
_rowStyle
==
RowStyle
.
icon
||
_rowStyle
==
RowStyle
.
all
)
ConstrainedBox
(
constraints:
BoxConstraints
.
tightFor
(
width:
42.0
+
iconPadding
),
...
...
@@ -608,7 +608,7 @@ You need to either use message[String], or messageText[Widget] or define a userI
],
),
),
if
(
_rowStyle
==
RowStyle
.
action
)
if
(
_rowStyle
==
RowStyle
.
action
||
_rowStyle
==
RowStyle
.
all
)
Padding
(
padding:
EdgeInsets
.
only
(
right:
buttonPadding
),
child:
widget
.
mainButton
,
...
...
pubspec.yaml
View file @
dc353e2
name
:
get
description
:
Open screens/snackbars/dialogs without context, manage states and inject dependencies easily with GetX.
version
:
4.5.
0
version
:
4.5.
1
homepage
:
https://github.com/jonataslaw/getx
environment
:
...
...
test/navigation/snackbar_test.dart
View file @
dc353e2
...
...
@@ -115,9 +115,6 @@ void main() {
onTap:
()
{
getBar
=
GetSnackBar
(
message:
'bar1'
,
icon:
Icon
(
Icons
.
alarm
),
mainButton:
TextButton
(
onPressed:
()
{},
child:
Text
(
'button'
)),
duration:
const
Duration
(
seconds:
2
),
isDismissible:
true
,
dismissDirection:
dismissDirection
,
...
...
@@ -212,4 +209,38 @@ void main() {
await
tester
.
pump
(
const
Duration
(
milliseconds:
3000
));
await
getBarController
.
close
(
withAnimations:
false
);
});
testWidgets
(
"Get test actions and icon"
,
(
tester
)
async
{
final
icon
=
Icon
(
Icons
.
alarm
);
final
action
=
TextButton
(
onPressed:
()
{},
child:
Text
(
'button'
));
late
final
GetSnackBar
getBar
;
await
tester
.
pumpWidget
(
GetMaterialApp
(
home:
Scaffold
()));
expect
(
Get
.
isSnackbarOpen
,
false
);
expect
(
find
.
text
(
'bar1'
),
findsNothing
);
getBar
=
GetSnackBar
(
message:
'bar1'
,
icon:
icon
,
mainButton:
action
,
leftBarIndicatorColor:
Colors
.
yellow
,
showProgressIndicator:
true
,
// maxWidth: 100,
borderColor:
Colors
.
red
,
duration:
const
Duration
(
seconds:
1
),
isDismissible:
false
,
);
Get
.
showSnackbar
(
getBar
);
expect
(
Get
.
isSnackbarOpen
,
true
);
await
tester
.
pump
(
const
Duration
(
milliseconds:
500
));
expect
(
find
.
byWidget
(
getBar
),
findsOneWidget
);
expect
(
find
.
byWidget
(
icon
),
findsOneWidget
);
expect
(
find
.
byWidget
(
action
),
findsOneWidget
);
await
tester
.
pump
(
const
Duration
(
milliseconds:
500
));
expect
(
Get
.
isSnackbarOpen
,
false
);
});
}
...
...
Please
register
or
login
to post a comment