From 5d250a4c39d1ea3f103bf737198548ca226a07db Mon Sep 17 00:00:00 2001 From: ReinerRego Date: Thu, 14 Mar 2024 00:56:00 +0100 Subject: [PATCH] randomizer done --- .../lib/screens/error_report_screen.dart | 55 +++++++++++-------- .../lib/screens/error_report_screen.i18n.dart | 6 +- 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/refilc_mobile_ui/lib/screens/error_report_screen.dart b/refilc_mobile_ui/lib/screens/error_report_screen.dart index 0527784..4aeec71 100644 --- a/refilc_mobile_ui/lib/screens/error_report_screen.dart +++ b/refilc_mobile_ui/lib/screens/error_report_screen.dart @@ -1,6 +1,6 @@ import 'dart:io'; import 'dart:math'; - +import 'package:refilc/helpers/dirtywords_helper.dart'; import 'package:refilc/api/client.dart'; import 'package:flutter/material.dart'; import 'package:flutter_feather_icons/flutter_feather_icons.dart'; @@ -14,47 +14,56 @@ class ErrorReportScreen extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: const Color(0xFFE3EBFB), + backgroundColor: Color(0xFFE3EBFB), body: SafeArea( child: Padding( padding: const EdgeInsets.all(12.0), child: Column( children: [ const Spacer(), - Image.asset( - 'assets/icons/ic_rounded.png', - height: 50, - width: 50, - ), + Image.asset('assets/icons/ic_rounded.png', height: 40), const SizedBox(height: 16), Padding( - padding: const EdgeInsets.only(bottom: 2.0), + padding: const EdgeInsets.only(bottom: 4.0), child: Text( "ekretaYou".i18n, style: TextStyle( - color: const Color(0xFF011234).withOpacity(0.7), + color: Color(0xFF011234).withOpacity(0.7), fontSize: 24.0, fontWeight: FontWeight.w700, ), ), ), - Text( - "description".i18n, //TODO: randomize using DirtyWords.xml - textAlign: TextAlign.center, - style: const TextStyle( - color: Color(0xFF011234), - fontSize: 24.0, - fontWeight: FontWeight.w700, - fontStyle: FontStyle.italic, - ), + FutureBuilder( + future: dirtyString(), + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return CircularProgressIndicator(); + } + if (snapshot.hasError) { + return Text("Error: ${snapshot.error}"); + } + return Text( + snapshot.data ?? "", + textAlign: TextAlign.center, + style: const TextStyle( + color: Color(0xFF011234), + fontSize: 24.0, + fontWeight: FontWeight.w700, + fontStyle: FontStyle.italic, + ), + ); + }, ), + const SizedBox(height: 16), Text( "smth_went_wrong".i18n, textAlign: TextAlign.center, style: const TextStyle( color: Color(0xFF011234), - fontSize: 24.0, - fontWeight: FontWeight.w700, + fontSize: 16.0, + fontWeight: FontWeight.w500, + fontFamily: 'Geist', fontStyle: FontStyle.italic, ), ), @@ -135,7 +144,7 @@ class ErrorReportScreen extends StatelessWidget { const EdgeInsets.symmetric(vertical: 14.0), ), backgroundColor: MaterialStateProperty.all( - const Color(0xFFF3F7FE), + Color(0xFFF3F7FE), ), shape: MaterialStateProperty.all( RoundedRectangleBorder( @@ -143,7 +152,7 @@ class ErrorReportScreen extends StatelessWidget { ), ), side: MaterialStateProperty.all( - const BorderSide(width: 1.0, color: Color(0xFFC7D3EB)), + BorderSide(width: 1.0, color: Color(0xFFC7D3EB)), ), ), child: Text( @@ -259,7 +268,7 @@ class ErrorDetail extends StatelessWidget { const EdgeInsets.symmetric(horizontal: 6.5, vertical: 4.0), margin: const EdgeInsets.only(top: 4.0), decoration: BoxDecoration( - color: const Color.fromARGB(255, 218, 218, 218), + color: Color.fromARGB(255, 218, 218, 218), borderRadius: BorderRadius.circular(4.0)), child: Text( content, diff --git a/refilc_mobile_ui/lib/screens/error_report_screen.i18n.dart b/refilc_mobile_ui/lib/screens/error_report_screen.i18n.dart index 0c562a1..697e2a6 100644 --- a/refilc_mobile_ui/lib/screens/error_report_screen.i18n.dart +++ b/refilc_mobile_ui/lib/screens/error_report_screen.i18n.dart @@ -15,7 +15,7 @@ extension SettingsLocalization on String { "stack": "Stack Trace", "done": "Done", "smth_went_wrong": - "Something went wrong, it is of course the fault of Educational Development Informatikai Zrt. (e-KRÉTA) in any case! /s", + "Something went wrong, it is of course the fault of Educational Development Informatikai Zrt. (e-KRÉTA) in any case! (Joke, our fault of course)", }, "hu_hu": { "ekretaYou": "e-KRÉTA, te", @@ -29,7 +29,7 @@ extension SettingsLocalization on String { "stack": "Stacktrace", "done": "Kész", "smth_went_wrong": - "Valami probléma történt, ez természetesen az Educational Development Informatikai Zrt. (e-KRÉTA) hibája minden esetben! /s", + "Valami probléma történt, ez természetesen az Educational Development Informatikai Zrt. (e-KRÉTA) hibája minden esetben! (Vicc, természetesen a mi hibánk)", }, "de_de": { "ekretaYou": "e-KRÉTA, du", @@ -43,7 +43,7 @@ extension SettingsLocalization on String { "stack": "Stack Trace", "done": "Fertig", "smth_went_wrong": - "Irgendetwas ist schief gelaufen, es ist natürlich auf jeden Fall die Schuld der Educational Development Informatikai Zrt. (e-KRÉTA)! /ss", + "Irgendetwas ist schief gelaufen, es ist natürlich auf jeden Fall die Schuld der Educational Development Informatikai Zrt. (e-KRÉTA)! (Scherz, natürlich unsere Schuld)", }, };