feat(proj): init
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:please_pay_me/core/config/app_config.dart';
|
||||
import 'package:please_pay_me/core/config/env_file.dart';
|
||||
import 'package:please_pay_me/ui/ui.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
abstract final class LegalLinks {
|
||||
static const offer = '/legal/offer';
|
||||
static const privacy = '/legal/privacy';
|
||||
static const consent = '/legal/consent';
|
||||
static const cookies = '/legal/cookies';
|
||||
|
||||
static Uri resolve(String cabinetUrl, String path) {
|
||||
final base = cabinetUrl.isEmpty ? AppConfig.productionOrigin : cabinetUrl;
|
||||
return Uri.parse('${normalizeUrl(base)}$path');
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> openLegalDocument(BuildContext context, Uri uri) async {
|
||||
final opened = await launchUrl(uri, mode: LaunchMode.externalApplication);
|
||||
if (!opened && context.mounted) {
|
||||
await showAppToast(context, message: 'Не удалось открыть документ');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user