Skip to content

Commit 8318202

Browse files
committed
修复平板布局下分组编辑问题
1 parent 32789e5 commit 8318202

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

lib/pages/tab/controller/group/custom_tabbar_controller.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,10 @@ class CustomTabbarController extends DefaultTabViewController {
176176
logger.d('topRoute $topRoute');
177177

178178
// 依赖注入
179-
// Get.replace<CustomProfile>(
180-
// profileMap[uuid] ?? CustomProfile(name: '', uuid: generateUuidv4()));
179+
Get.replace<CustomProfile>(
180+
profileMap[uuid] ?? CustomProfile(name: '', uuid: generateUuidv4()));
181+
182+
// arguments 方式不能跨栈传递,改回依赖注入
181183

182184
late final dynamic _result;
183185

@@ -186,14 +188,14 @@ class CustomTabbarController extends DefaultTabViewController {
186188
EHRoutes.customProfileSetting,
187189
id: isLayoutLarge ? 2 : null,
188190
preventDuplicates: false,
189-
arguments: profileMap[uuid],
191+
// arguments: profileMap[uuid],
190192
);
191193
} else {
192194
_result = await Get.toNamed(
193195
EHRoutes.customProfileSetting,
194196
id: isLayoutLarge ? 2 : null,
195197
preventDuplicates: false,
196-
arguments: profileMap[uuid],
198+
// arguments: profileMap[uuid],
197199
);
198200
}
199201

lib/pages/tab/view/tabbar/custom_profile_setting_page.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,14 @@ class _CustomProfileSettingPageState extends State<CustomProfileSettingPage> {
4747

4848
Get.put(ProfileEditController());
4949

50-
_customProfile = Get.arguments is CustomProfile
51-
? Get.arguments as CustomProfile
52-
: CustomProfile(name: '', uuid: generateUuidv4());
50+
logger.d('Get.arguments runtimeType ${Get.arguments.runtimeType}');
51+
52+
// _customProfile = Get.arguments is CustomProfile
53+
// ? Get.arguments as CustomProfile
54+
// : CustomProfile(name: '', uuid: generateUuidv4());
55+
56+
// arguments 方式不能跨栈传递,改回依赖注入
57+
_customProfile = Get.find<CustomProfile>();
5358

5459
_searchWithMinRating.value =
5560
_customProfile.advSearch?.searchWithMinRating ?? false;

lib/route/app_pages.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ class AppPages {
516516
return GetPageRoute(
517517
settings: settings,
518518
page: () => const CustomProfileSettingPage(),
519+
transition: Transition.fadeIn,
519520
);
520521
case EHRoutes.license:
521522
return GetPageRoute(

0 commit comments

Comments
 (0)