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

feat: fcm topic subscribe #194

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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 .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
env:
FLUTTER_VERSION: "3.24.0"
JAVA_VERSION: "17"
XCODE_VERSION: "Xcode_16_beta_6"
XCODE_VERSION: "Xcode_16_Release_Candidate"

jobs:
build-android:
Expand Down
5 changes: 5 additions & 0 deletions assets/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@
"language": "Language",
"korean": "Korean",
"english": "English",
"get_alarm" : "Receive notifications",
"get_alarm_desc" : "Receive notifications about various topics",
"get_promotion_alarm" : "Receive promotion notifications",
"get_information_alarm" : "Receive information notifications",
"get_subject_suggestion_alarm" : "Receive subject suggestion notification",
"send_error_log": "Send error log",
"send_error_log_desc": "Automatically collect logs without user reporting",
"send_anonymously": "Send anonymously",
Expand Down
5 changes: 5 additions & 0 deletions assets/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@
"language": "언어",
"korean": "한국어",
"english": "영어",
"get_alarm" : "알림 받기",
"get_alarm_desc" : "다양한 주제에 대한 알림을 수신합니다.",
"get_promotion_alarm" : "광고성 알림 수신",
"get_information_alarm" : "정보성 알림 수신",
"get_subject_suggestion_alarm" : "과목 제안 알림 수신",
"send_error_log": "오류 로그 전송",
"send_error_log_desc": "사용자의 제보 없이 자동으로 오류를 수집합니다.",
"send_anonymously": "익명으로 전송",
Expand Down

This file was deleted.

303 changes: 180 additions & 123 deletions lib/pages/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,146 +26,203 @@
color: OTLColor.grayF,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"settings.language".tr(),
style: bodyBold,
),
Dropdown<bool>(
customButton: Container(
height: 34,
padding: const EdgeInsets.symmetric(horizontal: 16),
decoration: BoxDecoration(
color: OTLColor.pinksLight,
borderRadius: BorderRadius.circular(20),
),
child: Row(
children: [
Icon(
Icons.language,
color: OTLColor.pinksMain,
),
const SizedBox(width: 8),
Text(
isEn
? "settings.english".tr()
: "settings.korean".tr(),
style: bodyBold.copyWith(
height: 1.2, color: OTLColor.pinksMain),
)
],
),
child: SingleChildScrollView(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"settings.language".tr(),
style: bodyBold,
),
items: [
ItemData(
value: false,
text: "settings.korean".tr(),
icon: !isEn ? Icons.check : null,
Dropdown<bool>(
customButton: Container(
height: 34,
padding: const EdgeInsets.symmetric(horizontal: 16),
decoration: BoxDecoration(
color: OTLColor.pinksLight,
borderRadius: BorderRadius.circular(20),
),
child: Row(
children: [
Icon(
Icons.language,
color: OTLColor.pinksMain,
),
const SizedBox(width: 8),
Text(
isEn
? "settings.english".tr()

Check warning on line 56 in lib/pages/settings_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/settings_page.dart#L56

Added line #L56 was not covered by tests
: "settings.korean".tr(),
style: bodyBold.copyWith(
height: 1.2, color: OTLColor.pinksMain),
)
],
),
),
ItemData(
value: true,
text: "settings.english".tr(),
icon: isEn ? Icons.check : null,
),
],
isIconLeft: true,
offsetY: -6,
onChanged: (value) {
if (value!) {
EasyLocalization.of(context)?.setLocale(Locale('en'));
} else {
EasyLocalization.of(context)?.setLocale(Locale('ko'));
}
},
items: [
ItemData(
value: false,
text: "settings.korean".tr(),
icon: !isEn ? Icons.check : null,
),
ItemData(
value: true,
text: "settings.english".tr(),
icon: isEn ? Icons.check : null,
),
],
isIconLeft: true,
offsetY: -6,
onChanged: (value) {

Check warning on line 78 in lib/pages/settings_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/settings_page.dart#L78

Added line #L78 was not covered by tests
if (value!) {
EasyLocalization.of(context)
?.setLocale(Locale('en'));

Check warning on line 81 in lib/pages/settings_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/settings_page.dart#L80-L81

Added lines #L80 - L81 were not covered by tests
} else {
EasyLocalization.of(context)
?.setLocale(Locale('ko'));

Check warning on line 84 in lib/pages/settings_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/settings_page.dart#L83-L84

Added lines #L83 - L84 were not covered by tests
}
},
),
],
),
// TODO : UI 좀 예쁘게 어떻게 안되나 + 번역 추가
_buildListTile(
title: "settings.get_alarm".tr(),
subtitle: "settings.get_alarm_desc".tr(),
trailing: CupertinoSwitch(
value: context.watch<SettingsModel>().getSendAlarm(),
onChanged: (value) =>
context.read<SettingsModel>().setSendAlarm(value),

Check warning on line 97 in lib/pages/settings_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/settings_page.dart#L96-L97

Added lines #L96 - L97 were not covered by tests
),
],
),
_buildListTile(
title: "settings.send_error_log".tr(),
subtitle: "settings.send_error_log_desc".tr(),
trailing: CupertinoSwitch(
value: context.watch<SettingsModel>().getSendCrashlytics(),
onChanged: (value) =>
context.read<SettingsModel>().setSendCrashlytics(value),
),
),
Visibility(
visible: context.watch<SettingsModel>().getSendCrashlytics(),
child: _buildListTile(
title: "settings.send_anonymously".tr(),
subtitle: "settings.send_anonymously_desc".tr(),
Visibility(
visible: context.watch<SettingsModel>().getSendAlarm(),
child: _buildListTile(
title: "settings.get_subject_suggestion_alarm".tr(),
trailing: CupertinoSwitch(
value: context
.watch<SettingsModel>()
.getSubjectSuggestionAlarm(),
onChanged: (value) => context
.read<SettingsModel>()
.setSubjectSuggestionAlarm(value),

Check warning on line 110 in lib/pages/settings_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/settings_page.dart#L108-L110

Added lines #L108 - L110 were not covered by tests
),
),
),
Visibility(
visible: context.watch<SettingsModel>().getSendAlarm(),
child: _buildListTile(
title: "settings.get_promotion_alarm".tr(),
trailing: CupertinoSwitch(
value:
context.watch<SettingsModel>().getPromotionAlarm(),
onChanged: (value) => context
.read<SettingsModel>()
.setPromotionAlarm(value),

Check warning on line 123 in lib/pages/settings_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/settings_page.dart#L121-L123

Added lines #L121 - L123 were not covered by tests
),
),
),
Visibility(
visible: context.watch<SettingsModel>().getSendAlarm(),
child: _buildListTile(
title: "settings.get_information_alarm".tr(),
trailing: CupertinoSwitch(
value:
context.watch<SettingsModel>().getInfomationAlarm(),
onChanged: (value) => context
.read<SettingsModel>()
.setInformationAlarm(value),

Check warning on line 136 in lib/pages/settings_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/settings_page.dart#L134-L136

Added lines #L134 - L136 were not covered by tests
),
),
),
_buildListTile(
title: "settings.send_error_log".tr(),
subtitle: "settings.send_error_log_desc".tr(),
trailing: CupertinoSwitch(
value: context
.watch<SettingsModel>()
.getSendCrashlyticsAnonymously(),
value:
context.watch<SettingsModel>().getSendCrashlytics(),
onChanged: (value) => context
.read<SettingsModel>()
.setSendCrashlyticsAnonymously(value),
.setSendCrashlytics(value),

Check warning on line 148 in lib/pages/settings_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/settings_page.dart#L148

Added line #L148 was not covered by tests
),
),
),
_buildListTile(
title: "settings.show_channel_talk_button".tr(),
trailing: CupertinoSwitch(
value: context
.watch<SettingsModel>()
.getShowsChannelTalkButton(),
onChanged: (value) {
context
.read<SettingsModel>()
.setShowsChannelTalkButton(value);
Visibility(
visible:
context.watch<SettingsModel>().getSendCrashlytics(),
child: _buildListTile(
title: "settings.send_anonymously".tr(),
subtitle: "settings.send_anonymously_desc".tr(),
trailing: CupertinoSwitch(
value: context
.watch<SettingsModel>()
.getSendCrashlyticsAnonymously(),
onChanged: (value) => context
.read<SettingsModel>()
.setSendCrashlyticsAnonymously(value),

Check warning on line 163 in lib/pages/settings_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/settings_page.dart#L161-L163

Added lines #L161 - L163 were not covered by tests
),
),
),
_buildListTile(
title: "settings.show_channel_talk_button".tr(),
trailing: CupertinoSwitch(
value: context
.watch<SettingsModel>()
.getShowsChannelTalkButton(),
onChanged: (value) {

Check warning on line 173 in lib/pages/settings_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/settings_page.dart#L173

Added line #L173 was not covered by tests
context
.read<SettingsModel>()
.setShowsChannelTalkButton(value);

Check warning on line 176 in lib/pages/settings_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/settings_page.dart#L175-L176

Added lines #L175 - L176 were not covered by tests

if (!value) {
ChannelTalk.hideChannelButton();
} else {
ChannelTalk.showChannelButton();
}
},
if (!value) {
ChannelTalk.hideChannelButton();

Check warning on line 179 in lib/pages/settings_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/settings_page.dart#L179

Added line #L179 was not covered by tests
} else {
ChannelTalk.showChannelButton();

Check warning on line 181 in lib/pages/settings_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/settings_page.dart#L181

Added line #L181 was not covered by tests
}
},
),
),
),
Visibility(
visible: kDebugMode,
child: _buildListTile(
title: "settings.throw_test".tr(),
subtitle: "settings.throw_test_desc".tr(),
onTap: () => throw Exception(),
Visibility(
visible: kDebugMode,
child: _buildListTile(
title: "settings.throw_test".tr(),
subtitle: "settings.throw_test_desc".tr(),
onTap: () => throw Exception(),

Check warning on line 191 in lib/pages/settings_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/settings_page.dart#L191

Added line #L191 was not covered by tests
),
),
),
_buildListTile(
title: "settings.reset_all".tr(),
onTap: () {
OTLNavigator.pushDialog(
_buildListTile(
title: "settings.reset_all".tr(),
onTap: () {
OTLNavigator.pushDialog(

Check warning on line 197 in lib/pages/settings_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/settings_page.dart#L196-L197

Added lines #L196 - L197 were not covered by tests
context: context,
builder: (_) => OTLDialog(

Check warning on line 199 in lib/pages/settings_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/settings_page.dart#L199

Added line #L199 was not covered by tests
type: OTLDialogType.resetSettings,
onTapPos: () =>
context.read<SettingsModel>().clearAllValues(),

Check warning on line 202 in lib/pages/settings_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/settings_page.dart#L201-L202

Added lines #L201 - L202 were not covered by tests
),
);
},
),
_buildListTile(
title: "settings.about".tr(),
onTap: () => OTLNavigator.pushDialog(

Check warning on line 209 in lib/pages/settings_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/settings_page.dart#L209

Added line #L209 was not covered by tests
context: context,
builder: (_) => OTLDialog(
type: OTLDialogType.resetSettings,
onTapPos: () =>
context.read<SettingsModel>().clearAllValues(),
),
);
},
),
_buildListTile(
title: "settings.about".tr(),
onTap: () => OTLNavigator.pushDialog(
context: context,
builder: (_) => OTLDialog(
type: OTLDialogType.about,
onTapContent: () =>
launchUrl(Uri.parse("mailto:$CONTACT")),
onTapPos: () => showLicensePage(
context: context,
applicationName: "",
applicationIcon:
Image.asset("assets/images/logo.png", height: 48.0),
type: OTLDialogType.about,
onTapContent: () =>
launchUrl(Uri.parse("mailto:$CONTACT")),
onTapPos: () => showLicensePage(

Check warning on line 215 in lib/pages/settings_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/settings_page.dart#L213-L215

Added lines #L213 - L215 were not covered by tests
context: context,
applicationName: "",
applicationIcon: Image.asset("assets/images/logo.png",

Check warning on line 218 in lib/pages/settings_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/settings_page.dart#L218

Added line #L218 was not covered by tests
height: 48.0),
),
),
),
),
),
],
],
),
),
),
),
Expand Down
Loading
Loading