prasule/lib/util/utils.dart

43 lines
1.2 KiB
Dart
Raw Normal View History

2024-06-30 20:25:36 +02:00
// SPDX-FileCopyrightText: (C) 2024 Matyáš Caras
//
// SPDX-License-Identifier: AGPL-3.0-only
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:prasule/pw/platformbutton.dart';
import 'package:url_launcher/url_launcher_string.dart';
/// Shows an [AboutDialog] with all the data filled,
/// so I don't have to copypaste the same function everywhere
void showAbout(BuildContext context) {
showAboutDialog(
context: context,
applicationLegalese: AppLocalizations.of(context).license,
applicationName: "Prašule",
2024-04-22 17:03:51 +02:00
applicationVersion: "1.1.1",
applicationIcon: const CircleAvatar(
backgroundImage: AssetImage("assets/icon/full_ico.png"),
),
children: [
PlatformButton(
text: "Tessdata",
onPressed: () {
unawaited(
launchUrlString(
"https://github.com/tesseract-ocr/tessdata_fast",
),
);
},
),
PlatformButton(
text: AppLocalizations.of(context).sourceCode,
onPressed: () {
unawaited(launchUrlString("https://git.mnau.xyz/hernik/prasule"));
},
),
],
);
}