Skip to content

Commit

Permalink
v0.1.2 のリリース (#103)
Browse files Browse the repository at this point in the history
* ✨ add policy link

* 🩹 fix lint
  • Loading branch information
rikeda71 authored Feb 26, 2023
1 parent 5c101f2 commit 6411b72
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 2 deletions.
5 changes: 4 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ android {
// https://firebase.google.com/docs/android/setup?hl=ja#register-app => 31
// 2022/10現在、最新のバージョン(Android13)
compileSdkVersion 33
ndkVersion flutter.ndkVersion
ndkVersion "25.2.9519653"

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down Expand Up @@ -132,6 +132,9 @@ android {
buildTypes {
release {
signingConfig signingConfigs.release
ndk {
debugSymbolLevel 'SYMBOL_TABLE'
}
}
}
}
Expand Down
48 changes: 48 additions & 0 deletions lib/ui/pages/settings/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:settings_ui/settings_ui.dart';
import 'package:virtualpilgrimage/ui/components/bottom_navigation.dart';
import 'package:virtualpilgrimage/ui/components/my_app_bar.dart';
import 'package:virtualpilgrimage/ui/pages/settings/settings_presenter.dart';
import 'package:webview_flutter/webview_flutter.dart';

class SettingsPage extends ConsumerWidget {
const SettingsPage({super.key});
Expand All @@ -21,6 +22,8 @@ class SettingsPage extends ConsumerWidget {
class _SettingsPageBody extends StatelessWidget {
const _SettingsPageBody(this._ref);

static const policyUrl = 'https://courageous-gumption-d7fd12.netlify.app/policy/';

final WidgetRef _ref;

@override
Expand Down Expand Up @@ -70,6 +73,14 @@ class _SettingsPageBody extends StatelessWidget {
SettingsSection(
title: const Text('その他'),
tiles: <SettingsTile>[
SettingsTile(
leading: const Icon(Icons.account_circle_outlined),
title: const Text('プライバシーポリシー'),
onPressed: (BuildContext context) => Navigator.push(
context,
MaterialPageRoute<dynamic>(builder: (context) => _PolicyWebView(url: policyUrl)),
),
),
SettingsTile(
leading: const Icon(Icons.mail_outline),
title: const Text('問い合わせ'),
Expand All @@ -82,3 +93,40 @@ class _SettingsPageBody extends StatelessWidget {
);
}
}

class _PolicyWebView extends StatelessWidget {
_PolicyWebView({required this.url}) {
controller = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
..setBackgroundColor(const Color(0x00000000))
..setNavigationDelegate(
NavigationDelegate(
onProgress: (int progress) {
// Update loading bar.
},
onPageStarted: (String url) {},
onPageFinished: (String url) {},
onWebResourceError: (WebResourceError error) {},
onNavigationRequest: (NavigationRequest request) {
if (request.url.startsWith(url)) {
return NavigationDecision.prevent;
}
return NavigationDecision.navigate;
},
),
)
..loadRequest(Uri.parse(url));
}

final String url;

late final WebViewController controller;

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: const MyAppBar(),
body: SafeArea(child: WebViewWidget(controller: controller)),
);
}
}
28 changes: 28 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,34 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
webview_flutter:
dependency: "direct main"
description:
name: webview_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.5"
webview_flutter_android:
dependency: transitive
description:
name: webview_flutter_android
url: "https://pub.dartlang.org"
source: hosted
version: "3.3.1"
webview_flutter_platform_interface:
dependency: transitive
description:
name: webview_flutter_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
webview_flutter_wkwebview:
dependency: transitive
description:
name: webview_flutter_wkwebview
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.1"
win32:
dependency: transitive
description:
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 0.1.1+3
version: 0.1.2+4

environment:
sdk: ">=2.17.6 <3.0.0"
Expand Down Expand Up @@ -60,6 +60,7 @@ dependencies:
maps_toolkit: ^2.0.1
package_info: ^2.0.2
url_launcher: ^6.1.7
webview_flutter: ^4.0.5

# ui
google_maps_flutter: ^2.2.1
Expand Down

0 comments on commit 6411b72

Please sign in to comment.