update for permission and destination ordering
This commit is contained in:
@ -11,6 +11,7 @@ class PermissionHandlerScreen extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _PermissionHandlerScreenState extends State<PermissionHandlerScreen> {
|
||||
|
||||
|
||||
Future<void> _showMyDialog() async {
|
||||
return showDialog<void>(
|
||||
@ -45,10 +46,15 @@ class _PermissionHandlerScreenState extends State<PermissionHandlerScreen> {
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
permissionServiceCall();
|
||||
|
||||
//permissionServiceCall();
|
||||
}
|
||||
|
||||
permissionServiceCall() async {
|
||||
Future<PermissionStatus> checkLocationPermission() async {
|
||||
return await Permission.location.status;
|
||||
}
|
||||
|
||||
permissionServiceCall() async {
|
||||
await permissionServices().then(
|
||||
(value) {
|
||||
if (value != null) {
|
||||
@ -106,11 +112,45 @@ class _PermissionHandlerScreenState extends State<PermissionHandlerScreen> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
child: Center(
|
||||
child: Text(""),
|
||||
),
|
||||
var status = Permission.location.status.then((value){
|
||||
if(value.isGranted == false){
|
||||
Future.delayed(Duration.zero, () => showAlert(context));
|
||||
}
|
||||
else {
|
||||
Get.toNamed(AppPages.TRAVEL);
|
||||
}
|
||||
});
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
child: Text(""),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void showAlert(BuildContext context) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) => AlertDialog(
|
||||
title: const Text('ロケーション許可'),
|
||||
content: SingleChildScrollView(
|
||||
child: ListBody(
|
||||
children: const <Widget>[
|
||||
Text( 'このアプリでは、位置情報の収集を行います。'),
|
||||
Text('岐阜ナビアプリではチェックポイントの自動チェックインの機能を可能にするために、現在地のデータが収集されます。アプリを閉じている時や、使用していないときにも収集されます。位置情報は、個人を特定できない統計的な情報として、ユーザーの個人情報とは一切結びつかない形で送信されます。お知らせの配信、位置情報の利用を許可しない場合は、この後表示されるダイアログで「許可しない」を選択してください。'),
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
child: const Text('わかった'),
|
||||
onPressed: () {
|
||||
permissionServiceCall();
|
||||
},
|
||||
),
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user