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

Feature/issue 235 navigation #255

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
fc84e36
feat: 画面遷移ページへのボタンを追加
mqkotoo Jun 12, 2024
af737dc
add: navigation_page.dartを追加
mqkotoo Jun 12, 2024
0fc158a
feat: NavigationPageへの遷移できるように準備
mqkotoo Jun 12, 2024
62939a0
feat: デバッグ画面から画面遷移を実装
mqkotoo Jun 12, 2024
1a881b1
delete: navigation_page_routeはdebug_page_routeに統合するので削除
mqkotoo Jun 13, 2024
5a00caa
rename: navigation層からdebug層に変更
mqkotoo Jun 13, 2024
9231ef4
feat: debug_routeにNavigationPageRouteを追加
mqkotoo Jun 13, 2024
4c35cb1
feat:NavigationPageへルートをDebugPageの下の階層に追加
mqkotoo Jun 13, 2024
5185d9a
fix:画面遷移に使うproviderの定義を修正
mqkotoo Jun 13, 2024
9548b7d
fix:画面遷移の関数の書き方簡潔に
mqkotoo Jun 13, 2024
cd110c3
add: page_a,page_b.dartを追加
mqkotoo Jun 13, 2024
17ff4c1
add:debug_page_routeにPageARoute,PageBRouteを追加
mqkotoo Jun 13, 2024
58354f9
feat: 画面遷移の処理を追加
mqkotoo Jun 13, 2024
b8fad7c
feat:viewページからの画面遷移実装
mqkotoo Jun 13, 2024
b65b814
fix:overrideが抜けていたので修正
mqkotoo Jun 13, 2024
1f02c3f
fix: NavigationPageとのルートの階層が間違っていたので修正
mqkotoo Jun 13, 2024
76fbf9c
fix: add const
mqkotoo Jun 13, 2024
174d98e
feat:debugページの多言語対応準備
mqkotoo Jun 13, 2024
5d5b165
feat: debugページに多言語対応をサポート
mqkotoo Jun 13, 2024
5875342
Merge branch 'main' of github.com:yumemi-inc/flutter-mobile-project-t…
mqkotoo Jun 13, 2024
6fa188d
fix: カンマつける
mqkotoo Jun 13, 2024
de1ca5f
fix:自動生成ファイルを最新に更新
mqkotoo Jun 13, 2024
c8980d5
コードフォーマット
mqkotoo Jun 13, 2024
280b14a
wip
mqkotoo Jun 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:cores_core/ui.dart';
import 'package:cores_data/theme_mode.dart';
import 'package:cores_designsystem/themes.dart';
import 'package:cores_init/provider.dart';
import 'package:features_debug_mode/l10n.dart';
import 'package:features_setting/l10n.dart';
import 'package:flutter/material.dart';
import 'package:flutter_app/app_initializer.dart';
Expand Down Expand Up @@ -61,10 +62,12 @@ class MainApp extends ConsumerWidget {
localizationsDelegates: const [
...L10n.localizationsDelegates,
...L10nSetting.localizationsDelegates,
...L10nDebug.localizationsDelegates,
],
supportedLocales: const [
...L10n.supportedLocales,
...L10nSetting.supportedLocales,
...L10nDebug.supportedLocales,
],
scaffoldMessengerKey: SnackBarManager.rootScaffoldMessengerKey,
routerConfig: ref.watch(routerProvider),
Expand Down
22 changes: 22 additions & 0 deletions apps/app/lib/router/navigator/debug_navigator.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'package:cores_navigation/navigators.dart';
import 'package:flutter/material.dart';
import 'package:flutter_app/router/provider/router.dart';

final class DebugNavigatorImpl implements DebugNavigator {
const DebugNavigatorImpl();

@override
void goNavigationPage(BuildContext context) {
const NavigationPageRoute().go(context);
}

@override
void goPageA(BuildContext context) {
const PageARoute().go(context);
}

@override
void goPageB(BuildContext context) {
const PageBRoute().go(context);
}
}
1 change: 1 addition & 0 deletions apps/app/lib/router/provider/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:features_webview/webview.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_app/main_page.dart';
import 'package:flutter_app/router/navigator/debug_navigator.dart';
import 'package:flutter_app/router/navigator/home_navigator.dart';
import 'package:flutter_app/router/navigator/setting_navigator.dart';
import 'package:flutter_app/ui/home_page.dart';
Expand Down
69 changes: 68 additions & 1 deletion apps/app/lib/router/provider/router.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 43 additions & 2 deletions apps/app/lib/router/routes/main/home/debug_page_route.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,51 @@ class DebugPageRoute extends GoRouteData {

static const path = 'debug';

static final $parentNavigatorKey = _rootNavigatorKey;
@override
Widget build(BuildContext context, GoRouterState state) {
return ProviderScope(
overrides: [
debugNavigatorProvider.overrideWithValue(const DebugNavigatorImpl()),
],
child: const DebugPage(),
);
}
}

class NavigationPageRoute extends GoRouteData {
const NavigationPageRoute();

static const path = 'navigation';

@override
Widget build(BuildContext context, GoRouterState state) {
return ProviderScope(
overrides: [
debugNavigatorProvider.overrideWithValue(const DebugNavigatorImpl()),
],
child: const NavigationPage(),
);
}
}

class PageARoute extends GoRouteData {
const PageARoute();

static const path = 'page_a';

@override
Widget build(BuildContext context, GoRouterState state) {
return const PageA();
}
}

class PageBRoute extends GoRouteData {
const PageBRoute();

static const path = 'page_b';

@override
Widget build(BuildContext context, GoRouterState state) {
return const DebugPage();
return const PageB();
}
}
13 changes: 13 additions & 0 deletions apps/app/lib/router/routes/main/home/home_shell_branch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ const homeShellBranch = TypedStatefulShellBranch<HomeShellBranch>(
),
TypedGoRoute<DebugPageRoute>(
path: DebugPageRoute.path,
routes: [
TypedGoRoute<NavigationPageRoute>(
path: NavigationPageRoute.path,
routes: [
TypedGoRoute<PageARoute>(
path: PageARoute.path,
),
TypedGoRoute<PageBRoute>(
path: PageBRoute.path,
),
],
),
],
),
TypedGoRoute<WebPageRoute>(
path: WebPageRoute.path,
Expand Down
1 change: 1 addition & 0 deletions packages/cores/navigation/lib/navigators.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export 'src/home/debug/navigator.dart';
export 'src/home/navigator.dart';
export 'src/setting/navigator.dart';
1 change: 1 addition & 0 deletions packages/cores/navigation/lib/providers.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export 'src/home/debug/provider.dart';
export 'src/home/provider.dart';
export 'src/setting/provider.dart';
7 changes: 7 additions & 0 deletions packages/cores/navigation/lib/src/home/debug/navigator.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import 'package:flutter/material.dart';

abstract interface class DebugNavigator {
void goNavigationPage(BuildContext context);
void goPageA(BuildContext context);
void goPageB(BuildContext context);
}
7 changes: 7 additions & 0 deletions packages/cores/navigation/lib/src/home/debug/provider.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import 'package:cores_navigation/src/home/debug/navigator.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'provider.g.dart';

@riverpod
external DebugNavigator debugNavigator(DebugNavigatorRef ref);
28 changes: 28 additions & 0 deletions packages/cores/navigation/lib/src/home/debug/provider.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions packages/features/debug_mode/assets/l10n/app_en.arb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"debugAppBar": "Debug Mode",
"showErrorSnackBar": "Show error SnackBar",
"enableMaintenanceMode": "Enable maintenance mode",
"enableForceUpdate": "Enable force update",
"navigation": "Go to NavigationPage",
"settingVersion": "Version",
"navigationPageAppBar": "Navigation Page",
"pageA": "Page A",
"pageB": "Page B"
}
10 changes: 10 additions & 0 deletions packages/features/debug_mode/assets/l10n/app_ja.arb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"debugAppBar": "デバッグモード",
"showErrorSnackBar": "エラーSnackBarを表示",
"enableMaintenanceMode": "メンテナンスモードを有効化",
"enableForceUpdate": "強制アップデートを有効化",
"navigation": "NavigationPageへ遷移",
"navigationPageAppBar": "画面遷移画面",
"pageA": "Page A",
"pageB": "Page B"
}
12 changes: 12 additions & 0 deletions packages/features/debug_mode/l10n.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
arb-dir: assets/l10n
output-dir: lib/src/gen/l10n
template-arb-file: app_ja.arb
output-localization-file: l10n.dart
output-class: L10nDebug
synthetic-package: false
preferred-supported-locales:
- ja
- en
header: '// ignore_for_file: type=lint'
nullable-getter: false
format: true
1 change: 1 addition & 0 deletions packages/features/debug_mode/lib/l10n.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading