diff --git a/lib/assets/l10n/wiredash_en.arb b/lib/assets/l10n/wiredash_en.arb index f62ee652..f8a19e7c 100644 --- a/lib/assets/l10n/wiredash_en.arb +++ b/lib/assets/l10n/wiredash_en.arb @@ -18,6 +18,7 @@ "feedbackStep3ScreenshotOverviewAddScreenshotButton": "Add screenshot", "feedbackStep3ScreenshotBarNavigateTitle": "Take a screenshot", + "feedbackStep3ScreenshotBottomBarTitle": "Include a screenshot for more context", "feedbackStep3ScreenshotBarDrawTitle": "Draw on screen to add highlights", "feedbackStep3ScreenshotBarDrawUndoButton": "Undo", "feedbackStep3ScreenshotBarCaptureButton": "Capture", diff --git a/lib/assets/l10n/wiredash_localizations.g.dart b/lib/assets/l10n/wiredash_localizations.g.dart index cc1a03ce..ec15f9d7 100644 --- a/lib/assets/l10n/wiredash_localizations.g.dart +++ b/lib/assets/l10n/wiredash_localizations.g.dart @@ -199,6 +199,12 @@ abstract class WiredashLocalizations { /// **'Take a screenshot'** String get feedbackStep3ScreenshotBarNavigateTitle; + /// No description provided for @feedbackStep3ScreenshotBottomBarTitle. + /// + /// In en, this message translates to: + /// **'Include a screenshot for more context'** + String get feedbackStep3ScreenshotBottomBarTitle; + /// No description provided for @feedbackStep3ScreenshotBarDrawTitle. /// /// In en, this message translates to: diff --git a/lib/assets/l10n/wiredash_localizations_ar.g.dart b/lib/assets/l10n/wiredash_localizations_ar.g.dart index ff315a2a..184bae78 100644 --- a/lib/assets/l10n/wiredash_localizations_ar.g.dart +++ b/lib/assets/l10n/wiredash_localizations_ar.g.dart @@ -50,6 +50,10 @@ class WiredashLocalizationsAr extends WiredashLocalizations { @override String get feedbackStep3ScreenshotBarNavigateTitle => 'أخذ لقطة للشاشة'; + @override + String get feedbackStep3ScreenshotBottomBarTitle => + 'Include a screenshot for more context'; + @override String get feedbackStep3ScreenshotBarDrawTitle => 'أرسم على الشاشة لإضافة تأشيرة'; diff --git a/lib/assets/l10n/wiredash_localizations_cs.g.dart b/lib/assets/l10n/wiredash_localizations_cs.g.dart index 13dbd188..a3c0f989 100644 --- a/lib/assets/l10n/wiredash_localizations_cs.g.dart +++ b/lib/assets/l10n/wiredash_localizations_cs.g.dart @@ -56,6 +56,10 @@ class WiredashLocalizationsCs extends WiredashLocalizations { String get feedbackStep3ScreenshotBarNavigateTitle => 'Pořiďte snímek obrazovky'; + @override + String get feedbackStep3ScreenshotBottomBarTitle => + 'Include a screenshot for more context'; + @override String get feedbackStep3ScreenshotBarDrawTitle => 'Kreslení na obrazovce pro přidání zvýraznění'; diff --git a/lib/assets/l10n/wiredash_localizations_da.g.dart b/lib/assets/l10n/wiredash_localizations_da.g.dart index 38796d01..1a9b0474 100644 --- a/lib/assets/l10n/wiredash_localizations_da.g.dart +++ b/lib/assets/l10n/wiredash_localizations_da.g.dart @@ -54,6 +54,10 @@ class WiredashLocalizationsDa extends WiredashLocalizations { @override String get feedbackStep3ScreenshotBarNavigateTitle => 'Tag et skærmbillede'; + @override + String get feedbackStep3ScreenshotBottomBarTitle => + 'Include a screenshot for more context'; + @override String get feedbackStep3ScreenshotBarDrawTitle => 'Tegn på skærmen for at tilføje højdepunkter'; diff --git a/lib/assets/l10n/wiredash_localizations_de.g.dart b/lib/assets/l10n/wiredash_localizations_de.g.dart index 35650200..718fec78 100644 --- a/lib/assets/l10n/wiredash_localizations_de.g.dart +++ b/lib/assets/l10n/wiredash_localizations_de.g.dart @@ -52,6 +52,10 @@ class WiredashLocalizationsDe extends WiredashLocalizations { @override String get feedbackStep3ScreenshotBarNavigateTitle => 'Screenshot erstellen'; + @override + String get feedbackStep3ScreenshotBottomBarTitle => + 'Include a screenshot for more context'; + @override String get feedbackStep3ScreenshotBarDrawTitle => 'Füge Markierungen mit dem Zeichnen-Tool hinzu'; diff --git a/lib/assets/l10n/wiredash_localizations_en.g.dart b/lib/assets/l10n/wiredash_localizations_en.g.dart index 6864378d..3a57abf5 100644 --- a/lib/assets/l10n/wiredash_localizations_en.g.dart +++ b/lib/assets/l10n/wiredash_localizations_en.g.dart @@ -53,6 +53,10 @@ class WiredashLocalizationsEn extends WiredashLocalizations { @override String get feedbackStep3ScreenshotBarNavigateTitle => 'Take a screenshot'; + @override + String get feedbackStep3ScreenshotBottomBarTitle => + 'Include a screenshot for more context'; + @override String get feedbackStep3ScreenshotBarDrawTitle => 'Draw on screen to add highlights'; diff --git a/lib/assets/l10n/wiredash_localizations_es.g.dart b/lib/assets/l10n/wiredash_localizations_es.g.dart index 503a828f..39b2943e 100644 --- a/lib/assets/l10n/wiredash_localizations_es.g.dart +++ b/lib/assets/l10n/wiredash_localizations_es.g.dart @@ -56,6 +56,10 @@ class WiredashLocalizationsEs extends WiredashLocalizations { String get feedbackStep3ScreenshotBarNavigateTitle => 'Haz una captura de pantalla'; + @override + String get feedbackStep3ScreenshotBottomBarTitle => + 'Include a screenshot for more context'; + @override String get feedbackStep3ScreenshotBarDrawTitle => 'Marca los detalles importantes'; diff --git a/lib/assets/l10n/wiredash_localizations_fr.g.dart b/lib/assets/l10n/wiredash_localizations_fr.g.dart index 8b8465a2..f84d1157 100644 --- a/lib/assets/l10n/wiredash_localizations_fr.g.dart +++ b/lib/assets/l10n/wiredash_localizations_fr.g.dart @@ -56,6 +56,10 @@ class WiredashLocalizationsFr extends WiredashLocalizations { String get feedbackStep3ScreenshotBarNavigateTitle => 'Prendre une capture d\'écran'; + @override + String get feedbackStep3ScreenshotBottomBarTitle => + 'Include a screenshot for more context'; + @override String get feedbackStep3ScreenshotBarDrawTitle => 'Dessiner sur l\'écran pour en mettre en avant une partie'; diff --git a/lib/assets/l10n/wiredash_localizations_hu.g.dart b/lib/assets/l10n/wiredash_localizations_hu.g.dart index 7315bcb4..74e826f4 100644 --- a/lib/assets/l10n/wiredash_localizations_hu.g.dart +++ b/lib/assets/l10n/wiredash_localizations_hu.g.dart @@ -54,6 +54,10 @@ class WiredashLocalizationsHu extends WiredashLocalizations { @override String get feedbackStep3ScreenshotBarNavigateTitle => 'Készíts képernyőképet'; + @override + String get feedbackStep3ScreenshotBottomBarTitle => + 'Include a screenshot for more context'; + @override String get feedbackStep3ScreenshotBarDrawTitle => 'Rajzolj a képernyőre hogy emeld ki a lényeget'; diff --git a/lib/assets/l10n/wiredash_localizations_pl.g.dart b/lib/assets/l10n/wiredash_localizations_pl.g.dart index e3c6c636..cd9d7653 100644 --- a/lib/assets/l10n/wiredash_localizations_pl.g.dart +++ b/lib/assets/l10n/wiredash_localizations_pl.g.dart @@ -54,6 +54,10 @@ class WiredashLocalizationsPl extends WiredashLocalizations { @override String get feedbackStep3ScreenshotBarNavigateTitle => 'Wykonaj zrzut ekranu'; + @override + String get feedbackStep3ScreenshotBottomBarTitle => + 'Include a screenshot for more context'; + @override String get feedbackStep3ScreenshotBarDrawTitle => 'Zaznacz rysując po ekranie'; diff --git a/lib/assets/l10n/wiredash_localizations_pt.g.dart b/lib/assets/l10n/wiredash_localizations_pt.g.dart index ad0b4142..22b3ddda 100644 --- a/lib/assets/l10n/wiredash_localizations_pt.g.dart +++ b/lib/assets/l10n/wiredash_localizations_pt.g.dart @@ -56,6 +56,10 @@ class WiredashLocalizationsPt extends WiredashLocalizations { String get feedbackStep3ScreenshotBarNavigateTitle => 'Faça uma captura de tela'; + @override + String get feedbackStep3ScreenshotBottomBarTitle => + 'Include a screenshot for more context'; + @override String get feedbackStep3ScreenshotBarDrawTitle => 'Indique os detalhes relevantes'; diff --git a/lib/assets/l10n/wiredash_localizations_tr.g.dart b/lib/assets/l10n/wiredash_localizations_tr.g.dart index a93c6f9e..0b374cbf 100644 --- a/lib/assets/l10n/wiredash_localizations_tr.g.dart +++ b/lib/assets/l10n/wiredash_localizations_tr.g.dart @@ -54,6 +54,10 @@ class WiredashLocalizationsTr extends WiredashLocalizations { @override String get feedbackStep3ScreenshotBarNavigateTitle => 'Ekran görüntüsü al'; + @override + String get feedbackStep3ScreenshotBottomBarTitle => + 'Include a screenshot for more context'; + @override String get feedbackStep3ScreenshotBarDrawTitle => 'Bir şeyler göstermek için ekranın üzerine çiz'; diff --git a/lib/src/core/widgets/backdrop/step_page_scaffold.dart b/lib/src/core/widgets/backdrop/step_page_scaffold.dart index 0e4820fa..00037719 100644 --- a/lib/src/core/widgets/backdrop/step_page_scaffold.dart +++ b/lib/src/core/widgets/backdrop/step_page_scaffold.dart @@ -9,7 +9,7 @@ import 'package:wiredash/src/core/widgets/measure_size.dart'; /// The default layout of a step in [LarryPageView] class StepPageScaffold extends StatefulWidget { - const StepPageScaffold({ + StepPageScaffold({ this.currentStep, this.totalSteps, this.title, @@ -23,7 +23,12 @@ class StepPageScaffold extends StatefulWidget { this.onClose, this.alignment, this.minHeight, - }); + }) : assert(() { + if (discardLabel != null && discardConfirmLabel == null) { + throw 'discardConfirmLabel must be set if discardLabel is set'; + } + return true; + }()); final int? currentStep; final int? totalSteps; @@ -201,7 +206,8 @@ class StepPageScaffoldState extends State { ); }, ) - else if (widget.discardLabel != null) ...[ + else if (widget.discardLabel != null && + widget.discardConfirmLabel != null) ...[ TronLabeledButton( onTap: () { setState(() { @@ -233,8 +239,7 @@ class StepPageScaffoldState extends State { ) : DefaultTextStyle( style: context.text.caption.onBackground, - child: widget.discardConfirmLabel ?? - const Text('Really?'), + child: widget.discardConfirmLabel!, ), ), ], diff --git a/lib/src/feedback/feedback_backdrop.dart b/lib/src/feedback/feedback_backdrop.dart index 559fc22e..7d856550 100644 --- a/lib/src/feedback/feedback_backdrop.dart +++ b/lib/src/feedback/feedback_backdrop.dart @@ -187,7 +187,7 @@ Widget? _buildBackgroundLayer( padding: const EdgeInsets.all(8.0), child: Center( child: Text( - 'Include a screenshot for more context', + context.l10n.feedbackStep3ScreenshotBottomBarTitle, style: context.text.appbarTitle.onBackground, textAlign: TextAlign.center, ), diff --git a/lib/src/promoterscore/step_1_rating.dart b/lib/src/promoterscore/step_1_rating.dart index a32a0f67..b9dae37c 100644 --- a/lib/src/promoterscore/step_1_rating.dart +++ b/lib/src/promoterscore/step_1_rating.dart @@ -24,6 +24,7 @@ class _PsStep1RatingState extends State { return StepPageScaffold( title: Text(question), discardLabel: Text(context.l10n.feedbackCloseButton), + discardConfirmLabel: Text(context.l10n.feedbackDiscardConfirmButton), indicator: const StepIndicator( completed: false, currentStep: 1, diff --git a/pubspec.yaml b/pubspec.yaml index ae938172..f3f7fce7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -36,7 +36,7 @@ dev_dependencies: flutter_test: sdk: flutter lint: '>=1.10.0 <3.0.0' - spot: '>=0.3.1 <1.0.0' + spot: '>=0.3.1 <0.5.0' test: ^1.21.0 transparent_image: ^2.0.0