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

多个实例加载时报错 #46

Closed
wishinlife opened this issue May 5, 2021 · 1 comment
Closed

多个实例加载时报错 #46

wishinlife opened this issue May 5, 2021 · 1 comment

Comments

@wishinlife
Copy link

主页用IndexedStack同时加载多个页面,当有两个或以上页面使用此插件时报错:
======== Exception caught by widgets library =======================================================
The following LateError was thrown building GZXDropDownMenu(dirty, dependencies: [_EffectiveTickerMode, MediaQuery], state: _GZXDropDownMenuState#f2693(ticker inactive)):
LateInitializationError: Field '_maskColorOpacity@969011985' has not been initialized.

The relevant error-causing widget was:
GZXDropDownMenu file:///D:/Sky-Eye/code/skyeye-app-flutter/trunk/lib/page/home/tab_alert.dart:393:15
When the exception was thrown, this was the stack:
#0 _GZXDropDownMenuState._maskColorOpacity (package:gzx_dropdown_menu/src/gzx_dropdown_menu.dart)
#1 _GZXDropDownMenuState._mask (package:gzx_dropdown_menu/src/gzx_dropdown_menu.dart:176:47)
#2 _GZXDropDownMenuState._buildDropDownWidget (package:gzx_dropdown_menu/src/gzx_dropdown_menu.dart:206:13)
#3 _GZXDropDownMenuState.build (package:gzx_dropdown_menu/src/gzx_dropdown_menu.dart:86:12)
#4 StatefulElement.build (package:flutter/src/widgets/framework.dart:4612:27)

每个页面的key和GZXDropdownMenuController都是独立的,不知道为什么报这个错误。

@wishinlife
Copy link
Author

找到原因了,是我在切换页面时调用_dropdownMenuController.hide();没有判断是否已显示造成的。

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

No branches or pull requests

1 participant