Skip to content

Commit

Permalink
TW-1644: center the permission photo for text
Browse files Browse the repository at this point in the history
  • Loading branch information
sherlockvn committed May 29, 2024
1 parent 8127b3a commit a9cf343
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 15 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
3 changes: 1 addition & 2 deletions lib/pages/chat_details/chat_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ class ChatDetailsController extends State<ChatDetails>
void initValueNotifiers() {
room = Matrix.of(context).client.getRoomById(roomId!);
muteNotifier.value = room?.pushRuleState ?? PushRuleState.notify;
membersNotifier.value ??=
Matrix.of(context).client.getRoomById(roomId!)!.getParticipants();
membersNotifier.value ??= room?.getParticipants();
}

void _listenForRoomMembersChanged() {
Expand Down
15 changes: 9 additions & 6 deletions lib/presentation/mixins/media_picker_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:fluffychat/pages/chat/input_bar/focus_suggestion_controller.dart
import 'package:fluffychat/pages/chat/input_bar/input_bar.dart';
import 'package:fluffychat/pages/chat/item_actions_bottom_widget.dart';
import 'package:fluffychat/pages/chat/send_file_dialog/send_file_dialog_style.dart';
import 'package:fluffychat/presentation/mixins/media_picker_style.dart';
import 'package:fluffychat/resource/image_paths.dart';
import 'package:fluffychat/utils/platform_infos.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -236,18 +237,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
9 changes: 9 additions & 0 deletions lib/presentation/mixins/media_picker_style.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import 'package:flutter/material.dart';

class MediaPickerStyle {
static double photoPermissionIconSize = 48.0;

static double photoPermissionFontSize = 18;

static FontWeight photoPermissionFontWeight = FontWeight.w600;
}
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/mixins/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

0 comments on commit a9cf343

Please sign in to comment.