Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TW-1644: allow access to the gallery is not center #1815

Merged
merged 3 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading