From 475534c9c9e4a4fbfecd3d28fad6bf09069cedc8 Mon Sep 17 00:00:00 2001 From: Abhay Chaudhary Date: Fri, 1 Apr 2022 21:12:00 +0530 Subject: [PATCH] fix: Welcome message splits on smaller device (#1441) --- .../smooth_app/lib/widgets/smooth_product_carousel.dart | 4 +++- packages/smooth_app/pubspec.lock | 7 +++++++ packages/smooth_app/pubspec.yaml | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/smooth_app/lib/widgets/smooth_product_carousel.dart b/packages/smooth_app/lib/widgets/smooth_product_carousel.dart index 7d84b2d6bb8..db872b56f93 100644 --- a/packages/smooth_app/lib/widgets/smooth_product_carousel.dart +++ b/packages/smooth_app/lib/widgets/smooth_product_carousel.dart @@ -1,3 +1,4 @@ +import 'package:auto_size_text/auto_size_text.dart'; import 'package:carousel_slider/carousel_slider.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; @@ -120,13 +121,14 @@ class SearchCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - Text( + AutoSizeText( localizations.welcomeToOpenFoodFacts, textAlign: TextAlign.center, style: const TextStyle( fontSize: 36.0, fontWeight: FontWeight.bold, ), + maxLines: 2, ), Text( localizations.searchPanelHeader, diff --git a/packages/smooth_app/pubspec.lock b/packages/smooth_app/pubspec.lock index 41bfc6fc271..83feed6d228 100644 --- a/packages/smooth_app/pubspec.lock +++ b/packages/smooth_app/pubspec.lock @@ -43,6 +43,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.8.2" + auto_size_text: + dependency: "direct main" + description: + name: auto_size_text + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" boolean_selector: dependency: transitive description: diff --git a/packages/smooth_app/pubspec.yaml b/packages/smooth_app/pubspec.yaml index 8e122c6de47..6d691040e1b 100644 --- a/packages/smooth_app/pubspec.yaml +++ b/packages/smooth_app/pubspec.yaml @@ -51,6 +51,7 @@ dependencies: git: url: https://github.com/cli1005/google_ml_barcode_scanner.git ref: master + auto_size_text: ^3.0.0