Skip to content

Commit

Permalink
Replace WillPopScope with PopScope
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleKun committed Dec 24, 2023
1 parent 0f430b3 commit 9a20e08
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lib/lang/es.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const Map<String, String> es = {
'Genera películas personalizadas con periodos seleccionados o vídeos específicos 🎥',
'feat7v15': 'Notificacion',
'featDesc7v15':
'Configura notificaciones diarias programadas para recordarte grabar tu momento especial 🔔',
'Configura notificaciones diaryas programadas para recordarte grabar tu momento especial 🔔',
'default': 'Patrón',
'profileNameAlreadyExists': 'El nombre del perfil ya existe',
'profileNameCannotContainSpecialChars':
Expand Down
8 changes: 4 additions & 4 deletions lib/pages/home/create_movie/widgets/create_movie_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ class _CreateMovieOptionsState extends State<CreateMovieOptions> {

@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () async {
showDialog(
return PopScope(
canPop: false,
onPopInvoked: (_) async {
await showDialog(
barrierDismissible: false,
context: Get.context!,
builder: (context) => CustomDialog(
Expand All @@ -65,7 +66,6 @@ class _CreateMovieOptionsState extends State<CreateMovieOptions> {
action2: () => Get.back(),
),
);
return true;
},
child: Scaffold(
appBar: AppBar(
Expand Down
8 changes: 4 additions & 4 deletions lib/pages/save_video/save_video_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,9 @@ class _SaveVideoPageState extends State<SaveVideoPage> {

@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () async {
return PopScope(
canPop: false,
onPopInvoked: (_) async {
// Prevent showing the option to re-record video if not coming from the recording page
final isFromRecordingPage = routeArguments['isFromRecordingPage'];
if (!isFromRecordingPage) {
Expand All @@ -477,7 +478,7 @@ class _SaveVideoPageState extends State<SaveVideoPage> {
}
Get.back();
} else {
showDialog(
await showDialog(
barrierDismissible: false,
context: Get.context!,
builder: (context) => CustomDialog(
Expand All @@ -493,7 +494,6 @@ class _SaveVideoPageState extends State<SaveVideoPage> {
),
);
}
return true;
},
child: Scaffold(
appBar: AppBar(
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/save_video/widgets/save_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ class _SaveButtonState extends State<SaveButton> {
return await showDialog(
context: Get.context!,
barrierDismissible: false,
builder: (context) => WillPopScope(
onWillPop: () async => false,
builder: (context) => PopScope(
canPop: false,
child: ValueListenableBuilder(
valueListenable: saveProgressPercentage,
builder: (context, value, child) => AlertDialog(
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/storage_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ class StorageUtils {
showDialog(
barrierDismissible: false,
context: Get.context!,
builder: (context) => WillPopScope(
onWillPop: () async => false,
builder: (context) => PopScope(
canPop: false,
child: AlertDialog(
title: const Icon(
Icons.handyman,
Expand Down

0 comments on commit 9a20e08

Please sign in to comment.