mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-23 10:11:52 +03:00
refactor with updated urls
This commit is contained in:
parent
8e4e38f239
commit
d203a6a00f
@ -21,17 +21,17 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
|
||||||
|
|
||||||
|
import 'android/state.dart';
|
||||||
|
import 'app/app_url_launcher.dart';
|
||||||
import 'app/logging.dart';
|
import 'app/logging.dart';
|
||||||
import 'app/message.dart';
|
import 'app/message.dart';
|
||||||
import 'app/state.dart';
|
import 'app/state.dart';
|
||||||
import 'core/state.dart';
|
import 'core/state.dart';
|
||||||
import 'android/state.dart';
|
|
||||||
import 'desktop/state.dart';
|
import 'desktop/state.dart';
|
||||||
import 'version.dart';
|
import 'version.dart';
|
||||||
import 'widgets/responsive_dialog.dart';
|
|
||||||
import 'widgets/choice_filter_chip.dart';
|
import 'widgets/choice_filter_chip.dart';
|
||||||
|
import 'widgets/responsive_dialog.dart';
|
||||||
|
|
||||||
final _log = Logger('about');
|
final _log = Logger('about');
|
||||||
|
|
||||||
@ -70,11 +70,7 @@ class AboutPage extends ConsumerWidget {
|
|||||||
const TextStyle(decoration: TextDecoration.underline),
|
const TextStyle(decoration: TextDecoration.underline),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
launchUrl(
|
launchTermsUrl();
|
||||||
Uri.parse(
|
|
||||||
'https://www.yubico.com/support/terms-conditions/yubico-license-agreement/'),
|
|
||||||
mode: LaunchMode.externalApplication,
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
@ -84,11 +80,7 @@ class AboutPage extends ConsumerWidget {
|
|||||||
const TextStyle(decoration: TextDecoration.underline),
|
const TextStyle(decoration: TextDecoration.underline),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
launchUrl(
|
launchPrivacyUrl();
|
||||||
Uri.parse(
|
|
||||||
'https://www.yubico.com/support/terms-conditions/privacy-notice/'),
|
|
||||||
mode: LaunchMode.externalApplication,
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -128,14 +120,7 @@ class AboutPage extends ConsumerWidget {
|
|||||||
const TextStyle(decoration: TextDecoration.underline),
|
const TextStyle(decoration: TextDecoration.underline),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
launchUrl(
|
launchFeedbackUrl();
|
||||||
Platform.isAndroid
|
|
||||||
// Android Beta feedback form
|
|
||||||
? Uri.parse('https://forms.gle/2J81Kh8rnzBrtNc69')
|
|
||||||
// Desktop Beta feedback form
|
|
||||||
: Uri.parse('https://forms.gle/nYPVWcFnqoprZX1S9'),
|
|
||||||
mode: LaunchMode.externalApplication,
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
@ -145,10 +130,7 @@ class AboutPage extends ConsumerWidget {
|
|||||||
const TextStyle(decoration: TextDecoration.underline),
|
const TextStyle(decoration: TextDecoration.underline),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
launchUrl(
|
launchHelpUrl();
|
||||||
Uri.parse('https://support.yubico.com/support/home'),
|
|
||||||
mode: LaunchMode.externalApplication,
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
31
lib/app/app_url.dart
Normal file
31
lib/app/app_url.dart
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2022 Yubico.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
class AppUrl {
|
||||||
|
static final String feedbackUrl = Platform.isAndroid
|
||||||
|
? 'https://yubi.co/ya-feedback-android'
|
||||||
|
: 'https://yubi.co/ya-feedback-desktop';
|
||||||
|
|
||||||
|
static final String helpUrl = Platform.isAndroid
|
||||||
|
? 'https://yubi.co/ya-help-android'
|
||||||
|
: 'https://yubi.co/ya-help-desktop';
|
||||||
|
|
||||||
|
static String termsUrl = 'https://yubi.co/terms';
|
||||||
|
|
||||||
|
static String privacyUrl = 'https://yubi.co/privacy';
|
||||||
|
}
|
40
lib/app/app_url_launcher.dart
Normal file
40
lib/app/app_url_launcher.dart
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2022 Yubico.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
|
import 'app_url.dart';
|
||||||
|
|
||||||
|
Future<bool> _launchUrl(String url) => launchUrl(
|
||||||
|
Uri.parse(url),
|
||||||
|
mode: LaunchMode.externalApplication,
|
||||||
|
);
|
||||||
|
|
||||||
|
Future<bool> launchFeedbackUrl() async {
|
||||||
|
return _launchUrl(AppUrl.feedbackUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<bool> launchHelpUrl() async {
|
||||||
|
return _launchUrl(AppUrl.helpUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<bool> launchTermsUrl() async {
|
||||||
|
return _launchUrl(AppUrl.termsUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<bool> launchPrivacyUrl() async {
|
||||||
|
return _launchUrl(AppUrl.privacyUrl);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user