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

release模式dialog完全出不来 #190

Closed
git-maven opened this issue May 24, 2024 · 7 comments
Closed

release模式dialog完全出不来 #190

git-maven opened this issue May 24, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@git-maven
Copy link

版本信息

  • Flutter版本:3.19.5
  • flutter_smart_dialog版本:4.9.7+4

描述bug/需求

debug模式下正常,release模式就无法弹出来了,要点几十下才出来,回退到4.9.6就正常
另外toast在使用last模式,在A页面弹出后,马上回退到B页面,会不消失

问题demo

@xdd666t
Copy link
Member

xdd666t commented May 24, 2024

给下可复现问题,可运行的简化demo;你说的现象也录个视频上传下吧

@git-maven
Copy link
Author

git-maven commented May 25, 2024

  • 在release模式下,无法弹出dialog,只有当app回后台再回前台才能弹出
class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      builder: FlutterSmartDialog.init(),
      navigatorObservers: [
        FlutterSmartDialog.observer
      ],
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: Scaffold(
        body: Center(
          child: GestureDetector(
            onTap: () {
              SmartDialog.show(
                tag: '11',
                builder: (context) {
                  return Center(
                    child: Container(
                      height: 300,
                      width: 300,
                      color: Colors.blue,
                    ),
                  );
                },
                animationType: SmartAnimationType.centerFade_otherSlide,
                backDismiss: true,
                keepSingle: true,
                debounce: true,
              );
            },
            child: Container(
              width: 200,
              height: 200,
              color: Colors.red,
            ),
          ),
        ),
      ),
    );
  }
}

@git-maven
Copy link
Author

git-maven commented May 25, 2024

  • 发现在使用GestureDetector的时候才会出现这种问题,我换了FloatingActionButton就正常了
class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      builder: FlutterSmartDialog.init(),
      navigatorObservers: [
        FlutterSmartDialog.observer
      ],
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: Scaffold(
        body: Center(
          child: FloatingActionButton(
            onPressed:(){
              SmartDialog.show(
                tag: '11',
                builder: (context) {
                  return Center(
                    child: Container(
                      height: 300,
                      width: 300,
                      color: Colors.red,
                    ),
                  );
                },
                animationType: SmartAnimationType.centerFade_otherSlide,
                backDismiss: true,
                keepSingle: true,
                debounce: true,
              );
            },
            tooltip: 'Increment',
            child: const Icon(Icons.add),
          ),
        ),
      ),
    );
  }
  void _incrementCounter() {
    SmartDialog.show(
      tag: '11',
      builder: (context) {
        return Center(
          child: Container(
            height: 300,
            width: 300,
            color: Colors.red,
          ),
        );
      },
      animationType: SmartAnimationType.centerFade_otherSlide,
      backDismiss: true,
      keepSingle: true,
      debounce: true,
    );
    return;
  }
}

@git-maven
Copy link
Author

15_1716604956.mp4

问题视频

@xdd666t
Copy link
Member

xdd666t commented May 25, 2024

  • 试试新版本
dependencies:
  flutter_smart_dialog: ^4.9.7+6

@xdd666t xdd666t self-assigned this May 25, 2024
xdd666t added a commit that referenced this issue May 25, 2024
@xdd666t xdd666t added the bug Something isn't working label May 25, 2024
@git-maven
Copy link
Author

  • 试试新版本
dependencies:
  flutter_smart_dialog: ^4.9.7+5

dialog正常,我今天看看能不能复现toast那个bug

@xdd666t
Copy link
Member

xdd666t commented Jun 1, 2024

  • 后续需使用最新版本, 这个先关了, 后续再有问题, 描述清楚, 可重开一个issue
dependencies:
  flutter_smart_dialog: ^4.9.7+7

@xdd666t xdd666t closed this as completed Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants