Add welcome dialog (#2084)

This commit is contained in:
Imran Remtulla
2025-03-16 00:05:01 -04:00
parent 46835d0876
commit 4e43001276
27 changed files with 99 additions and 1 deletions

View File

@@ -322,6 +322,8 @@
"name": "Name", "name": "Name",
"smartname": "Name (Smart)", "smartname": "Name (Smart)",
"sortMethod": "Sort Method", "sortMethod": "Sort Method",
"welcome": "Welcome",
"documentationLinksNote": "The Obtainium GitHub page linked below contains links to videos, articles, discussions, and other resources that will help you understand how to use the app.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "Želite li ukloniti aplikaciju?", "one": "Želite li ukloniti aplikaciju?",
"other": "Želite li ukloniti aplikacije?" "other": "Želite li ukloniti aplikacije?"

View File

@@ -322,6 +322,8 @@
"name": "Název", "name": "Název",
"smartname": "Název (Smart)", "smartname": "Název (Smart)",
"sortMethod": "Metoda třídění", "sortMethod": "Metoda třídění",
"welcome": "Vítejte na",
"documentationLinksNote": "Níže odkazovaná stránka Obtainium GitHub obsahuje odkazy na videa, články, diskuse a další zdroje, které vám pomohou pochopit, jak aplikaci používat.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "Odstranit Apku?", "one": "Odstranit Apku?",
"other": "Odstranit Apky?" "other": "Odstranit Apky?"

View File

@@ -322,6 +322,8 @@
"name": "Navn", "name": "Navn",
"smartname": "Navn (Smart)", "smartname": "Navn (Smart)",
"sortMethod": "Sorteringsmetode", "sortMethod": "Sorteringsmetode",
"welcome": "Velkommen",
"documentationLinksNote": "Obtainiums GitHub-side, som der linkes til nedenfor, indeholder links til videoer, artikler, diskussioner og andre ressourcer, som kan hjælpe dig med at forstå, hvordan du bruger appen.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "Fjern app?", "one": "Fjern app?",
"other": "Fjern apps?" "other": "Fjern apps?"

View File

@@ -322,6 +322,8 @@
"name": "Name", "name": "Name",
"smartname": "Name (Smart)", "smartname": "Name (Smart)",
"sortMethod": "Sortierverfahren", "sortMethod": "Sortierverfahren",
"welcome": "Willkommen",
"documentationLinksNote": "Die unten verlinkte GitHub-Seite von Obtainium enthält Links zu Videos, Artikeln, Diskussionen und anderen Ressourcen, die Ihnen helfen werden, die Verwendung der App zu verstehen.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "App entfernen?", "one": "App entfernen?",
"other": "Apps entfernen?" "other": "Apps entfernen?"

View File

@@ -322,6 +322,8 @@
"name": "Name", "name": "Name",
"smartname": "Name (Smart)", "smartname": "Name (Smart)",
"sortMethod": "Sort Method", "sortMethod": "Sort Method",
"welcome": "Welcome",
"documentationLinksNote": "The Obtainium GitHub page linked below contains links to videos, articles, discussions, and other resources that will help you understand how to use the app.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "Forigi la aplikaĵon?", "one": "Forigi la aplikaĵon?",
"other": "Forigi la aplikaĵojn?" "other": "Forigi la aplikaĵojn?"

View File

@@ -322,6 +322,8 @@
"name": "Name", "name": "Name",
"smartname": "Name (Smart)", "smartname": "Name (Smart)",
"sortMethod": "Sort Method", "sortMethod": "Sort Method",
"welcome": "Welcome",
"documentationLinksNote": "The Obtainium GitHub page linked below contains links to videos, articles, discussions, and other resources that will help you understand how to use the app.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "Remove App?", "one": "Remove App?",
"other": "Remove Apps?" "other": "Remove Apps?"

View File

@@ -322,6 +322,8 @@
"name": "Nombre", "name": "Nombre",
"smartname": "Nombre (Smart)", "smartname": "Nombre (Smart)",
"sortMethod": "Método de clasificación", "sortMethod": "Método de clasificación",
"welcome": "Bienvenido",
"documentationLinksNote": "La página GitHub de Obtainium enlazada a continuación contiene enlaces a vídeos, artículos, debates y otros recursos que te ayudarán a entender cómo utilizar la aplicación.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "¿Eliminar aplicación?", "one": "¿Eliminar aplicación?",
"other": "¿Eliminar aplicaciones?" "other": "¿Eliminar aplicaciones?"

View File

@@ -322,6 +322,8 @@
"name": "Name", "name": "Name",
"smartname": "Name (Smart)", "smartname": "Name (Smart)",
"sortMethod": "Sort Method", "sortMethod": "Sort Method",
"welcome": "Welcome",
"documentationLinksNote": "The Obtainium GitHub page linked below contains links to videos, articles, discussions, and other resources that will help you understand how to use the app.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "برنامه حذف شود؟", "one": "برنامه حذف شود؟",
"other": "برنامه ها حذف شوند؟" "other": "برنامه ها حذف شوند؟"

View File

@@ -322,6 +322,8 @@
"name": "Nom", "name": "Nom",
"smartname": "Nom (Smart)", "smartname": "Nom (Smart)",
"sortMethod": "Méthode de tri", "sortMethod": "Méthode de tri",
"welcome": "Bienvenue",
"documentationLinksNote": "La page GitHub d'Obtainium, dont le lien figure ci-dessous, contient des liens vers des vidéos, des articles, des discussions et d'autres ressources qui vous aideront à comprendre comment utiliser l'application.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "Supprimer l'application ?", "one": "Supprimer l'application ?",
"other": "Supprimer les applications ?" "other": "Supprimer les applications ?"

View File

@@ -322,6 +322,8 @@
"name": "Név", "name": "Név",
"smartname": "Név (Okos)", "smartname": "Név (Okos)",
"sortMethod": "Rendezési eljárás", "sortMethod": "Rendezési eljárás",
"welcome": "Üdvözöljük",
"documentationLinksNote": "Az alább linkelt Obtainium GitHub oldal videókra, cikkekre, beszélgetésekre és egyéb forrásokra mutató linkeket tartalmaz, amelyek segítenek megérteni az alkalmazás használatát.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "Eltávolítja az alkalmazást?", "one": "Eltávolítja az alkalmazást?",
"other": "Eltávolítja az alkalmazásokat?" "other": "Eltávolítja az alkalmazásokat?"

View File

@@ -322,6 +322,8 @@
"name": "Nama", "name": "Nama",
"smartname": "Nama (Cerdas)", "smartname": "Nama (Cerdas)",
"sortMethod": "Metode Penyortiran", "sortMethod": "Metode Penyortiran",
"welcome": "Selamat datang.",
"documentationLinksNote": "Halaman GitHub Obtainium yang ditautkan di bawah ini berisi tautan ke video, artikel, diskusi, dan sumber daya lain yang akan membantu Anda memahami cara menggunakan aplikasi.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "Hapus aplikasi?", "one": "Hapus aplikasi?",
"other": "Hapus aplikasi?" "other": "Hapus aplikasi?"

View File

@@ -322,6 +322,8 @@
"name": "Nome", "name": "Nome",
"smartname": "Nome (intelligente)", "smartname": "Nome (intelligente)",
"sortMethod": "Metodo di ordinamento", "sortMethod": "Metodo di ordinamento",
"welcome": "Benvenuti",
"documentationLinksNote": "La pagina GitHub di Obtainium collegata qui sotto contiene collegamenti a video, articoli, discussioni e altre risorse che vi aiuteranno a capire come utilizzare l'applicazione.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "Rimuovere l'app?", "one": "Rimuovere l'app?",
"other": "Rimuovere le app?" "other": "Rimuovere le app?"

View File

@@ -322,6 +322,8 @@
"name": "Name", "name": "Name",
"smartname": "名前(スマート)", "smartname": "名前(スマート)",
"sortMethod": "ソート方法", "sortMethod": "ソート方法",
"welcome": "ようこそ",
"documentationLinksNote": "以下のリンクにあるObtainium GitHubページには、ビデオ、記事、ディスカッション、その他のリソースへのリンクがあり、アプリの使い方を理解するのに役立ちます。",
"removeAppQuestion": { "removeAppQuestion": {
"one": "アプリを削除しますか?", "one": "アプリを削除しますか?",
"other": "アプリを削除しますか?" "other": "アプリを削除しますか?"

View File

@@ -322,6 +322,8 @@
"name": "이름", "name": "이름",
"smartname": "이름(스마트)", "smartname": "이름(스마트)",
"sortMethod": "정렬 방법", "sortMethod": "정렬 방법",
"welcome": "환영",
"documentationLinksNote": "아래에 링크된 Obtainium 깃허브 페이지에는 앱 사용 방법을 이해하는 데 도움이 되는 동영상, 기사, 토론 및 기타 리소스에 대한 링크가 포함되어 있습니다.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "앱을 제거하시겠습니까?", "one": "앱을 제거하시겠습니까?",
"other": "앱을 제거하시겠습니까?" "other": "앱을 제거하시겠습니까?"

View File

@@ -322,6 +322,8 @@
"name": "Naam", "name": "Naam",
"smartname": "Naam (Slim)", "smartname": "Naam (Slim)",
"sortMethod": "Sorteermethode", "sortMethod": "Sorteermethode",
"welcome": "Welkom",
"documentationLinksNote": "De GitHub pagina van Obtainium waarnaar hieronder wordt gelinkt bevat links naar video's, artikelen, discussies en andere bronnen die je zullen helpen begrijpen hoe je de app kunt gebruiken.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "App verwijderen?", "one": "App verwijderen?",
"other": "Apps verwijderen?" "other": "Apps verwijderen?"

View File

@@ -322,6 +322,8 @@
"name": "Nazwa", "name": "Nazwa",
"smartname": "Nazwa (Smart)", "smartname": "Nazwa (Smart)",
"sortMethod": "Metoda sortowania", "sortMethod": "Metoda sortowania",
"welcome": "Witamy",
"documentationLinksNote": "Strona Obtainium GitHub, do której link znajduje się poniżej, zawiera linki do filmów, artykułów, dyskusji i innych zasobów, które pomogą ci zrozumieć, jak korzystać z aplikacji.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "Usunąć aplikację?", "one": "Usunąć aplikację?",
"few": "Usunąć aplikacje?", "few": "Usunąć aplikacje?",

View File

@@ -322,6 +322,8 @@
"name": "Nome", "name": "Nome",
"smartname": "Nome (Smart)", "smartname": "Nome (Smart)",
"sortMethod": "Método de ordenação", "sortMethod": "Método de ordenação",
"welcome": "Bem-vindo",
"documentationLinksNote": "A página do Obtainium no GitHub com a ligação abaixo contém ligações para vídeos, artigos, discussões e outros recursos que o ajudarão a compreender como utilizar a aplicação.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "Remover aplicativo?", "one": "Remover aplicativo?",
"other": "Remover aplicativos?" "other": "Remover aplicativos?"

View File

@@ -322,6 +322,8 @@
"name": "Имя", "name": "Имя",
"smartname": "Имя (умное)", "smartname": "Имя (умное)",
"sortMethod": "Метод сортировки", "sortMethod": "Метод сортировки",
"welcome": "Добро пожаловать",
"documentationLinksNote": "На странице Obtainium GitHub, ссылка на которую приведена ниже, содержатся ссылки на видео, статьи, обсуждения и другие ресурсы, которые помогут вам понять, как пользоваться приложением.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "Удалить приложение?", "one": "Удалить приложение?",
"other": "Удалить приложения?" "other": "Удалить приложения?"

View File

@@ -16,6 +16,7 @@ const neverAutoTranslate = {
placeholder: ['pl'], placeholder: ['pl'],
importExport: ['fr'], importExport: ['fr'],
url: ['fr'], url: ['fr'],
name: ['ja'],
tencentAppStore: ['*'] tencentAppStore: ['*']
} }
@@ -89,7 +90,7 @@ const main = async () => {
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
setTimeout(() => { setTimeout(() => {
resolve() resolve()
}, Math.random() * 1000); // Try to avoid rate limit }, Math.random() * 10000); // Try to avoid rate limit
}) })
const response = await translateText(str, lang, deeplAPIKey) const response = await translateText(str, lang, deeplAPIKey)
if (response.translations) { if (response.translations) {

View File

@@ -322,6 +322,8 @@
"name": "Namn", "name": "Namn",
"smartname": "Namn (Smart)", "smartname": "Namn (Smart)",
"sortMethod": "Sorteringsmetod", "sortMethod": "Sorteringsmetod",
"welcome": "Välkommen",
"documentationLinksNote": "Obtainium GitHub-sidan som länkas nedan innehåller länkar till videor, artiklar, diskussioner och andra resurser som hjälper dig att förstå hur du använder appen.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "Ta Bort App?", "one": "Ta Bort App?",
"other": "Ta Bort Appar?" "other": "Ta Bort Appar?"

View File

@@ -322,6 +322,8 @@
"name": "İsim", "name": "İsim",
"smartname": "İsim (Akıllı)", "smartname": "İsim (Akıllı)",
"sortMethod": "Sıralama Yöntemi", "sortMethod": "Sıralama Yöntemi",
"welcome": "Hoş geldiniz",
"documentationLinksNote": "Aşağıda bağlantısı verilen Obtainium GitHub sayfası, uygulamayı nasıl kullanacağınızı anlamanıza yardımcı olacak videolara, makalelere, tartışmalara ve diğer kaynaklara bağlantılar içerir.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "Uygulamayı Kaldır?", "one": "Uygulamayı Kaldır?",
"other": "Uygulamaları Kaldır?" "other": "Uygulamaları Kaldır?"

View File

@@ -322,6 +322,8 @@
"name": "Ім'я", "name": "Ім'я",
"smartname": "Ім'я (Smart)", "smartname": "Ім'я (Smart)",
"sortMethod": "Метод сортування", "sortMethod": "Метод сортування",
"welcome": "Ласкаво просимо.",
"documentationLinksNote": "Сторінка Obtainium на GitHub, посилання на яку наведено нижче, містить посилання на відео, статті, дискусії та інші ресурси, які допоможуть вам зрозуміти, як користуватися додатком.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "Видалити застосунок?", "one": "Видалити застосунок?",
"other": "Видалити застосунки?" "other": "Видалити застосунки?"

View File

@@ -322,6 +322,8 @@
"name": "Name", "name": "Name",
"smartname": "Name (Smart)", "smartname": "Name (Smart)",
"sortMethod": "Sort Method", "sortMethod": "Sort Method",
"welcome": "Welcome",
"documentationLinksNote": "The Obtainium GitHub page linked below contains links to videos, articles, discussions, and other resources that will help you understand how to use the app.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "Gỡ ứng dụng?", "one": "Gỡ ứng dụng?",
"other": "Gỡ ứng dụng?" "other": "Gỡ ứng dụng?"

View File

@@ -322,6 +322,8 @@
"name": "Name", "name": "Name",
"smartname": "Name (Smart)", "smartname": "Name (Smart)",
"sortMethod": "Sort Method", "sortMethod": "Sort Method",
"welcome": "Welcome",
"documentationLinksNote": "The Obtainium GitHub page linked below contains links to videos, articles, discussions, and other resources that will help you understand how to use the app.",
"removeAppQuestion": { "removeAppQuestion": {
"one": "移除應用程式?", "one": "移除應用程式?",
"other": "移除應用程式?" "other": "移除應用程式?"

View File

@@ -322,6 +322,8 @@
"name": "名称", "name": "名称",
"smartname": "姓名(智能)", "smartname": "姓名(智能)",
"sortMethod": "排序方法", "sortMethod": "排序方法",
"welcome": "欢迎光临",
"documentationLinksNote": "下面链接的 Obtainium GitHub 页面包含视频、文章、讨论和其他资源的链接,可帮助您了解如何使用该应用程序。",
"removeAppQuestion": { "removeAppQuestion": {
"one": "是否删除应用?", "one": "是否删除应用?",
"other": "是否删除应用?" "other": "是否删除应用?"

View File

@@ -15,6 +15,7 @@ import 'package:obtainium/providers/apps_provider.dart';
import 'package:obtainium/providers/settings_provider.dart'; import 'package:obtainium/providers/settings_provider.dart';
import 'package:obtainium/providers/source_provider.dart'; import 'package:obtainium/providers/source_provider.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher_string.dart';
class HomePage extends StatefulWidget { class HomePage extends StatefulWidget {
const HomePage({super.key}); const HomePage({super.key});
@@ -54,6 +55,45 @@ class _HomePageState extends State<HomePage> {
void initState() { void initState() {
super.initState(); super.initState();
initDeepLinks(); initDeepLinks();
WidgetsBinding.instance.addPostFrameCallback((_) async {
var sp = context.read<SettingsProvider>();
if (!sp.welcomeShown) {
await showDialog(
context: context,
builder: (BuildContext ctx) {
return AlertDialog(
title: Text(tr('welcome')),
content: Column(
mainAxisSize: MainAxisSize.min,
spacing: 20,
children: [
Text(tr('documentationLinksNote')),
GestureDetector(
onTap: () {
launchUrlString(
'https://github.com/ImranR98/Obtainium/blob/main/README.md',
mode: LaunchMode.externalApplication);
},
child: Text(
'https://github.com/ImranR98/Obtainium/blob/main/README.md',
style: const TextStyle(
decoration: TextDecoration.underline,
fontWeight: FontWeight.bold),
)),
],
),
actions: [
TextButton(
onPressed: () {
sp.welcomeShown = true;
Navigator.of(context).pop(null);
},
child: Text(tr('ok'))),
],
);
});
}
});
} }
Future<void> initDeepLinks() async { Future<void> initDeepLinks() async {

View File

@@ -150,6 +150,15 @@ class SettingsProvider with ChangeNotifier {
return result; return result;
} }
bool get welcomeShown {
return prefs?.getBool('welcomeShown') ?? false;
}
set welcomeShown(bool welcomeShown) {
prefs?.setBool('welcomeShown', welcomeShown);
notifyListeners();
}
bool checkJustStarted() { bool checkJustStarted() {
if (justStarted) { if (justStarted) {
justStarted = false; justStarted = false;