Skip to content

Commit

Permalink
Merge pull request #775 from bannzai/fix/wording/manual_rest
Browse files Browse the repository at this point in the history
休薬機能を「服用お休み」機能へと変更
  • Loading branch information
bannzai committed Mar 18, 2023
2 parents 93f2032 + 9abbf2f commit 445983c
Show file tree
Hide file tree
Showing 12 changed files with 198 additions and 146 deletions.
61 changes: 0 additions & 61 deletions images/explain_rest_duration.svg

This file was deleted.

61 changes: 61 additions & 0 deletions images/explain_rest_duration_date.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions images/explain_rest_duration_number.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ class PillSheetModifiedHistoryBeganRestDuration extends StatelessWidget {
}
return RowLayout(
day: Day(estimatedEventCausingDate: estimatedEventCausingDate),
effectiveNumbersOrHyphen: EffectivePillNumber(
effectivePillNumber:
PillSheetModifiedHistoryDateEffectivePillNumber.hyphen()),
effectiveNumbersOrHyphen: EffectivePillNumber(effectivePillNumber: PillSheetModifiedHistoryDateEffectivePillNumber.hyphen()),
detail: const Text(
"休薬開始",
"服用お休み",
style: TextStyle(
color: TextColor.main,
fontSize: 12,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ class PillSheetModifiedHistoryEndedRestDuration extends StatelessWidget {
}
return RowLayout(
day: Day(estimatedEventCausingDate: estimatedEventCausingDate),
effectiveNumbersOrHyphen: EffectivePillNumber(
effectivePillNumber:
PillSheetModifiedHistoryDateEffectivePillNumber.hyphen()),
effectiveNumbersOrHyphen: EffectivePillNumber(effectivePillNumber: PillSheetModifiedHistoryDateEffectivePillNumber.hyphen()),
detail: const Text(
"休薬終了",
"服用再開",
style: TextStyle(
color: TextColor.main,
fontSize: 12,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class RestDurationAnnouncementBar extends StatelessWidget {
final restDuration = activedPillSheet.activeRestDuration;
if (restDuration != null) {
final day = daysBetween(restDuration.beginDate.date(), today()) + 1;
return "休薬$day日目";
return "🌙 服用お休み $day日目";
}

if (activedPillSheet.typeInfo.dosingPeriod < activedPillSheet.todayPillNumber) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class RestDurationButton extends StatelessWidget {
style: TextButton.styleFrom(backgroundColor: PilllColors.disable),
onPressed: null,
child: const Text(
"休薬中",
"服用お休み中",
style: TextStyle(
color: TextColor.lightGray,
fontFamily: FontFamily.japanese,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ import 'package:pilll/utils/formatter/date_time_formatter.dart';

class RecordPageRestDurationDialog extends StatelessWidget {
final RecordPageRestDurationDialogTitle title;
final PillSheetAppearanceMode appearanceMode;
final VoidCallback onDone;

const RecordPageRestDurationDialog({
Key? key,
required this.title,
required this.appearanceMode,
required this.onDone,
}) : super(key: key);

Expand All @@ -29,44 +31,33 @@ class RecordPageRestDurationDialog extends StatelessWidget {
children: <Widget>[
title,
const SizedBox(height: 24),
const Text("休薬するとピル番号は進みません",
const Text("服用をお休みするとピル番号は進みません",
style: TextStyle(
fontFamily: FontFamily.japanese,
fontWeight: FontWeight.w300,
fontWeight: FontWeight.w500,
fontSize: 14,
color: TextColor.main,
)),
const SizedBox(height: 24),
SvgPicture.asset("images/explain_rest_duration.svg"),
const SizedBox(height: 24),
const Text(
"※休薬開始日を変えたい場合",
style: TextStyle(
Text(
appearanceMode == PillSheetAppearanceMode.date ? "例えば「1/12から3日間」服用お休みした場合" : "例えば「18番から3日間」服用お休みした場合",
style: const TextStyle(
color: TextColor.main,
fontSize: 14,
fontFamily: FontFamily.japanese,
fontWeight: FontWeight.w700,
),
textAlign: TextAlign.left,
),
const SizedBox(height: 8),
const Text(
"希望日まで未服用にする必要があります。服用済みのピルマークをタップすることで未服用にできます",
style: TextStyle(
color: TextColor.main,
fontFamily: FontFamily.japanese,
fontSize: 14,
fontWeight: FontWeight.w400,
fontSize: 12,
),
textAlign: TextAlign.left,
),
const SizedBox(height: 8),
SvgPicture.asset(
appearanceMode == PillSheetAppearanceMode.date ? "images/explain_rest_duration_date.svg" : "images/explain_rest_duration_number.svg"),
const SizedBox(height: 24),
],
),
actions: <Widget>[
AppOutlinedButton(
onPressed: () async => onDone(),
text: "休薬する",
text: "服用をお休みする",
),
Center(
child: AlertButton(
Expand All @@ -92,6 +83,7 @@ showRecordPageRestDurationDialog(
context: context,
builder: (context) => RecordPageRestDurationDialog(
title: RecordPageRestDurationDialogTitle(appearanceMode: appearanceMode, activedPillSheet: activedPillSheet, pillSheetGroup: pillSheetGroup),
appearanceMode: appearanceMode,
onDone: onDone,
),
);
Expand All @@ -111,11 +103,11 @@ class RecordPageRestDurationDialogTitle extends StatelessWidget {

@override
Widget build(BuildContext context) {
return Text("$_numberから休薬しますか?",
return Text("$_numberから服用をお休みしますか?",
style: const TextStyle(
color: TextColor.main,
fontSize: 16,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
fontFamily: FontFamily.japanese,
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,32 @@ class BeginManualRestDurationButton extends HookConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final beginRestDuration = ref.watch(beginRestDurationProvider);

return SizedBox(
width: 80,
child: SmallAppOutlinedButton(
text: "休薬する",
onPressed: () async {
analytics.logEvent(name: "begin_manual_rest_duration_pressed", parameters: {"pill_sheet_id": activedPillSheet.id});
return SmallAppOutlinedButton(
text: "服用お休み",
onPressed: () async {
analytics.logEvent(name: "begin_manual_rest_duration_pressed", parameters: {"pill_sheet_id": activedPillSheet.id});

if (activedPillSheet.todayPillIsAlreadyTaken) {
showInvalidAlreadyTakenPillDialog(context);
} else {
showRecordPageRestDurationDialog(
context,
appearanceMode: appearanceMode,
pillSheetGroup: pillSheetGroup,
activedPillSheet: activedPillSheet,
onDone: () async {
analytics.logEvent(name: "done_rest_duration");
// NOTE: batch.commit でリモートのDBに書き込む時間がかかるので事前にバッジを0にする
FlutterAppBadger.removeBadge();
await beginRestDuration(
activePillSheet: activedPillSheet,
pillSheetGroup: pillSheetGroup,
);
didBeginRestDuration();
},
);
}
},
),
if (activedPillSheet.todayPillIsAlreadyTaken) {
showInvalidAlreadyTakenPillDialog(context);
} else {
showRecordPageRestDurationDialog(
context,
appearanceMode: appearanceMode,
pillSheetGroup: pillSheetGroup,
activedPillSheet: activedPillSheet,
onDone: () async {
analytics.logEvent(name: "done_rest_duration");
// NOTE: batch.commit でリモートのDBに書き込む時間がかかるので事前にバッジを0にする
FlutterAppBadger.removeBadge();
await beginRestDuration(
activePillSheet: activedPillSheet,
pillSheetGroup: pillSheetGroup,
);
didBeginRestDuration();
},
);
}
},
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,21 @@ class EndManualRestDurationButton extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final endRestDuration = ref.watch(endRestDurationProvider);
return SizedBox(
width: 80,
child: SmallAppOutlinedButton(
text: "休薬終了",
onPressed: () async {
analytics.logEvent(
name: "end_manual_rest_duration_pressed",
);
return SmallAppOutlinedButton(
text: "服用再開",
onPressed: () async {
analytics.logEvent(
name: "end_manual_rest_duration_pressed",
);

await endRestDuration(
restDuration: restDuration,
activePillSheet: activedPillSheet,
pillSheetGroup: pillSheetGroup,
);
await endRestDuration(
restDuration: restDuration,
activePillSheet: activedPillSheet,
pillSheetGroup: pillSheetGroup,
);

didEndRestDuration();
},
),
didEndRestDuration();
},
);
}
}
Expand Down Expand Up @@ -80,7 +77,7 @@ class EndRestDurationModal extends HookConsumerWidget {
borderRadius: BorderRadius.circular(50),
),
child: const Text(
"休薬期間終了",
"服用お休み期間終了",
textAlign: TextAlign.center,
style: TextStyle(
color: TextColor.white,
Expand Down Expand Up @@ -114,6 +111,15 @@ class EndRestDurationModal extends HookConsumerWidget {
fontWeight: FontWeight.w400,
),
),
const Text(
"お休みした分だけシート上の曜日もずれます",
style: TextStyle(
color: TextColor.main,
fontSize: 14,
fontFamily: FontFamily.japanese,
fontWeight: FontWeight.w400,
),
),
],
),
const SizedBox(height: 24),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class InvalidAlreadyTakenPillDialog extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const Text(
"今日飲むピルが服用済みの場合\n休薬できません",
"今日飲むピルが服用済みの場合\n「服用お休み」できません",
style: TextStyle(
fontFamily: FontFamily.japanese,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
fontSize: 16,
color: TextColor.main,
),
Expand All @@ -45,13 +45,13 @@ class InvalidAlreadyTakenPillDialog extends StatelessWidget {
text: "今日飲むピルを未服用にしてから",
style: TextStyle(
fontFamily: FontFamily.japanese,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
fontSize: 14,
color: TextColor.main,
),
),
TextSpan(
text: "休薬してください。今日以外の日から休薬したい場合は下記を参考にしてください。",
text: "お休みしてください。今日以外の日から服用お休みしたい場合は下記を参考にしてください。",
style: TextStyle(
fontFamily: FontFamily.japanese,
fontWeight: FontWeight.w300,
Expand All @@ -70,7 +70,7 @@ class InvalidAlreadyTakenPillDialog extends StatelessWidget {
analytics.logEvent(name: "invalid_already_taken_pill_faq");
launchUrl(Uri.parse("https://pilll.wraptas.site/467128e667ae4d6cbff4d61ee370cce5"));
},
text: "休薬機能の使い方を見る",
text: "服用お休み機能の使い方を見る",
),
Center(
child: AlertButton(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class RecordPagePillSheetSupportActions extends StatelessWidget {
duration: Duration(
seconds: 2,
),
content: Text("休薬期間が終了しました"),
content: Text("服用のお休み期間が終了しました"),
),
);
}
Expand All @@ -76,7 +76,7 @@ class RecordPagePillSheetSupportActions extends StatelessWidget {
duration: Duration(
seconds: 2,
),
content: Text("休薬期間が始まりました"),
content: Text("服用お休みを開始しました"),
),
);
Navigator.of(context).pop();
Expand Down

0 comments on commit 445983c

Please sign in to comment.