Skip to content

Commit

Permalink
TW-1644: allow access to the gallery is not center (#1815)
Browse files Browse the repository at this point in the history
* TW-1644: allow access to the gallery is not center

* TW-1644: close the bottomsheet when go to settings

* TW-1644: update style for image picker
  • Loading branch information
sherlockvn authored and Te-Z committed Jun 18, 2024
1 parent 48fa4a6 commit 3f226b5
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 16 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
20 changes: 12 additions & 8 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 @@ -31,24 +32,27 @@ mixin SingleImagePickerMixin on CommonMediaPickerMixin {
context: context,
controller: imagePickerController,
backgroundImageCamera: const AssetImage("assets/verification.png"),
initialChildSize: 0.6,
initialChildSize: MediaPickerStyle.initialChildSize,
permissionStatus: permissionStatusPhotos,
assetBackgroundColor: LinagoraSysColors.material().background,
expandedWidget: const SizedBox(height: 50),
expandedWidget:
const SizedBox(height: MediaPickerStyle.expandedWidgetHeight),
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
8 changes: 8 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,12 @@ 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;

static const double expandedWidgetHeight = 50;
}
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1614,7 +1614,7 @@ packages:
description:
path: "."
ref: master
resolved-ref: b87f765e777d8d8a3995a8c912d4becd414ba223
resolved-ref: ffbcb9dd4d6cefb7fb60b7a9b15ad684dae6bdff
url: "[email protected]:linagora/linagora-design-flutter.git"
source: git
version: "0.0.1"
Expand Down

0 comments on commit 3f226b5

Please sign in to comment.