Skip to content
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
15 changes: 14 additions & 1 deletion lib/bloc/setting_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ class SettingState extends Equatable {
bool? videoAutoDownload,
bool? fileAutoDownload,
bool? collapsedSidebar,
double? chatFontSizeDelta,
}) : _brightness = brightness,
_messageShowAvatar = messageShowAvatar,
_messagePreview = messagePreview,
_photoAutoDownload = photoAutoDownload,
_videoAutoDownload = videoAutoDownload,
_fileAutoDownload = fileAutoDownload,
_collapsedSidebar = collapsedSidebar;
_collapsedSidebar = collapsedSidebar,
_chatFontSizeDelta = chatFontSizeDelta;

factory SettingState.fromMap(Map<String, dynamic> map) => SettingState(
brightness: map['brightness'] as int?,
Expand All @@ -30,6 +32,7 @@ class SettingState extends Equatable {
videoAutoDownload: map['videoAutoDownload'] as bool?,
fileAutoDownload: map['fileAutoDownload'] as bool?,
collapsedSidebar: map['collapsedSidebar'] as bool?,
chatFontSizeDelta: map['chatFontSizeDelta'] as double?,
);

/// The brightness of theme.
Expand All @@ -49,6 +52,7 @@ class SettingState extends Equatable {
final bool? _videoAutoDownload;
final bool? _fileAutoDownload;
final bool? _collapsedSidebar;
final double? _chatFontSizeDelta;

int get brightness => _brightness ?? 0;

Expand All @@ -64,6 +68,8 @@ class SettingState extends Equatable {

bool get collapsedSidebar => _collapsedSidebar ?? false;

double get chatFontSizeDelta => _chatFontSizeDelta ?? 0;

@override
List<Object?> get props => [
_brightness,
Expand All @@ -73,6 +79,7 @@ class SettingState extends Equatable {
_videoAutoDownload,
_fileAutoDownload,
_collapsedSidebar,
_chatFontSizeDelta,
];

Map<String, dynamic> toMap() => {
Expand All @@ -83,6 +90,7 @@ class SettingState extends Equatable {
'videoAutoDownload': _videoAutoDownload,
'fileAutoDownload': _fileAutoDownload,
'collapsedSidebar': _collapsedSidebar,
'chatFontSizeDelta': _chatFontSizeDelta,
};

SettingState copyWith({
Expand All @@ -93,6 +101,7 @@ class SettingState extends Equatable {
bool? videoAutoDownload,
bool? fileAutoDownload,
bool? collapsedSidebar,
double? chatFontSizeDelta,
}) =>
SettingState(
brightness: brightness ?? _brightness,
Expand All @@ -102,6 +111,7 @@ class SettingState extends Equatable {
videoAutoDownload: videoAutoDownload ?? _videoAutoDownload,
fileAutoDownload: fileAutoDownload ?? _fileAutoDownload,
collapsedSidebar: collapsedSidebar ?? _collapsedSidebar,
chatFontSizeDelta: chatFontSizeDelta ?? _chatFontSizeDelta,
);
}

Expand Down Expand Up @@ -156,6 +166,9 @@ class SettingCubit extends HydratedCubit<SettingState> {
set collapsedSidebar(bool? value) =>
emit(state.copyWith(collapsedSidebar: value));

set chatFontSizeDelta(double? value) =>
emit(state.copyWith(chatFontSizeDelta: value));

void migrate({
bool? messagePreview,
bool? photoAutoDownload,
Expand Down
8 changes: 5 additions & 3 deletions lib/generated/intl/messages_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ class MessageLookup extends MessageLookupByLibrary {
"chatNotSupportViewOnPhone": MessageLookupByLibrary.simpleMessage(
"This type of message is not supported, please check on your phone."),
"chatPinMessage": m7,
"chatTextSize": MessageLookupByLibrary.simpleMessage("Chat Text Size"),
"checkNewVersion":
MessageLookupByLibrary.simpleMessage("Check new version"),
"circleSubtitle": m8,
Expand Down Expand Up @@ -302,6 +303,8 @@ class MessageLookup extends MessageLookupByLibrary {
"edit": MessageLookupByLibrary.simpleMessage("Edit"),
"editCircleName":
MessageLookupByLibrary.simpleMessage("Edit Circle Name"),
"editConversations":
MessageLookupByLibrary.simpleMessage("Edit Conversations"),
"editGroupDescription":
MessageLookupByLibrary.simpleMessage("Edit Group Description"),
"editGroupName":
Expand Down Expand Up @@ -439,6 +442,8 @@ class MessageLookup extends MessageLookupByLibrary {
"helpCenter": MessageLookupByLibrary.simpleMessage("Help center"),
"hideMixin": MessageLookupByLibrary.simpleMessage("Hide Mixin"),
"hour": m25,
"howAreYou": MessageLookupByLibrary.simpleMessage("Hi, how are you?"),
"iAmGood": MessageLookupByLibrary.simpleMessage("I’m good."),
"ignoreThisVersion":
MessageLookupByLibrary.simpleMessage("Ignore the new version"),
"image": MessageLookupByLibrary.simpleMessage("image"),
Expand Down Expand Up @@ -470,8 +475,6 @@ class MessageLookup extends MessageLookupByLibrary {
"Continue to log in and abort account deletion"),
"loginByQrcode": MessageLookupByLibrary.simpleMessage(
"Login to Mixin Messenger by QR Code"),
"loginByQrcodeTips": MessageLookupByLibrary.simpleMessage(
"Open Mixin Messenger on your phone, scan the QR Code on the screen and confirm your login."),
"loginByQrcodeTips1": MessageLookupByLibrary.simpleMessage(
"Open Mixin Messenger on your phone."),
"loginByQrcodeTips2": MessageLookupByLibrary.simpleMessage(
Expand Down Expand Up @@ -707,7 +710,6 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("What\'s your name?"),
"window": MessageLookupByLibrary.simpleMessage("Window"),
"withdrawal": MessageLookupByLibrary.simpleMessage("Withdraw"),
"writeCircles": MessageLookupByLibrary.simpleMessage("Write Circles"),
"you": MessageLookupByLibrary.simpleMessage("You"),
"youDeletedThisMessage":
MessageLookupByLibrary.simpleMessage("You deleted this message"),
Expand Down
2 changes: 2 additions & 0 deletions lib/generated/intl/messages_in.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("Durasi terlalu pendek"),
"editCircleName":
MessageLookupByLibrary.simpleMessage("Edit Nama Lingkaran"),
"editConversations":
MessageLookupByLibrary.simpleMessage("Edit Percakapan"),
"editGroupDescription":
MessageLookupByLibrary.simpleMessage("Edit deskripsi grup"),
"editGroupName": MessageLookupByLibrary.simpleMessage("Edit Nama"),
Expand Down
8 changes: 4 additions & 4 deletions lib/generated/intl/messages_ja.dart
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ class MessageLookup extends MessageLookupByLibrary {
"durationIsTooShort": MessageLookupByLibrary.simpleMessage("期間が短すぎます"),
"edit": MessageLookupByLibrary.simpleMessage("編集"),
"editCircleName": MessageLookupByLibrary.simpleMessage("グループリスト名を編集"),
"editConversations": MessageLookupByLibrary.simpleMessage("チャットルームを編集"),
"editGroupDescription":
MessageLookupByLibrary.simpleMessage("グループアナウンスを編集"),
"editGroupName": MessageLookupByLibrary.simpleMessage("グループ名を編集"),
Expand Down Expand Up @@ -383,6 +384,8 @@ class MessageLookup extends MessageLookupByLibrary {
"helpCenter": MessageLookupByLibrary.simpleMessage("ヘルプセンター"),
"hideMixin": MessageLookupByLibrary.simpleMessage("Mixinを非表示にする"),
"hour": m25,
"howAreYou": MessageLookupByLibrary.simpleMessage("こんにちは、調子はどうですか"),
"iAmGood": MessageLookupByLibrary.simpleMessage("いい気分"),
"ignoreThisVersion": MessageLookupByLibrary.simpleMessage("最新版を無視"),
"image": MessageLookupByLibrary.simpleMessage("画像"),
"includeFiles": MessageLookupByLibrary.simpleMessage("ファイルが含まれています"),
Expand Down Expand Up @@ -411,10 +414,8 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("そのままログインし、アカウント削除をキャンセルします"),
"loginByQrcode":
MessageLookupByLibrary.simpleMessage("QRコードでMixinにログインする"),
"loginByQrcodeTips": MessageLookupByLibrary.simpleMessage(
"携帯でMixinを開き、画面に表示されるQRコードを読み取り、ログインします"),
"loginByQrcodeTips1":
MessageLookupByLibrary.simpleMessage("携帯でMixinを開き"),
MessageLookupByLibrary.simpleMessage("携帯でMixinを開き"),
"loginByQrcodeTips2":
MessageLookupByLibrary.simpleMessage("画面に表示されるQRコードを読み取り、ログインします"),
"makeGroupAdmin": MessageLookupByLibrary.simpleMessage("管理者権限を付与"),
Expand Down Expand Up @@ -619,7 +620,6 @@ class MessageLookup extends MessageLookupByLibrary {
"whatsYourName": MessageLookupByLibrary.simpleMessage("お名前は何ですか?"),
"window": MessageLookupByLibrary.simpleMessage("Window"),
"withdrawal": MessageLookupByLibrary.simpleMessage("出金"),
"writeCircles": MessageLookupByLibrary.simpleMessage("グループリストの変更"),
"you": MessageLookupByLibrary.simpleMessage("自分"),
"youDeletedThisMessage":
MessageLookupByLibrary.simpleMessage("このメッセージを削除しました。")
Expand Down
3 changes: 2 additions & 1 deletion lib/generated/intl/messages_ms.dart
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("Jangka masa terlalu pendek"),
"editCircleName":
MessageLookupByLibrary.simpleMessage("Edit Nama Lingkaran"),
"editConversations":
MessageLookupByLibrary.simpleMessage("Edit Perbualan"),
"editGroupDescription":
MessageLookupByLibrary.simpleMessage("Edit keterangan kumpulan"),
"editGroupName": MessageLookupByLibrary.simpleMessage("Edit Nama"),
Expand Down Expand Up @@ -391,7 +393,6 @@ class MessageLookup extends MessageLookupByLibrary {
"whatsYourName":
MessageLookupByLibrary.simpleMessage("Siapa nama awak?"),
"withdrawal": MessageLookupByLibrary.simpleMessage("Pengeluaran"),
"writeCircles": MessageLookupByLibrary.simpleMessage("Tulis Lingkaran"),
"you": MessageLookupByLibrary.simpleMessage("Anda"),
"youDeletedThisMessage":
MessageLookupByLibrary.simpleMessage("Anda memadamkan mesej ini")
Expand Down
7 changes: 4 additions & 3 deletions lib/generated/intl/messages_ru.dart
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ class MessageLookup extends MessageLookupByLibrary {
"edit": MessageLookupByLibrary.simpleMessage("Редактировать"),
"editCircleName":
MessageLookupByLibrary.simpleMessage("Изменить название круга"),
"editConversations":
MessageLookupByLibrary.simpleMessage("Редактировать беседы"),
"editGroupDescription":
MessageLookupByLibrary.simpleMessage("Изменить описание группы"),
"editGroupName":
Expand Down Expand Up @@ -431,6 +433,8 @@ class MessageLookup extends MessageLookupByLibrary {
"helpCenter": MessageLookupByLibrary.simpleMessage("Центр помощи"),
"hideMixin": MessageLookupByLibrary.simpleMessage("Скрыть Mixin"),
"hour": m25,
"howAreYou": MessageLookupByLibrary.simpleMessage("Привет, как дела?"),
"iAmGood": MessageLookupByLibrary.simpleMessage("Я в порядке."),
"ignoreThisVersion":
MessageLookupByLibrary.simpleMessage("Игнорировать новую версию"),
"image": MessageLookupByLibrary.simpleMessage("изображение"),
Expand Down Expand Up @@ -462,8 +466,6 @@ class MessageLookup extends MessageLookupByLibrary {
"Продолжить вход и отменить удаление учетной записи"),
"loginByQrcode": MessageLookupByLibrary.simpleMessage(
"Войдите в Mixin Messenger по QR-коду"),
"loginByQrcodeTips": MessageLookupByLibrary.simpleMessage(
"Откройте Mixin Messenger на своем телефоне, отсканируйте QR-код на экране и подтвердите вход."),
"makeGroupAdmin": MessageLookupByLibrary.simpleMessage(
"Сделать администратором группы"),
"media": MessageLookupByLibrary.simpleMessage("Медиа"),
Expand Down Expand Up @@ -695,7 +697,6 @@ class MessageLookup extends MessageLookupByLibrary {
"whatsYourName": MessageLookupByLibrary.simpleMessage("Как вас зовут?"),
"window": MessageLookupByLibrary.simpleMessage("Окно"),
"withdrawal": MessageLookupByLibrary.simpleMessage("Вывести"),
"writeCircles": MessageLookupByLibrary.simpleMessage("Написать круги"),
"you": MessageLookupByLibrary.simpleMessage("Вы"),
"youDeletedThisMessage":
MessageLookupByLibrary.simpleMessage("Вы удалили это сообщение")
Expand Down
Loading