Skip to content

Commit

Permalink
fix(ui): upgrade to flash@3.0.5+1
Browse files Browse the repository at this point in the history
  • Loading branch information
JagandeepBrar committed Aug 27, 2023
1 parent 8bd3368 commit 55c417f
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 68 deletions.
114 changes: 56 additions & 58 deletions lib/widgets/ui/snackbar/snackbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,64 +45,62 @@ Future<void> showLunaSnackBar({
bool showButton = false,
String buttonText = 'view',
Function? buttonOnPressed,
}) async =>
showFlash(
context: LunaState.context,
duration: duration ?? Duration(seconds: showButton ? 4 : 2),
builder: (context, controller) => Flash(
backgroundColor: Theme.of(context).primaryColor,
controller: controller,
boxShadows: [
BoxShadow(
blurRadius: LunaUI.DEFAULT_MARGIN_SIZE / 2,
spreadRadius: LunaUI.DEFAULT_MARGIN_SIZE / 4,
color: Colors.black.withOpacity(LunaUI.OPACITY_SPLASH / 2),
),
],
horizontalDismissDirection: HorizontalDismissDirection.horizontal,
margin: LunaUI.MARGIN_DEFAULT,
behavior: FlashBehavior.floating,
position: position,
}) async {
showFlash(
context: LunaState.context,
duration: duration ?? Duration(seconds: showButton ? 4 : 2),
transitionDuration: const Duration(milliseconds: LunaUI.ANIMATION_SPEED),
reverseTransitionDuration:
const Duration(milliseconds: LunaUI.ANIMATION_SPEED),
builder: (context, controller) => FlashBar(
controller: controller,
backgroundColor: Theme.of(context).primaryColor,
behavior: FlashBehavior.floating,
margin: LunaUI.MARGIN_DEFAULT,
position: position,
shape: RoundedRectangleBorder(
side: BorderSide(
color:
LunaUI.shouldUseBorder ? LunaColours.white10 : Colors.transparent,
),
borderRadius: BorderRadius.circular(LunaUI.BORDER_RADIUS),
borderColor:
LunaUI.shouldUseBorder ? LunaColours.white10 : Colors.transparent,
child: FlashBar(
title: LunaText.title(
text: title,
maxLines: 4,
overflow: TextOverflow.ellipsis,
),
content: LunaText.subtitle(
text: message,
maxLines: 8,
overflow: TextOverflow.ellipsis,
),
shouldIconPulse: false,
icon: Padding(
child: LunaIconButton(
icon: type.icon,
color: type.color,
),
padding: const EdgeInsets.only(
left: LunaUI.DEFAULT_MARGIN_SIZE / 2,
),
),
primaryAction: showButton
? TextButton(
child: Text(
buttonText.toUpperCase(),
style: const TextStyle(
fontWeight: LunaUI.FONT_WEIGHT_BOLD,
color: LunaColours.accent,
),
),
onPressed: () {
HapticFeedback.lightImpact();
controller.dismiss();
buttonOnPressed!();
},
)
: null,
),
title: LunaText.title(
text: title,
maxLines: 4,
overflow: TextOverflow.ellipsis,
),
content: LunaText.subtitle(
text: message,
maxLines: 8,
overflow: TextOverflow.ellipsis,
),
shouldIconPulse: false,
icon: Padding(
child: LunaIconButton(
icon: type.icon,
color: type.color,
),
padding: const EdgeInsets.only(
left: LunaUI.DEFAULT_MARGIN_SIZE / 2,
),
),
);
primaryAction: showButton
? TextButton(
child: Text(
buttonText.toUpperCase(),
style: const TextStyle(
fontWeight: LunaUI.FONT_WEIGHT_BOLD,
color: LunaColours.accent,
),
),
onPressed: () {
HapticFeedback.lightImpact();
controller.dismiss();
buttonOnPressed!();
},
)
: null,
),
);
}
2 changes: 1 addition & 1 deletion macos/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
33CC10EC2044A3C60003C045 = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lunasea",
"description": "Self-Hosted Controller",
"version": "10.2.5",
"version": "10.2.6",
"private": true,
"scripts": {
"build:android": "flutter clean && flutter build apk --release",
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -501,10 +501,10 @@ packages:
dependency: "direct main"
description:
name: flash
sha256: f110b161dc67e8cf78d3b7ed29a7ea9575a4f97c8725510c3b08b0a1fb3bbda8
sha256: "0ec6c32deb839a8ead1ba17a3bb055996f00ea6631384f4705ac6a08dec8b16c"
url: "https://pub.dev"
source: hosted
version: "2.0.5+1"
version: "3.0.5+1"
flutter:
dependency: "direct main"
description: flutter
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: lunasea
description: Self-Hosted Controller
version: 10.2.5+1
version: 10.2.6+1
publish_to: "none"
environment:
sdk: ">=3.0.0 <4.0.0"
Expand All @@ -23,7 +23,7 @@ dependencies:
firebase_messaging: ^14.6.7
firebase_storage: ^11.2.6
fl_chart: ^0.63.0
flash: ^2.0.5+1
flash: ^3.0.5+1
flutter_cache_manager: ^3.3.1
flutter_spinkit: ^5.2.0
go_router: ^10.1.0
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: lunasea
version: 10.2.5
version: 10.2.6
confinement: strict
base: core18
# Required but managed manually via Snapcraft dashboard
Expand Down

0 comments on commit 55c417f

Please sign in to comment.