breaking change: ofText->galleryPaginationText

This commit is contained in:
Sacha Arbonel
2021-08-02 15:30:58 -04:00
parent e44a4ce3a1
commit 59b4f5568c
11 changed files with 42 additions and 32 deletions
@@ -136,9 +136,9 @@ class _GalleryFooterState extends State<GalleryFooter> {
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(
'${widget.currentPage + 1} '
'${context.translations.ofText} '
'${widget.totalPages}',
context.translations.galleryPaginationText(
currentPage: widget.currentPage,
totalPages: widget.totalPages),
style: galleryFooterThemeData.titleTextStyle,
),
],
@@ -296,8 +296,9 @@ abstract class Translations {
/// The text shown for "You"
String get youText;
/// The text shown for "Of"
String get ofText;
/// Gallery footer pagination text
String galleryPaginationText(
{required int currentPage, required int totalPages});
/// The text shown for "File"
String get fileText;
@@ -657,7 +658,9 @@ class DefaultTranslations implements Translations {
String get youText => 'You';
@override
String get ofText => 'of';
String galleryPaginationText(
{required int currentPage, required int totalPages}) =>
'${currentPage + 1} of $totalPages';
@override
String get fileText => 'File';
@@ -167,7 +167,7 @@ void main() {
expect(translations.withText, isNotNull);
expect(translations.inText, isNotNull);
expect(translations.youText, isNotNull);
expect(translations.ofText, isNotNull);
expect(translations.galleryPaginationText, isNotNull);
expect(translations.fileText, isNotNull);
expect(translations.replyToMessageLabel, isNotNull);
});