marcos930807 / awesomeDialogs

A new Flutter package project for simple a awesome dialogs
Other
340 stars 110 forks source link

Touch Outside Dismiss #101

Closed YouSour closed 2 years ago

YouSour commented 2 years ago

hi , why touch outside to dismiss it keeping pop my current page, any idea ? implement :

import 'package:awesome_dialog/awesome_dialog.dart';
import 'package:flutter/material.dart';

class Alert {
  static show({
    required String desc,
    required BuildContext context,
    DialogType dailogType = DialogType.SUCCES,
    Duration autoHide = const Duration(seconds: 5),
  }) {
    return AwesomeDialog(
      context: context,
      dialogType: dailogType,
      headerAnimationLoop: false,
      animType: AnimType.TOPSLIDE,
      autoHide: autoHide,
      width: 500,
      aligment: const Alignment(0.0, -0.9),
      barrierColor: Colors.transparent,
      title: dailogType.name,
      desc: desc,
    ).show();
  }
}

version : awesome_dialog: ^2.2.0 problem : https://drive.google.com/file/d/11gaFXAia6-3kb5K36MMG55UHwktLzkAa/view?usp=sharing

marcos930807 commented 2 years ago

That depend on which context do you use for showing the dialog, my advice is that try using the prop useRootNavigator.

YouSour commented 2 years ago

@marcos930807 i think the problem is when i use with autoHide i set 5 sec for auto close Dialog , after i touch outside to dismiss Dialog and then 5 sec later, it pop from my current page.

OutdatedGuy commented 2 years ago

Hey, @YouSour I think I understood the issue. I'll try to fix the issue as soon as possible. Thanks for the report.