Jonny Borges

bump to 4.5.1

## [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:
... ...
... ... @@ -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,
... ...
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:
... ...
... ... @@ -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);
});
}
... ...