style: apply dart format across project
This commit is contained in:
@@ -18,7 +18,7 @@ class AppNavigator {
|
||||
HapticFeedback.lightImpact();
|
||||
final navigationProvider = context.read<NavigationProvider>();
|
||||
navigationProvider.clearHistoryAndGoHome();
|
||||
|
||||
|
||||
await Navigator.of(context).pushNamedAndRemoveUntil(
|
||||
AppRoutes.main,
|
||||
(route) => false,
|
||||
@@ -30,22 +30,23 @@ class AppNavigator {
|
||||
HapticFeedback.lightImpact();
|
||||
final navigationProvider = context.read<NavigationProvider>();
|
||||
navigationProvider.updateCurrentIndex(1);
|
||||
|
||||
|
||||
await Navigator.of(context).pushNamed(AppRoutes.analysis);
|
||||
}
|
||||
|
||||
/// 구독 추가 화면으로 네비게이션
|
||||
static Future<void> toAddSubscription(BuildContext context) async {
|
||||
HapticFeedback.mediumImpact();
|
||||
|
||||
|
||||
await Navigator.of(context).pushNamed(AppRoutes.addSubscription);
|
||||
}
|
||||
|
||||
/// 구독 상세 화면으로 네비게이션
|
||||
static Future<void> toDetail(BuildContext context, SubscriptionModel subscription) async {
|
||||
static Future<void> toDetail(
|
||||
BuildContext context, SubscriptionModel subscription) async {
|
||||
print('AppNavigator.toDetail 호출됨: ${subscription.serviceName}');
|
||||
HapticFeedback.lightImpact();
|
||||
|
||||
|
||||
try {
|
||||
await Navigator.of(context).pushNamed(
|
||||
AppRoutes.subscriptionDetail,
|
||||
@@ -62,7 +63,7 @@ class AppNavigator {
|
||||
HapticFeedback.lightImpact();
|
||||
final navigationProvider = context.read<NavigationProvider>();
|
||||
navigationProvider.updateCurrentIndex(3);
|
||||
|
||||
|
||||
await Navigator.of(context).pushNamed(AppRoutes.smsScanner);
|
||||
}
|
||||
|
||||
@@ -71,14 +72,14 @@ class AppNavigator {
|
||||
HapticFeedback.lightImpact();
|
||||
final navigationProvider = context.read<NavigationProvider>();
|
||||
navigationProvider.updateCurrentIndex(4);
|
||||
|
||||
|
||||
await Navigator.of(context).pushNamed(AppRoutes.settings);
|
||||
}
|
||||
|
||||
/// 카테고리 관리 화면으로 네비게이션
|
||||
static Future<void> toCategoryManagement(BuildContext context) async {
|
||||
HapticFeedback.lightImpact();
|
||||
|
||||
|
||||
await Navigator.of(context).push(
|
||||
SlidePageRoute(
|
||||
page: const CategoryManagementScreen(),
|
||||
@@ -101,20 +102,20 @@ class AppNavigator {
|
||||
static Future<bool> handleBackButton(BuildContext context) async {
|
||||
final navigator = Navigator.of(context);
|
||||
final navigationProvider = context.read<NavigationProvider>();
|
||||
|
||||
|
||||
// 네비게이션 스택이 있으면 팝
|
||||
if (navigator.canPop()) {
|
||||
HapticFeedback.lightImpact();
|
||||
|
||||
|
||||
// NavigationProvider의 히스토리를 사용하여 이전 인덱스로 복원
|
||||
if (navigationProvider.canPop()) {
|
||||
navigationProvider.pop();
|
||||
}
|
||||
|
||||
|
||||
navigator.pop();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// 앱 종료 확인
|
||||
final shouldExit = await showDialog<bool>(
|
||||
context: context,
|
||||
@@ -133,7 +134,7 @@ class AppNavigator {
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
return shouldExit ?? false;
|
||||
}
|
||||
|
||||
@@ -141,17 +142,17 @@ class AppNavigator {
|
||||
static void handleFloatingNavTap(BuildContext context, int index) {
|
||||
final navigationProvider = context.read<NavigationProvider>();
|
||||
final currentIndex = navigationProvider.currentIndex;
|
||||
|
||||
|
||||
// 같은 탭을 다시 탭하면 아무 동작 안 함
|
||||
if (currentIndex == index) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// 현재 화면이 메인이 아니면 먼저 메인으로 돌아가기
|
||||
if (Navigator.of(context).canPop()) {
|
||||
Navigator.of(context).popUntil((route) => route.isFirst);
|
||||
}
|
||||
|
||||
|
||||
// 선택된 인덱스에 따라 네비게이션
|
||||
switch (index) {
|
||||
case 0: // 홈
|
||||
@@ -196,6 +197,7 @@ class AppNavigationObserver extends NavigatorObserver {
|
||||
@override
|
||||
void didReplace({Route<dynamic>? newRoute, Route<dynamic>? oldRoute}) {
|
||||
super.didReplace(newRoute: newRoute, oldRoute: oldRoute);
|
||||
debugPrint('Navigation: Replace ${oldRoute?.settings.name} with ${newRoute?.settings.name}');
|
||||
debugPrint(
|
||||
'Navigation: Replace ${oldRoute?.settings.name} with ${newRoute?.settings.name}');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user