Skip to content

Commit

Permalink
fix: dialog popping at startup causing black screen
Browse files Browse the repository at this point in the history
  • Loading branch information
MSOB7YY committed Jul 1, 2024
1 parent 52bcc88 commit 784263c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,11 @@ jobs:
# keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
# keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }}

- name: "✏️ Generate release changelog"
id: generate_changelog
uses: heinrichreimer/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Creating Snapshot Release at namida-snapshots
uses: softprops/action-gh-release@v2
with:
repository: namidaco/namida-snapshots
tag_name: ${{ steps.extract_version.outputs.version}}
body: ${{ steps.generate_changelog.outputs.changelog }}
files: |
build_final/*
token: ${{ secrets.SNAPSHOTS_REPO_SECRET }}
Expand Down
15 changes: 10 additions & 5 deletions lib/controller/navigator_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,15 @@ class NamidaNavigator {
if (_currentMenusNumber > 0) {
_currentMenusNumber--;
if (handleClosing) {
_rootNav.currentState?.pop();
popRoot();
}
}
_printMenus();
}

void popAllMenus() {
_rootNav.currentState?.popUntil((route) => true);
if (_currentMenusNumber == 0) return;
_rootNav.currentState?.popUntil((r) => r.isFirst);
_currentMenusNumber = 0;
_printMenus();
}
Expand Down Expand Up @@ -222,7 +223,7 @@ class NamidaNavigator {

Future<void> exitFullScreen() async {
if (!_isInFullScreen) return;
_rootNav.currentState?.pop();
popRoot();

setDefaultSystemUIOverlayStyle();
await Future.wait([
Expand Down Expand Up @@ -266,7 +267,10 @@ class NamidaNavigator {
}

Future<void> popRoot<T>([T? result]) async {
return _rootNav.currentState?.pop<T>(result);
final state = _rootNav.currentState;
if (state == null) return;
if (!state.canPop()) return;
return state.pop<T>(result);
}

/// Use [dialogBuilder] in case you want to acess the theme generated by [colorScheme].
Expand Down Expand Up @@ -337,13 +341,14 @@ class NamidaNavigator {
int closeCount = count.withMaximum(_currentDialogNumber);
while (closeCount > 0) {
_currentDialogNumber--;
_rootNav.currentState?.pop();
popRoot();
closeCount--;
}
_printDialogs();
}

Future<void> closeAllDialogs() async {
if (_currentMenusNumber == 0) return;
closeDialog(_currentDialogNumber);
_printDialogs();
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: namida
description: A Beautiful and Feature-rich Music Player, With YouTube & Video Support Built in Flutter
publish_to: "none"
version: 2.8.5-beta+240701180
version: 2.8.6-beta+240701182

environment:
sdk: ">=3.4.0 <4.0.0"
Expand Down

0 comments on commit 784263c

Please sign in to comment.