From 344342c66c0b5987a219e42f287c52c21297bb70 Mon Sep 17 00:00:00 2001 From: amit patel Date: Sat, 2 Sep 2023 13:28:44 +0530 Subject: [PATCH] add changes in login screen url hint textfield --- .github/workflows/dart.yml | 2 +- .../widgets/rss_feed_home_page.dart | 19 ++++++++------- lib/Pages/login_screen/login_screen.dart | 23 ++++++++++++++++--- .../widgets/login_screen_textfield.dart | 14 ++++++++--- lib/l10n/arb/app_ar.arb | 3 ++- lib/l10n/arb/app_cs.arb | 3 ++- lib/l10n/arb/app_de.arb | 3 ++- lib/l10n/arb/app_en.arb | 3 ++- lib/l10n/arb/app_es.arb | 3 ++- lib/l10n/arb/app_fi.arb | 3 ++- lib/l10n/arb/app_fr.arb | 3 ++- lib/l10n/arb/app_hi.arb | 3 ++- lib/l10n/arb/app_hu.arb | 3 ++- lib/l10n/arb/app_it.arb | 3 ++- lib/l10n/arb/app_ja.arb | 3 ++- lib/l10n/arb/app_ko.arb | 3 ++- lib/l10n/arb/app_nl.arb | 3 ++- lib/l10n/arb/app_no.arb | 3 ++- lib/l10n/arb/app_pl.arb | 3 ++- lib/l10n/arb/app_pt.arb | 3 ++- lib/l10n/arb/app_ro.arb | 3 ++- lib/l10n/arb/app_ru.arb | 3 ++- lib/l10n/arb/app_sv.arb | 3 ++- lib/l10n/arb/app_uk.arb | 3 ++- lib/l10n/arb/app_zh.arb | 3 ++- lib/l10n/l10n.dart | 2 +- .../widget_test/login_screen_widget_test.dart | 7 +++++- 27 files changed, 92 insertions(+), 38 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index a9f98e1..c7031b1 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -17,7 +17,7 @@ jobs: java-version: '12.x' - uses: subosito/flutter-action@v1 with: - flutter-version: '3.10.5' + flutter-version: '3.13.1' - run: flutter pub get - run: flutter gen-l10n --arb-dir=lib/l10n/arb - run: flutter analyze diff --git a/lib/Pages/home_screen/widgets/rss_feed_home_page.dart b/lib/Pages/home_screen/widgets/rss_feed_home_page.dart index f84cc33..1da973b 100644 --- a/lib/Pages/home_screen/widgets/rss_feed_home_page.dart +++ b/lib/Pages/home_screen/widgets/rss_feed_home_page.dart @@ -1011,7 +1011,7 @@ class _RSSFeedHomePageState extends State Padding( padding: const EdgeInsets - .only( + .only( top: 20), child: Column( crossAxisAlignment: @@ -1019,12 +1019,15 @@ class _RSSFeedHomePageState extends State .start, children: [ Padding( - padding: const EdgeInsets + padding: + const EdgeInsets .only( - right: 20, - left: 20, - bottom: - 5), + right: + 20, + left: + 20, + bottom: + 5), child: Text( l10n.selected_magnet_link, style: TextStyle( @@ -1043,7 +1046,7 @@ class _RSSFeedHomePageState extends State ), Padding( padding: const EdgeInsets - .only( + .only( left: 20.0, right: @@ -1384,7 +1387,7 @@ class _RSSFeedHomePageState extends State ? Padding( padding: const EdgeInsets - .only( + .only( top: 8.0), child: Container( height: 1, diff --git a/lib/Pages/login_screen/login_screen.dart b/lib/Pages/login_screen/login_screen.dart index b1949ee..8ecc71b 100644 --- a/lib/Pages/login_screen/login_screen.dart +++ b/lib/Pages/login_screen/login_screen.dart @@ -31,7 +31,7 @@ class _LoginScreenState extends State { TextEditingController usernameController = new TextEditingController(); TextEditingController passwordController = new TextEditingController(); TextEditingController urlController = - new TextEditingController(text: 'http://localhost:3000'); + new TextEditingController(text: 'https://yourserver.xirvik.com'); final _formKey = GlobalKey(); late int themeIndex; @@ -100,7 +100,7 @@ class _LoginScreenState extends State { labelText: l10n.login_screen_url, prefixIcon: Icons.link, themeIndex: themeIndex, - trailingIconButton: Align( + trailingIconButton1: Align( alignment: Alignment.centerRight, child: IconButton( onPressed: () { @@ -120,6 +120,23 @@ class _LoginScreenState extends State { ), ), ), + trailingIconButton2: Align( + alignment: Alignment.centerRight, + child: Tooltip( + triggerMode: TooltipTriggerMode.tap, + message: + "URL for your Flood instance (local, seedbox...).", + showDuration: Duration(seconds: 3), + child: Icon( + Icons.info_outline, + color: ThemeBloc.theme(themeIndex) + .textTheme + .bodyLarge! + .color!, + size: 20, + ), + ), + ), ), SizedBox( height: hp * 0.01, @@ -141,7 +158,7 @@ class _LoginScreenState extends State { prefixIcon: Icons.lock_outline, themeIndex: themeIndex, obscureText: showPass, - trailingIconButton: Align( + trailingIconButton1: Align( alignment: Alignment.centerRight, child: IconButton( onPressed: () { diff --git a/lib/Pages/login_screen/widgets/login_screen_textfield.dart b/lib/Pages/login_screen/widgets/login_screen_textfield.dart index 9d5e3b1..d6b8e96 100644 --- a/lib/Pages/login_screen/widgets/login_screen_textfield.dart +++ b/lib/Pages/login_screen/widgets/login_screen_textfield.dart @@ -7,7 +7,8 @@ class LoginScreenTextField extends StatelessWidget { final String labelText; final IconData prefixIcon; final bool obscureText; - final Widget? trailingIconButton; + final Widget? trailingIconButton1; + final Widget? trailingIconButton2; final int themeIndex; const LoginScreenTextField({ @@ -15,7 +16,8 @@ class LoginScreenTextField extends StatelessWidget { required this.labelText, required this.prefixIcon, required this.themeIndex, - this.trailingIconButton, + this.trailingIconButton1, + this.trailingIconButton2, this.obscureText = false, Key? key, }) : super(key: key); @@ -73,7 +75,13 @@ class LoginScreenTextField extends StatelessWidget { ), ), ), - trailingIconButton ?? Container() + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + trailingIconButton1 ?? Container(), + trailingIconButton2 ?? Container(), + ], + ) ], ), ); diff --git a/lib/l10n/arb/app_ar.arb b/lib/l10n/arb/app_ar.arb index 8ffd7a3..2bc60f3 100644 --- a/lib/l10n/arb/app_ar.arb +++ b/lib/l10n/arb/app_ar.arb @@ -321,5 +321,6 @@ "notification_stopped": "تم الإيقاف", "notification_downloading": "جاري التنزيل", "notification_error": "خطأ في التنزيل", - "notification_finished": "تم التنزيل" + "notification_finished": "تم التنزيل", + "login_field_tooltip_message": "عنوان URL للمثيل الخاص بك في Flood (محلي، seedbox...)" } \ No newline at end of file diff --git a/lib/l10n/arb/app_cs.arb b/lib/l10n/arb/app_cs.arb index ec8dcdf..f99778d 100644 --- a/lib/l10n/arb/app_cs.arb +++ b/lib/l10n/arb/app_cs.arb @@ -321,5 +321,6 @@ "notification_stopped": "Zastaveno", "notification_downloading": "Stahování", "notification_error": "Chyba při stahování", - "notification_finished": "Stahování dokončeno" + "notification_finished": "Stahování dokončeno", + "login_field_tooltip_message": "URL pro vaši Flood instanci (lokální, seedbox...)" } \ No newline at end of file diff --git a/lib/l10n/arb/app_de.arb b/lib/l10n/arb/app_de.arb index 72fc8a4..25cb175 100644 --- a/lib/l10n/arb/app_de.arb +++ b/lib/l10n/arb/app_de.arb @@ -321,5 +321,6 @@ "sort_by_uploaded": "Hochgeladen", "sort_by_upload_speed": "Upload-Geschwindigkeit", "sort_by_file_size": "Dateigröße", - "sort_by_percent_completed": "Prozent abgeschlossen" + "sort_by_percent_completed": "Prozent abgeschlossen", + "login_field_tooltip_message": "URL für Ihre Flood-Instanz (lokal, seedbox...)" } \ No newline at end of file diff --git a/lib/l10n/arb/app_en.arb b/lib/l10n/arb/app_en.arb index ce19477..cbdc14c 100644 --- a/lib/l10n/arb/app_en.arb +++ b/lib/l10n/arb/app_en.arb @@ -335,6 +335,7 @@ "notification_stopped": "Stopped", "notification_downloading": "Downloading", "notification_error": "Download Error", - "notification_finished": "Download Finished" + "notification_finished": "Download Finished", + "login_field_tooltip_message" : "URL for your Flood instance (local, seedbox...)." } \ No newline at end of file diff --git a/lib/l10n/arb/app_es.arb b/lib/l10n/arb/app_es.arb index 681898c..f61c4f6 100644 --- a/lib/l10n/arb/app_es.arb +++ b/lib/l10n/arb/app_es.arb @@ -321,5 +321,6 @@ "notification_stopped": "Detenido", "notification_downloading": "Descargando", "notification_error": "Error de descarga", - "notification_finished": "Descarga finalizada" + "notification_finished": "Descarga finalizada", + "login_field_tooltip_message": "URL para su instancia de Flood (local, seedbox...)" } \ No newline at end of file diff --git a/lib/l10n/arb/app_fi.arb b/lib/l10n/arb/app_fi.arb index c2d4c39..a135d16 100644 --- a/lib/l10n/arb/app_fi.arb +++ b/lib/l10n/arb/app_fi.arb @@ -321,5 +321,6 @@ "notification_stopped": "Pysähtynyt", "notification_downloading": "Lataaminen", "notification_error": "Latausvirhe", - "notification_finished": "Lataus valmis" + "notification_finished": "Lataus valmis", + "login_field_tooltip_message": "URL Flood-instanssillesi (paikallinen, seedbox...)" } \ No newline at end of file diff --git a/lib/l10n/arb/app_fr.arb b/lib/l10n/arb/app_fr.arb index 5d9f9ed..d29958d 100644 --- a/lib/l10n/arb/app_fr.arb +++ b/lib/l10n/arb/app_fr.arb @@ -322,5 +322,6 @@ "notification_stopped": "Arrêté", "notification_downloading": "Téléchargement", "notification_error": "Erreur de téléchargement", - "notification_finished": "Téléchargement terminé" + "notification_finished": "Téléchargement terminé", + "login_field_tooltip_message": "URL pour votre instance de Flood (locale, seedbox...)" } \ No newline at end of file diff --git a/lib/l10n/arb/app_hi.arb b/lib/l10n/arb/app_hi.arb index a6e9556..4c728ed 100644 --- a/lib/l10n/arb/app_hi.arb +++ b/lib/l10n/arb/app_hi.arb @@ -321,5 +321,6 @@ "notification_stopped": "रुक गया", "notification_downloading": "डाउनलोड हो रहा है", "notification_error": "डाउनलोड त्रुटि", - "notification_finished": "डाउनलोड समाप्त" + "notification_finished": "डाउनलोड समाप्त", + "login_field_tooltip_message": "आपके फ्लड इंस्टेंस के लिए URL (स्थानीय, सीडबॉक्स...)" } \ No newline at end of file diff --git a/lib/l10n/arb/app_hu.arb b/lib/l10n/arb/app_hu.arb index 3a26f13..49509d6 100644 --- a/lib/l10n/arb/app_hu.arb +++ b/lib/l10n/arb/app_hu.arb @@ -321,5 +321,6 @@ "notification_stopped": "Megállt", "notification_downloading": "Letöltés", "notification_error": "Letöltési hiba", - "notification_finished": "Letöltés kész" + "notification_finished": "Letöltés kész", + "login_field_tooltip_message": "URL a Flood példányához (helyi, seedbox...)" } \ No newline at end of file diff --git a/lib/l10n/arb/app_it.arb b/lib/l10n/arb/app_it.arb index b9e518f..67be611 100644 --- a/lib/l10n/arb/app_it.arb +++ b/lib/l10n/arb/app_it.arb @@ -321,5 +321,6 @@ "notification_stopped": "Fermato", "notification_downloading": "Download", "notification_error": "Errore di download", - "notification_finished": "Download completato" + "notification_finished": "Download completato", + "login_field_tooltip_message": "URL per la tua istanza di Flood (locale, seedbox...)" } \ No newline at end of file diff --git a/lib/l10n/arb/app_ja.arb b/lib/l10n/arb/app_ja.arb index 1ba345f..05ba8e3 100644 --- a/lib/l10n/arb/app_ja.arb +++ b/lib/l10n/arb/app_ja.arb @@ -322,5 +322,6 @@ "notification_stopped": "停止", "notification_downloading": "ダウンロード中", "notification_error": "ダウンロードエラー", - "notification_finished": "ダウンロード完了" + "notification_finished": "ダウンロード完了", + "login_field_tooltip_message": "Flood インスタンスの URL(ローカル、シードボックス...)" } \ No newline at end of file diff --git a/lib/l10n/arb/app_ko.arb b/lib/l10n/arb/app_ko.arb index f1a05ae..08aad98 100644 --- a/lib/l10n/arb/app_ko.arb +++ b/lib/l10n/arb/app_ko.arb @@ -321,5 +321,6 @@ "notification_stopped": "정지됨", "notification_downloading": "다운로드 중", "notification_error": "다운로드 오류", - "notification_finished": "다운로드 완료" + "notification_finished": "다운로드 완료", + "login_field_tooltip_message": "귀하의 Flood 인스턴스 URL (로컬, 시드박스...)" } \ No newline at end of file diff --git a/lib/l10n/arb/app_nl.arb b/lib/l10n/arb/app_nl.arb index 4636c39..0d0618e 100644 --- a/lib/l10n/arb/app_nl.arb +++ b/lib/l10n/arb/app_nl.arb @@ -321,5 +321,6 @@ "notification_stopped": "Gestopt", "notification_downloading": "Downloaden", "notification_error": "Downloadfout", - "notification_finished": "Download voltooid" + "notification_finished": "Download voltooid", + "login_field_tooltip_message": "URL voor uw Flood-instantie (lokaal, seedbox...)" } \ No newline at end of file diff --git a/lib/l10n/arb/app_no.arb b/lib/l10n/arb/app_no.arb index ae6ae55..8dbf6e5 100644 --- a/lib/l10n/arb/app_no.arb +++ b/lib/l10n/arb/app_no.arb @@ -321,5 +321,6 @@ "notification_stopped": "Stoppet", "notification_downloading": "Laster ned", "notification_error": "Nedlastingsfeil", - "notification_finished": "Nedlasting fullført" + "notification_finished": "Nedlasting fullført", + "login_field_tooltip_message": "URL for din Flood-instans (lokal, seedbox...)" } \ No newline at end of file diff --git a/lib/l10n/arb/app_pl.arb b/lib/l10n/arb/app_pl.arb index 906b9c3..a49d582 100644 --- a/lib/l10n/arb/app_pl.arb +++ b/lib/l10n/arb/app_pl.arb @@ -321,5 +321,6 @@ "notification_stopped": "Zatrzymano", "notification_downloading": "Pobieranie", "notification_error": "Błąd pobierania", - "notification_finished": "Pobieranie zakończone" + "notification_finished": "Pobieranie zakończone", + "login_field_tooltip_message": "URL do twojej instancji Flood (lokalnie, seedbox...)" } \ No newline at end of file diff --git a/lib/l10n/arb/app_pt.arb b/lib/l10n/arb/app_pt.arb index cc6e4fe..a328d0a 100644 --- a/lib/l10n/arb/app_pt.arb +++ b/lib/l10n/arb/app_pt.arb @@ -321,5 +321,6 @@ "notification_stopped": "Parado", "notification_downloading": "Download", "notification_error": "Erro de download", - "notification_finished": "Download concluído" + "notification_finished": "Download concluído", + "login_field_tooltip_message": "URL para a sua instância do Flood (local, seedbox...)" } \ No newline at end of file diff --git a/lib/l10n/arb/app_ro.arb b/lib/l10n/arb/app_ro.arb index 57959ef..372c831 100644 --- a/lib/l10n/arb/app_ro.arb +++ b/lib/l10n/arb/app_ro.arb @@ -321,5 +321,6 @@ "notification_stopped": "Oprit", "notification_downloading": "Descărcare", "notification_error": "Eroare de descărcare", - "notification_finished": "Descărcare finalizată" + "notification_finished": "Descărcare finalizată", + "login_field_tooltip_message": "URL pentru instanța ta Flood (locală, seedbox...)" } \ No newline at end of file diff --git a/lib/l10n/arb/app_ru.arb b/lib/l10n/arb/app_ru.arb index 44b4b6a..3a43c6d 100644 --- a/lib/l10n/arb/app_ru.arb +++ b/lib/l10n/arb/app_ru.arb @@ -321,5 +321,6 @@ "sort_by_uploaded": "Wgrane", "sort_by_upload_speed": "Prędkość wysyłania", "sort_by_file_size": "Rozmiar pliku", - "sort_by_percent_completed": "Procent ukończony" + "sort_by_percent_completed": "Procent ukończony", + "login_field_tooltip_message": "URL для вашего экземпляра Flood (локальный, seedbox...)" } \ No newline at end of file diff --git a/lib/l10n/arb/app_sv.arb b/lib/l10n/arb/app_sv.arb index a83556f..8ef7f51 100644 --- a/lib/l10n/arb/app_sv.arb +++ b/lib/l10n/arb/app_sv.arb @@ -322,5 +322,6 @@ "notification_stopped": "Stoppad", "notification_downloading": "Laddar ner", "notification_error": "Nedladdningsfel", - "notification_finished": "Nedladdning klar" + "notification_finished": "Nedladdning klar", + "login_field_tooltip_message": "URL för din Flood-instans (lokal, seedbox...)" } \ No newline at end of file diff --git a/lib/l10n/arb/app_uk.arb b/lib/l10n/arb/app_uk.arb index cc286bc..3b4fd78 100644 --- a/lib/l10n/arb/app_uk.arb +++ b/lib/l10n/arb/app_uk.arb @@ -322,5 +322,6 @@ "notification_stopped": "Зупинено", "notification_downloading": "Завантаження", "notification_error": "Помилка завантаження", - "notification_finished": "Завантаження завершено" + "notification_finished": "Завантаження завершено", + "login_field_tooltip_message": "URL для вашого екземпляра Flood (локальний, seedbox...)" } \ No newline at end of file diff --git a/lib/l10n/arb/app_zh.arb b/lib/l10n/arb/app_zh.arb index 061eb4d..f1fbf6a 100644 --- a/lib/l10n/arb/app_zh.arb +++ b/lib/l10n/arb/app_zh.arb @@ -322,5 +322,6 @@ "notification_stopped": "已停止", "notification_downloading": "下載中", "notification_error": "下載錯誤", - "notification_finished": "下載完成" + "notification_finished": "下載完成", + "login_field_tooltip_message": "您的 Flood 实例 URL(本地,种子盒...)" } \ No newline at end of file diff --git a/lib/l10n/l10n.dart b/lib/l10n/l10n.dart index 2c9596a..3e911a9 100644 --- a/lib/l10n/l10n.dart +++ b/lib/l10n/l10n.dart @@ -3,5 +3,5 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; export 'package:flutter_gen/gen_l10n/app_localizations.dart'; extension AppLocalizationsX on BuildContext { - AppLocalizations get l10n => AppLocalizations.of(this); + AppLocalizations get l10n => AppLocalizations.of(this)!; } diff --git a/test/widget_test/login_screen_widget_test.dart b/test/widget_test/login_screen_widget_test.dart index 3a26fb2..9f12c23 100644 --- a/test/widget_test/login_screen_widget_test.dart +++ b/test/widget_test/login_screen_widget_test.dart @@ -33,11 +33,16 @@ void main() { expect(find.text('Sign in to your account'), findsOneWidget); expect(find.byKey(Key('Url TextField')), findsOneWidget); expect(find.byIcon(Icons.link), findsOneWidget); + expect(find.byIcon(Icons.info_outline), findsOneWidget); + await tester.tap(find.byIcon(Icons.info_outline)); + await tester.pumpAndSettle(); + expect(find.text('URL for your Flood instance (local, seedbox...).'), + findsOneWidget); expect(find.byIcon(Icons.paste), findsOneWidget); final urlControllerFinder = find.byKey(Key('Url TextField')); var urlController = tester.firstWidget(urlControllerFinder) as LoginScreenTextField; - expect(urlController.controller.text, 'http://localhost:3000'); + expect(urlController.controller.text, 'https://yourserver.xirvik.com'); expect(find.byKey(Key('Username TextField')), findsOneWidget); expect(find.byIcon(Icons.person), findsOneWidget); expect(find.text('Username'), findsOneWidget);