Skip to content

Commit

Permalink
TW-1644: allow access to the gallery is not center
Browse files Browse the repository at this point in the history
  • Loading branch information
sherlockvn committed Jun 7, 2024
1 parent 6a3421e commit 4229bd2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion assets/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -2690,7 +2690,7 @@
"@noImagesFound": {},
"captionForImagesIsNotSupportYet": "Caption for images is not support yet.",
"@captionForImagesIsNotSupportYet": {},
"tapToAllowAccessToYourGallery": "Tap to allow access to your Gallery",
"tapToAllowAccessToYourGallery": "Tap to allow gallery access",
"@tapToAllowAccessToYourGallery": {},
"tapToAllowAccessToYourCamera": "You can enable camera access in the Settings app to make video calls in",
"@tapToAllowAccessToYourCamera": {},
Expand Down
14 changes: 8 additions & 6 deletions lib/presentation/mixins/media_picker_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -289,18 +289,20 @@ mixin MediaPickerMixin on CommonMediaPickerMixin {
),
),
goToSettingsWidget: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset(
ImagePaths.icPhotosSettingPermission,
width: 40,
height: 40,
width: MediaPickerStyle.photoPermissionIconSize,
height: MediaPickerStyle.photoPermissionIconSize,
),
Text(
L10n.of(context)!.tapToAllowAccessToYourGallery,
style: Theme.of(context)
.textTheme
.titleSmall
?.copyWith(color: LinagoraRefColors.material().neutral),
style: Theme.of(context).textTheme.titleSmall?.copyWith(
color: LinagoraRefColors.material().neutral,
fontWeight: MediaPickerStyle.photoPermissionFontWeight,
fontSize: MediaPickerStyle.photoPermissionFontSize,
),
textAlign: TextAlign.center,
),
],
Expand Down
15 changes: 9 additions & 6 deletions lib/presentation/mixins/single_image_picker_mixin.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:fluffychat/presentation/style/media_picker_style.dart';
import 'package:fluffychat/resource/image_paths.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
Expand Down Expand Up @@ -37,18 +38,20 @@ mixin SingleImagePickerMixin on CommonMediaPickerMixin {
expandedWidget: const SizedBox(height: 50),
counterImageBuilder: (_) => const SizedBox.shrink(),
goToSettingsWidget: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset(
ImagePaths.icPhotosSettingPermission,
width: 40,
height: 40,
width: MediaPickerStyle.photoPermissionIconSize,
height: MediaPickerStyle.photoPermissionIconSize,
),
Text(
L10n.of(context)!.tapToAllowAccessToYourGallery,
style: Theme.of(context)
.textTheme
.titleSmall
?.copyWith(color: LinagoraRefColors.material().neutral),
style: Theme.of(context).textTheme.titleSmall?.copyWith(
color: LinagoraRefColors.material().neutral,
fontWeight: MediaPickerStyle.photoPermissionFontWeight,
fontSize: MediaPickerStyle.photoPermissionFontSize,
),
textAlign: TextAlign.center,
),
],
Expand Down
6 changes: 6 additions & 0 deletions lib/presentation/style/media_picker_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,10 @@ class MediaPickerStyle {
static const double borderSideWidth = 1.5;

static const double minFontSize = 8;

static double photoPermissionIconSize = 48.0;

static double photoPermissionFontSize = 16;

static FontWeight photoPermissionFontWeight = FontWeight.w600;
}

0 comments on commit 4229bd2

Please sign in to comment.