Skip to content

Commit

Permalink
fix: 로그인 관련 문제 수정
Browse files Browse the repository at this point in the history
- 수동 로그인 시 Route 이동이 동시에 여러번 일어나 발생했던 성능 하락 및 Progress 문제 수정

Signed-off-by: HeeRyun, Jin(qwertycvb) <[email protected]>
  • Loading branch information
SerenityS committed Apr 18, 2024
1 parent ca1c78f commit b861326
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 56 deletions.
4 changes: 1 addition & 3 deletions lib/presentation/login/views/login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ class LoginPage extends GetView<LoginViewModel> {
}

Future<void> _login() async {
if (await controller.login()) {
Get.offAllNamed("${RoutePath.home}?index=$drawerIndex");
}
await controller.login();
}
}
95 changes: 42 additions & 53 deletions lib/presentation/play_data/views/my_data_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,61 +48,50 @@ class _PlayerPlateCard extends GetView<MyDataViewModel> {

@override
Widget build(BuildContext context) {
return Obx(() {
return Container(
width: double.maxFinite,
margin: EdgeInsets.symmetric(horizontal: 12.w, vertical: 8.w),
padding: EdgeInsets.all(8.w),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(8.r), color: AppColor.cardSecondary),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: controller.isPlateLoading.value
? [
Padding(
padding: EdgeInsets.all(4.w),
child: PIULoading(
"클리어 정보를 불러오는 중...(${PlayDataService.to.currentLoadingPageIndex}/${PlayDataService.to.totalPageIndex})",
),
)
]
: [
Padding(
padding: EdgeInsets.all(4.w),
child: Text(
"Plate Data",
style: TextStyle(color: Colors.white, fontSize: 24.sp, fontWeight: FontWeight.bold, fontFamily: 'Oxanium'),
),
),
Obx(() {
if (controller.isLoading.value) {
PIULoading("플레이트 정보를 불러오는 중...(${PlayDataService.to.currentLoadingPageIndex}/${PlayDataService.to.totalPageIndex})");
} else if (controller.clearDataList.isEmpty) {
return Center(
child: Text(
"플레이트 정보가 없습니다.\n게임을 플레이해주세요.",
style: TextStyle(fontSize: 16.sp, fontWeight: FontWeight.w500),
),
);
}
return Container(
width: double.maxFinite,
margin: EdgeInsets.symmetric(horizontal: 12.w, vertical: 8.w),
padding: EdgeInsets.all(8.w),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(8.r), color: AppColor.cardSecondary),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.all(4.w),
child: Text(
"Plate Data",
style: TextStyle(color: Colors.white, fontSize: 24.sp, fontWeight: FontWeight.bold, fontFamily: 'Oxanium'),
),
),
Obx(() {
if (controller.isPlateLoading.value) {
return PIULoading("플레이트 정보를 불러오는 중...(${PlayDataService.to.currentLoadingPageIndex}/${PlayDataService.to.totalPageIndex})");
} else if (controller.clearDataList.isEmpty) {
return Center(
child: Text(
"플레이트 정보가 없습니다.\n게임을 플레이해주세요.",
style: TextStyle(fontSize: 16.sp, fontWeight: FontWeight.w500),
),
);
}

return GridView.builder(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2),
padding: EdgeInsets.zero,
itemCount: PlateType.values.length,
itemBuilder: (context, index) {
final PlateType plateType = PlateType.values[index];
final List<ChartData> clearDataList = controller.clearDataList.where((p0) => p0.plateType == plateType).toList();
return GridView.builder(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2),
padding: EdgeInsets.zero,
itemCount: PlateType.values.length,
itemBuilder: (context, index) {
final PlateType plateType = PlateType.values[index];
final List<ChartData> clearDataList = controller.clearDataList.where((p0) => p0.plateType == plateType).toList();

return _PlateDetailCard(clearDataList, plateType);
},
);
}),
],
),
);
});
return _PlateDetailCard(clearDataList, plateType);
},
);
}),
],
),
);
}
}

Expand Down

0 comments on commit b861326

Please sign in to comment.