-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from yumemi-inc/feature/add-license
feat(setting): ライセンスページを追加
- Loading branch information
Showing
21 changed files
with
245 additions
and
29 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...p/lib/feature/home/ui/home_navigator.dart → .../lib/router/navigator/home_navigator.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import 'package:cores_navigation/navigators.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_app/router/routes/home_route.dart'; | ||
import 'package:flutter_app/router/routes/setting_route.dart'; | ||
|
||
final class SettingNavigatorImpl implements SettingNavigator { | ||
const SettingNavigatorImpl(); | ||
|
||
@override | ||
void goLicensePage(BuildContext context) { | ||
const LicensePageRoute().go(context); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import 'package:cores_navigation/providers.dart'; | ||
import 'package:features_setting/setting.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_app/router/navigator/setting_navigator.dart'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:go_router/go_router.dart'; | ||
|
||
const settingPageRoute = TypedGoRoute<SettingPageRoute>( | ||
path: SettingPageRoute.path, | ||
routes: [ | ||
TypedGoRoute<LicensePageRoute>( | ||
path: LicensePageRoute.path, | ||
), | ||
], | ||
); | ||
|
||
final class SettingPageRoute extends GoRouteData { | ||
const SettingPageRoute(); | ||
|
||
static const path = 'setting'; | ||
|
||
@override | ||
Widget build(BuildContext context, GoRouterState state) { | ||
return ProviderScope( | ||
overrides: [ | ||
settingNavigatorProvider.overrideWithValue( | ||
const SettingNavigatorImpl(), | ||
), | ||
], | ||
child: const SettingPage(), | ||
); | ||
} | ||
} | ||
|
||
final class LicensePageRoute extends GoRouteData { | ||
const LicensePageRoute(); | ||
|
||
static const path = 'license'; | ||
|
||
@override | ||
Widget build(BuildContext context, GoRouterState state) { | ||
return const LicensePage(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export 'src/home/navigator.dart'; | ||
export 'src/setting/navigator.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export 'src/home/provider.dart'; | ||
export 'src/setting/provider.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
abstract interface class SettingNavigator { | ||
void goLicensePage(BuildContext context); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import 'package:cores_navigation/src/setting/navigator.dart'; | ||
import 'package:riverpod_annotation/riverpod_annotation.dart'; | ||
|
||
part 'provider.g.dart'; | ||
|
||
@riverpod | ||
external SettingNavigator settingNavigator(SettingNavigatorRef ref); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
{ | ||
"settingAppBar": "Setting", | ||
"settingThemeSetting": "Theme Setting" | ||
"settingAppBar": "Setting", | ||
"settingThemeSetting": "Theme Setting", | ||
"settingAbout": "About FlutterMobileTemplate", | ||
"settingOpenSourceLicenses": "Open source licenses", | ||
"settingLibrariesWeUse": "Libraries we use" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
{ | ||
"settingAppBar": "設定", | ||
"settingThemeSetting": "テーマ設定" | ||
"settingAppBar": "設定", | ||
"settingThemeSetting": "テーマ設定", | ||
"settingAbout": "FlutterMobileTemplate について", | ||
"settingOpenSourceLicenses": "オープンソースライセンス", | ||
"settingLibrariesWeUse": "使用しているライブラリ" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export 'setting_section_spacer.dart'; | ||
export 'setting_section_title.dart'; |
16 changes: 16 additions & 0 deletions
16
packages/features/setting/lib/src/ui/components/setting_section_spacer.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
/// [SettingSectionSpacer] is a widget that represents the space for | ||
/// each section of the settings screen. | ||
final class SettingSectionSpacer extends StatelessWidget { | ||
const SettingSectionSpacer({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const SliverPadding( | ||
padding: EdgeInsets.only( | ||
bottom: 16, | ||
), | ||
); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
packages/features/setting/lib/src/ui/components/setting_section_title.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
/// [SettingSectionTitle] is a widget that represents the section title of | ||
/// the settings screen. | ||
final class SettingSectionTitle extends StatelessWidget { | ||
/// You can set the text to be displayed as the title in [text]. | ||
const SettingSectionTitle({ | ||
required String text, | ||
super.key, | ||
}) : _text = text; | ||
|
||
final String _text; | ||
|
||
@override | ||
Widget build(BuildContext context) => SliverPadding( | ||
padding: const EdgeInsets.symmetric( | ||
vertical: 16, | ||
horizontal: 24, | ||
), | ||
sliver: SliverToBoxAdapter( | ||
child: Text(_text), | ||
), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters