Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed depriciated package onPopInvoked #245

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
arguments=--init-script /var/folders/87/sjnhgg2s1dn1b0l2r0jrgxx80000gn/T/d146c9752a26f79b52047fb6dc6ed385d064e120494f96f08ca63a317c41f94c.gradle --init-script /var/folders/87/sjnhgg2s1dn1b0l2r0jrgxx80000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle
arguments=--init-script /home/shruti/.config/Code/User/globalStorage/redhat.java/1.38.0/config_linux/org.eclipse.osgi/58/0/.cp/gradle/init/init.gradle --init-script /home/shruti/.config/Code/User/globalStorage/redhat.java/1.38.0/config_linux/org.eclipse.osgi/58/0/.cp/gradle/protobuf/init.gradle
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=/opt/homebrew/Cellar/openjdk/21.0.2/libexec/openjdk.jdk/Contents/Home
java.home=/usr/lib/jvm/java-11-openjdk-amd64
jvm.arguments=
offline.mode=false
override.workspace.settings=true
Expand Down
18 changes: 11 additions & 7 deletions lib/presentation/auth/auth_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,17 @@ class _AuthScreenState extends State<AuthScreen>
final authCubit = BlocProvider.of<AuthCubit>(context);
return PopScope(
canPop: false,
onPopInvoked: (didPop) async {
bool? popped = await onPopHome();

if (popped == true) {
await SystemNavigator.pop();
}
},
onPopInvokedWithResult: (bool didPop, Object? result) async {
if (didPop) {
return;
}

bool? popped = await onPopHome();
if (popped == true) {
await SystemNavigator.pop();
}
return;
},
child: BlocConsumer<AuthCubit, AuthState>(
listener: (context, state) {
if (state is SuccessState) {
Expand Down
16 changes: 10 additions & 6 deletions lib/presentation/home/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,17 @@ class _HomeScreenState extends State<HomeScreen> {
Widget build(BuildContext context) {
return PopScope(
canPop: false,
onPopInvoked: (didPop) async {
bool? popped = await _onPopHome(context);
onPopInvokedWithResult: (bool didPop, Object? result) async {
if (didPop) {
return;
}

bool? popped = await _onPopHome(context);
if (popped == true) {
await SystemNavigator.pop();
}
},

if (popped == true) {
await SystemNavigator.pop();
}
},
child: BlocConsumer<HomeCubit, HomeState>(
listener: (context, state) {
if (state is LoadedHomeState) {
Expand Down
Loading