Skip to content

Commit

Permalink
UI changes
Browse files Browse the repository at this point in the history
  • Loading branch information
g123k committed Apr 16, 2022
1 parent 334faec commit bbc4370
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/smooth_app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@
"@permission_photo_error": {
"description": "When the camera/photo permission failed to be acquired (!= denied)"
},
"permission_photo_denied_title": "Allow camera use to scan barcodes",
"permission_photo_denied_message": "For an enhanced experience, please allow {appName} to access your camera. You will be able to directly scan barcodes.",
"@permission_photo_denied_message": {
"description": "When the camera/photo permission is denied by user",
Expand Down
23 changes: 17 additions & 6 deletions packages/smooth_app/lib/pages/scan/scan_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,29 @@ class _ScanPageTopWidget extends StatelessWidget {
return Container(
alignment: Alignment.topCenter,
constraints: BoxConstraints.tightForFinite(
width: constraints.maxWidth *
SmoothProductCarousel.carouselViewPortFraction,
height: math.min(constraints.maxHeight * 0.9, 200),
),
padding: SmoothProductCarousel.carouselItemInternalPadding,
child: SmoothCard(
margin: SmoothProductCarousel.carouselItemHorizontalPadding
.add(SmoothProductCarousel.carouselItemInternalPadding),
padding: const EdgeInsetsDirectional.only(
top: 10.0,
start: 8.0,
end: 8.0,
bottom: 5.0,
),
child: Align(
alignment: Alignment.topCenter,
child: Column(
children: <Widget>[
Icon(
Icons.warning_rounded,
size: constraints.maxHeight * 0.15,
Text(
localizations.permission_photo_denied_title,
style: const TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
textAlign: TextAlign.center,
),
Expanded(
child: SingleChildScrollView(
Expand All @@ -141,7 +152,7 @@ class _ScanPageTopWidget extends StatelessWidget {
textAlign: TextAlign.center,
style: const TextStyle(
height: 1.4,
fontSize: 16.0,
fontSize: 15.5,
),
),
),
Expand Down
3 changes: 2 additions & 1 deletion packages/smooth_app/lib/widgets/smooth_product_carousel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class SmoothProductCarousel extends StatefulWidget {
EdgeInsets.symmetric(horizontal: 20.0);
static const EdgeInsets carouselItemInternalPadding =
EdgeInsets.symmetric(horizontal: 2.0);
static const double carouselViewPortFraction = 0.91;

@override
State<SmoothProductCarousel> createState() => _SmoothProductCarouselState();
Expand Down Expand Up @@ -71,7 +72,7 @@ class _SmoothProductCarouselState extends State<SmoothProductCarousel> {
carouselController: _controller,
options: CarouselOptions(
enlargeCenterPage: false,
viewportFraction: 0.91,
viewportFraction: SmoothProductCarousel.carouselViewPortFraction,
height: widget.height,
enableInfiniteScroll: false,
onPageChanged: (int index, CarouselPageChangedReason reason) {
Expand Down

0 comments on commit bbc4370

Please sign in to comment.