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

SmartDialog.show<T>指定范型为非空类型时,点击空白处关闭弹窗报错 #105

Closed
moxiaov587 opened this issue Feb 8, 2023 · 1 comment · Fixed by #106
Closed

Comments

@moxiaov587
Copy link
Contributor

版本信息

  • Flutter版本:v3.7.0
  • flutter_smart_dialog版本:v4.8.2+3

描述bug

SmartDialog.show<T>指定范型为非空类型时,点击空白处关闭弹窗报错

E/flutter (30979): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'Null' is not a subtype of type 'FutureOr<bool>'
E/flutter (30979): #0      _AsyncCompleter.complete (dart:async/future_impl.dart:36:41)
E/flutter (30979): #1      MainDialog._handleAwaitOver
main_dialog.dart:183
E/flutter (30979): #2      MainDialog.dismiss
main_dialog.dart:207
E/flutter (30979): <asynchronous suspension>
E/flutter (30979): #3      CustomDialog._closeSingle
custom_dialog.dart:396
E/flutter (30979): <asynchronous suspension>

问题demo

void _show() async {
    SmartDialog.show<bool>(builder: (_) { // 添加范型并指定为bool
      return Container(
        height: 80,
        width: 180,
        decoration: BoxDecoration(
          color: Colors.black,
          borderRadius: BorderRadius.circular(10),
        ),
        alignment: Alignment.center,
        child: Text(
          'easy custom dialog',
          style: TextStyle(color: Colors.white),
        ),
      );
    });
  }
@xdd666t
Copy link
Member

xdd666t commented Feb 8, 2023

  • 新版本发布了哈
dependencies:
  flutter_smart_dialog: ^4.8.2+4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants