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

在封装的库中引入flutter_smart_dialog,之后在项目中引入封装的库 flutter_smart_dialog 报错 #133

Closed
WoNiu456 opened this issue Jun 3, 2023 · 1 comment
Assignees
Labels
unread document Documentation explained, unread documentation

Comments

@WoNiu456
Copy link

WoNiu456 commented Jun 3, 2023

版本信息

  • Flutter版本:3.7.12
  • flutter_smart_dialog版本:^4.9.0+6

描述bug/需求

在我自己封装的登录界面库里,引入了 flutter_smart_dialog ,然后在我的测试项目中引入我的登录库,在
SmartDialog.showLoading(backDismiss: false,maskColor: Tool.translucentGrey,msg: '');
时报错
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: LateInitializationError: Field '_loading@637397047' has not been initialized.
E/flutter (12630): #0 DialogProxy._loading (package:flutter_smart_dialog/src/helper/dialog_proxy.dart)
E/flutter (12630): #1 DialogProxy.showLoading (package:flutter_smart_dialog/src/helper/dialog_proxy.dart:282:12)
E/flutter (12630): #2 SmartDialog.showLoading (package:flutter_smart_dialog/src/smart_dialog.dart:716:33)
E/flutter (12630): #3 Hud.showLoading (package:login/utils/Hud.dart:21:17)
E/flutter (12630): #4 PasswordProvider.getImage (package:login/password/password_provider.dart:32:9)

直接运行我的库 flutter_smart_dialog 是正常的,在另一个项目中引入我的库,flutter_smart_dialog 就出现了这个问题。

问题demo

class Hud {

Hud._internal();

factory Hud() => _instance;

static final Hud _instance = Hud._internal();

static showToast(String msg){
SmartDialog.showToast(msg,alignment: Alignment.center,displayType: SmartToastType.last);
}

static showLoading(){
SmartDialog.showLoading(backDismiss: false,maskColor: Tool.translucentGrey,msg: '');
}

static dismissLoading(){
SmartDialog.dismiss();
}

}

@xdd666t
Copy link
Member

xdd666t commented Jun 4, 2023

image

@xdd666t xdd666t self-assigned this Jun 4, 2023
@xdd666t xdd666t added the unread document Documentation explained, unread documentation label Jun 4, 2023
@WoNiu456 WoNiu456 closed this as completed Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unread document Documentation explained, unread documentation
Projects
None yet
Development

No branches or pull requests

2 participants