diff --git a/lib/app.dart b/lib/app.dart index e572c4eef7..1fc9ba78bd 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -18,9 +18,7 @@ class App extends StatelessWidget { Widget build(BuildContext context) { return MaterialApp( navigatorKey: navigatorKey, - navigatorObservers: [ - FirebaseAnalyticsObserver(analytics: firebaseAnalytics) - ], + navigatorObservers: [FirebaseAnalyticsObserver(analytics: firebaseAnalytics)], theme: ThemeData( useMaterial3: false, appBarTheme: const AppBarTheme( @@ -55,8 +53,7 @@ class App extends StatelessWidget { headerBackgroundColor: PilllColors.primary, ), switchTheme: SwitchThemeData( - thumbColor: WidgetStateProperty.resolveWith( - (Set states) { + thumbColor: WidgetStateProperty.resolveWith((Set states) { if (states.contains(WidgetState.disabled)) { return null; } @@ -65,8 +62,7 @@ class App extends StatelessWidget { } return null; }), - trackColor: WidgetStateProperty.resolveWith( - (Set states) { + trackColor: WidgetStateProperty.resolveWith((Set states) { if (states.contains(WidgetState.disabled)) { return null; } @@ -77,8 +73,7 @@ class App extends StatelessWidget { }), ), radioTheme: RadioThemeData( - fillColor: WidgetStateProperty.resolveWith( - (Set states) { + fillColor: WidgetStateProperty.resolveWith((Set states) { if (states.contains(WidgetState.disabled)) { return null; } @@ -90,8 +85,7 @@ class App extends StatelessWidget { }), ), checkboxTheme: CheckboxThemeData( - fillColor: WidgetStateProperty.resolveWith( - (Set states) { + fillColor: WidgetStateProperty.resolveWith((Set states) { if (states.contains(WidgetState.disabled)) { return null; } diff --git a/lib/components/atoms/button.dart b/lib/components/atoms/button.dart index 0a75e46f3b..2bd1e4dc48 100644 --- a/lib/components/atoms/button.dart +++ b/lib/components/atoms/button.dart @@ -22,8 +22,7 @@ class PrimaryButton extends HookWidget { alignment: Alignment.center, children: [ ElevatedButton( - style: ButtonStyle( - backgroundColor: WidgetStateProperty.resolveWith((statuses) { + style: ButtonStyle(backgroundColor: WidgetStateProperty.resolveWith((statuses) { if (statuses.contains(WidgetState.disabled)) { return PilllColors.lightGray; } @@ -46,8 +45,7 @@ class PrimaryButton extends HookWidget { } }, child: ConstrainedBox( - constraints: const BoxConstraints( - maxHeight: 44, minHeight: 44, minWidth: 180), + constraints: const BoxConstraints(maxHeight: 44, minHeight: 44, minWidth: 180), child: Center( child: Text(text, style: const TextStyle( @@ -82,8 +80,7 @@ class UndoButton extends HookWidget { alignment: Alignment.center, children: [ ElevatedButton( - style: ButtonStyle( - backgroundColor: WidgetStateProperty.resolveWith((statuses) { + style: ButtonStyle(backgroundColor: WidgetStateProperty.resolveWith((statuses) { if (statuses.contains(WidgetState.disabled)) { return PilllColors.lightGray; } @@ -106,8 +103,7 @@ class UndoButton extends HookWidget { } }, child: ConstrainedBox( - constraints: const BoxConstraints( - maxHeight: 44, minHeight: 44, minWidth: 180, maxWidth: 180), + constraints: const BoxConstraints(maxHeight: 44, minHeight: 44, minWidth: 180, maxWidth: 180), child: Center( child: Text(text, style: const TextStyle( @@ -213,11 +209,7 @@ class InconspicuousButton extends HookWidget { child: Stack( alignment: Alignment.center, children: [ - Text(text, - style: TextStyle( - color: isProcessing.value - ? TextColor.lightGray - : TextColor.gray)), + Text(text, style: TextStyle(color: isProcessing.value ? TextColor.lightGray : TextColor.gray)), if (isProcessing.value) _Loading(), ], ), @@ -381,13 +373,7 @@ class AlertButton extends HookWidget { children: [ Text( text, - style: TextStyle( - fontFamily: FontFamily.japanese, - fontWeight: FontWeight.w600, - fontSize: 14, - color: (isProcessing.value || onPressed == null) - ? TextColor.gray - : TextColor.primary), + style: TextStyle(fontFamily: FontFamily.japanese, fontWeight: FontWeight.w600, fontSize: 14, color: (isProcessing.value || onPressed == null) ? TextColor.gray : TextColor.primary), ), if (isProcessing.value) _Loading(), ], diff --git a/lib/components/atoms/color.dart b/lib/components/atoms/color.dart index 8cb7d7e44e..d036b3af9e 100644 --- a/lib/components/atoms/color.dart +++ b/lib/components/atoms/color.dart @@ -35,8 +35,7 @@ abstract class PilllColors { static const Color duration = Color(0xFF6A7DA5); static final Color overlay = secondary.withAlpha(20); - static final Color modalBackground = - const Color(0xFF333333).withAlpha((255 * 0.7).round()); + static final Color modalBackground = const Color(0xFF333333).withAlpha((255 * 0.7).round()); static const Color white = Colors.white; static Color get disabledSheet => PilllColors.pillSheet; diff --git a/lib/components/molecules/diagonal_striped_line.dart b/lib/components/molecules/diagonal_striped_line.dart index d37aebbd44..d099c3510c 100644 --- a/lib/components/molecules/diagonal_striped_line.dart +++ b/lib/components/molecules/diagonal_striped_line.dart @@ -8,8 +8,7 @@ class DiagonalStripedLine extends CustomPainter { DiagonalStripedLine({required this.color, required this.isNecessaryBorder}); @override void paint(Canvas canvas, Size size) { - canvas.drawRect( - Rect.fromLTWH(0, 0, size.width, size.height), Paint()..color = color); + canvas.drawRect(Rect.fromLTWH(0, 0, size.width, size.height), Paint()..color = color); if (!isNecessaryBorder) { return; } diff --git a/lib/components/molecules/dots_page_indicator.dart b/lib/components/molecules/dots_page_indicator.dart index 93b4d5d477..f870da295d 100644 --- a/lib/components/molecules/dots_page_indicator.dart +++ b/lib/components/molecules/dots_page_indicator.dart @@ -22,8 +22,7 @@ class DotsIndicator extends AnimatedWidget { } Widget _buildDot(int index) { - final isSelected = - index == (controller.page ?? controller.initialPage).round(); + final isSelected = index == (controller.page ?? controller.initialPage).round(); return SizedBox( width: 25, child: Center( diff --git a/lib/components/molecules/dotted_line.dart b/lib/components/molecules/dotted_line.dart index f66e6010f8..8301329e29 100644 --- a/lib/components/molecules/dotted_line.dart +++ b/lib/components/molecules/dotted_line.dart @@ -26,8 +26,7 @@ class DottedLine extends StatelessWidget { width: double.infinity, height: 1, child: LayoutBuilder(builder: (context, constraints) { - final dashAndDashGapCount = _calculateDashAndDashGapCount( - min(constraints.maxWidth, lineLength)); + final dashAndDashGapCount = _calculateDashAndDashGapCount(min(constraints.maxWidth, lineLength)); return Wrap( direction: Axis.horizontal, diff --git a/lib/components/molecules/indicator.dart b/lib/components/molecules/indicator.dart index d7e306091e..9f3ed7707c 100644 --- a/lib/components/molecules/indicator.dart +++ b/lib/components/molecules/indicator.dart @@ -19,8 +19,7 @@ class Indicator extends StatelessWidget { ); } return const Center( - child: CircularProgressIndicator( - valueColor: AlwaysStoppedAnimation(PilllColors.secondary)), + child: CircularProgressIndicator(valueColor: AlwaysStoppedAnimation(PilllColors.secondary)), ); } } diff --git a/lib/components/molecules/select_circle.dart b/lib/components/molecules/select_circle.dart index 730f8d9e76..febc57e28d 100644 --- a/lib/components/molecules/select_circle.dart +++ b/lib/components/molecules/select_circle.dart @@ -10,17 +10,8 @@ class SelectCircle extends StatelessWidget { Widget build(BuildContext context) { return Stack( children: [ - SizedBox( - width: 20, - height: 20, - child: SvgPicture.asset("images/circle.line.svg")), - if (isSelected) - Positioned( - top: 5, - left: 5, - width: 10, - height: 10, - child: SvgPicture.asset("images/circle.fill.svg")), + SizedBox(width: 20, height: 20, child: SvgPicture.asset("images/circle.line.svg")), + if (isSelected) Positioned(top: 5, left: 5, width: 10, height: 10, child: SvgPicture.asset("images/circle.fill.svg")), ], ); } diff --git a/lib/components/organisms/calendar/band/calendar_band_function.dart b/lib/components/organisms/calendar/band/calendar_band_function.dart index 67ea4c707d..e4a5760616 100644 --- a/lib/components/organisms/calendar/band/calendar_band_function.dart +++ b/lib/components/organisms/calendar/band/calendar_band_function.dart @@ -11,9 +11,7 @@ import 'package:pilll/utils/datetime/day.dart'; // 予定されている生理日 // maxDateRangeCountは主にユニットテストの時に嬉しい引数になっているがプロダクションコードでもそのまま使用している // ユースケースとして大体の未来のものを返せれば良いので厳密な計算結果が欲しいわけではないので動作確認とユニットテストをしやすい方式をとっている -List scheduledMenstruationDateRanges(PillSheetGroup? pillSheetGroup, - Setting? setting, List menstruations, - [int maxDateRangeCount = 15]) { +List scheduledMenstruationDateRanges(PillSheetGroup? pillSheetGroup, Setting? setting, List menstruations, [int maxDateRangeCount = 15]) { if (pillSheetGroup == null || setting == null) { return []; } @@ -25,31 +23,22 @@ List scheduledMenstruationDateRanges(PillSheetGroup? pillSheetGroup, } assert(maxDateRangeCount > 0); - final scheduledMenstruationDateRanges = - pillSheetGroup.menstruationDateRanges(setting: setting); + final scheduledMenstruationDateRanges = pillSheetGroup.menstruationDateRanges(setting: setting); List dateRanges = scheduledMenstruationDateRanges; - final pillSheetGroupTotalPillCount = pillSheetGroup.pillSheetTypes - .fold(0, (p, e) => p + e.typeInfo.totalCount); + final pillSheetGroupTotalPillCount = pillSheetGroup.pillSheetTypes.fold(0, (p, e) => p + e.typeInfo.totalCount); for (var i = 1; i <= maxDateRangeCount; i++) { final offset = pillSheetGroupTotalPillCount * i; - final dateRangesWithOffset = scheduledMenstruationDateRanges - .map((e) => DateRange(e.begin.addDays(offset), e.end.addDays(offset))) - .toList(); + final dateRangesWithOffset = scheduledMenstruationDateRanges.map((e) => DateRange(e.begin.addDays(offset), e.end.addDays(offset))).toList(); dateRanges = [...dateRanges, ...dateRangesWithOffset]; } final menstruationDateRanges = menstruations.map((e) => e.dateRange); // `今日より前の生理予定日` と `すでに記録済みの生理予定日` はこのタイミングで除外する。scheduledMenstruationDateRangesを作成するタイミングだと後続のoffsetを含めた処理に影響が出る。 // 例えば現在2シートめでこのwhere句でフィルタリングしてしまうと、1シート目とoffsetを考慮した生理予定日が表示されないようになる - dateRanges = dateRanges - .where((scheduledMenstruationRange) => - !scheduledMenstruationRange.end.isBefore(today())) - .where((scheduledMenstruationRange) { + dateRanges = dateRanges.where((scheduledMenstruationRange) => !scheduledMenstruationRange.end.isBefore(today())).where((scheduledMenstruationRange) { // すでに記録されている生理については除外したものを予定されている生理とする return menstruationDateRanges - .where((menstruationDateRange) => - menstruationDateRange.inRange(scheduledMenstruationRange.begin) || - menstruationDateRange.inRange(scheduledMenstruationRange.end)) + .where((menstruationDateRange) => menstruationDateRange.inRange(scheduledMenstruationRange.begin) || menstruationDateRange.inRange(scheduledMenstruationRange.end)) .isEmpty; }).toList(); @@ -61,16 +50,13 @@ List scheduledMenstruationDateRanges(PillSheetGroup? pillSheetGroup, } } -List nextPillSheetDateRanges(PillSheetGroup pillSheetGroup, - [int maxDateRangeCount = 15]) { +List nextPillSheetDateRanges(PillSheetGroup pillSheetGroup, [int maxDateRangeCount = 15]) { if (pillSheetGroup.pillSheets.isEmpty) { return []; } assert(maxDateRangeCount > 0); - final totalPillCount = pillSheetGroup.pillSheets - .map((e) => e.pillSheetType.totalCount) - .reduce((value, element) => value + element); + final totalPillCount = pillSheetGroup.pillSheets.map((e) => e.pillSheetType.totalCount).reduce((value, element) => value + element); var dateRanges = []; for (int i = 0; i < maxDateRangeCount; i++) { final offset = totalPillCount * i; @@ -89,8 +75,7 @@ List nextPillSheetDateRanges(PillSheetGroup pillSheetGroup, } } -int bandLength( - DateRange range, CalendarBandModel bandModel, bool isLineBreaked) { +int bandLength(DateRange range, CalendarBandModel bandModel, bool isLineBreaked) { return range .union( DateRange( @@ -107,7 +92,5 @@ bool isNecessaryLineBreak(DateTime date, DateRange dateRange) { } int offsetForStartPositionAtLine(DateTime begin, DateRange dateRange) { - return isNecessaryLineBreak(begin, dateRange) - ? 0 - : daysBetween(dateRange.begin.date(), begin.date()); + return isNecessaryLineBreak(begin, dateRange) ? 0 : daysBetween(dateRange.begin.date(), begin.date()); } diff --git a/lib/components/organisms/calendar/band/calendar_band_model.dart b/lib/components/organisms/calendar/band/calendar_band_model.dart index c91a91c684..a91057f8a0 100644 --- a/lib/components/organisms/calendar/band/calendar_band_model.dart +++ b/lib/components/organisms/calendar/band/calendar_band_model.dart @@ -12,8 +12,7 @@ class CalendarScheduledMenstruationBandModel extends CalendarBandModel { class CalendarMenstruationBandModel extends CalendarBandModel { final Menstruation menstruation; - CalendarMenstruationBandModel(this.menstruation) - : super(menstruation.beginDate, menstruation.endDate); + CalendarMenstruationBandModel(this.menstruation) : super(menstruation.beginDate, menstruation.endDate); } class CalendarNextPillSheetBandModel extends CalendarBandModel { diff --git a/lib/components/organisms/calendar/band/calendar_band_provider.dart b/lib/components/organisms/calendar/band/calendar_band_provider.dart index 40a3e6f2b7..37e4cd2693 100644 --- a/lib/components/organisms/calendar/band/calendar_band_provider.dart +++ b/lib/components/organisms/calendar/band/calendar_band_provider.dart @@ -6,8 +6,7 @@ import 'package:pilll/provider/pill_sheet_group.dart'; import 'package:pilll/provider/setting.dart'; import 'package:riverpod/riverpod.dart'; -final calendarMenstruationBandListProvider = - Provider>>((ref) { +final calendarMenstruationBandListProvider = Provider>>((ref) { final allMenstruations = ref.watch(allMenstruationProvider); if (allMenstruations is AsyncLoading) { @@ -16,17 +15,14 @@ final calendarMenstruationBandListProvider = try { return AsyncValue.data( - allMenstruations.value! - .map((menstruation) => CalendarMenstruationBandModel(menstruation)) - .toList(), + allMenstruations.value!.map((menstruation) => CalendarMenstruationBandModel(menstruation)).toList(), ); } catch (error, stackTrace) { return AsyncValue.error(error, stackTrace); } }); -final calendarScheduledMenstruationBandListProvider = Provider.autoDispose< - AsyncValue>>((ref) { +final calendarScheduledMenstruationBandListProvider = Provider.autoDispose>>((ref) { return AsyncValueGroup.group3( ref.watch(latestPillSheetGroupProvider), ref.watch(settingProvider), @@ -36,16 +32,11 @@ final calendarScheduledMenstruationBandListProvider = Provider.autoDispose< t.$1, t.$2, t.$3, - ) - .map((dateRange) => CalendarScheduledMenstruationBandModel( - dateRange.begin, dateRange.end)) - .toList(), + ).map((dateRange) => CalendarScheduledMenstruationBandModel(dateRange.begin, dateRange.end)).toList(), ); }); -final calendarNextPillSheetBandListProvider = - Provider.autoDispose>>( - (ref) { +final calendarNextPillSheetBandListProvider = Provider.autoDispose>>((ref) { final pillSheetGroup = ref.watch(latestPillSheetGroupProvider); if (pillSheetGroup is AsyncLoading) { @@ -59,10 +50,7 @@ final calendarNextPillSheetBandListProvider = try { return AsyncValue.data( - nextPillSheetDateRanges(pillSheetGroupValue, 15) - .map((dateRange) => - CalendarNextPillSheetBandModel(dateRange.begin, dateRange.end)) - .toList(), + nextPillSheetDateRanges(pillSheetGroupValue, 15).map((dateRange) => CalendarNextPillSheetBandModel(dateRange.begin, dateRange.end)).toList(), ); } catch (error, stackTrace) { return AsyncValue.error(error, stackTrace); diff --git a/lib/components/organisms/calendar/band/calendar_next_pill_sheet_band.dart b/lib/components/organisms/calendar/band/calendar_next_pill_sheet_band.dart index 6e48608cf7..316fcb0022 100644 --- a/lib/components/organisms/calendar/band/calendar_next_pill_sheet_band.dart +++ b/lib/components/organisms/calendar/band/calendar_next_pill_sheet_band.dart @@ -26,8 +26,7 @@ class CalendarNextPillSheetBand extends StatelessWidget { child: Stack( children: [ CustomPaint( - painter: DiagonalStripedLine( - color: PilllColors.duration, isNecessaryBorder: false), + painter: DiagonalStripedLine(color: PilllColors.duration, isNecessaryBorder: false), size: Size(width, CalendarBandConst.height), ), Container( diff --git a/lib/components/organisms/calendar/day/calendar_day_record.dart b/lib/components/organisms/calendar/day/calendar_day_record.dart index 2aeefd9580..6e8e42ac43 100644 --- a/lib/components/organisms/calendar/day/calendar_day_record.dart +++ b/lib/components/organisms/calendar/day/calendar_day_record.dart @@ -31,8 +31,7 @@ class CalendarDayRecord extends StatelessWidget { SvgPicture.asset( "images/laugh.svg", height: 10, - colorFilter: - const ColorFilter.mode(PilllColors.green, BlendMode.srcIn), + colorFilter: const ColorFilter.mode(PilllColors.green, BlendMode.srcIn), ), ); case PhysicalConditionStatus.bad: @@ -40,8 +39,7 @@ class CalendarDayRecord extends StatelessWidget { SvgPicture.asset( "images/angry.svg", height: 10, - colorFilter: - const ColorFilter.mode(PilllColors.danger, BlendMode.srcIn), + colorFilter: const ColorFilter.mode(PilllColors.danger, BlendMode.srcIn), ), ); } diff --git a/lib/components/organisms/calendar/week/utility.dart b/lib/components/organisms/calendar/week/utility.dart index d25acfbe38..113b62b21c 100644 --- a/lib/components/organisms/calendar/week/utility.dart +++ b/lib/components/organisms/calendar/week/utility.dart @@ -10,21 +10,17 @@ class WeekCalendarDateRangeCalculator { DateRange dateRangeOfLine(int line) { if (line == 1) { return DateRange( - DateTime(dateForMonth.year, dateForMonth.month, - 1 - _previousMonthDayCount()), - DateTime(dateForMonth.year, dateForMonth.month, - Weekday.values.length - _previousMonthDayCount()), + DateTime(dateForMonth.year, dateForMonth.month, 1 - _previousMonthDayCount()), + DateTime(dateForMonth.year, dateForMonth.month, Weekday.values.length - _previousMonthDayCount()), ); } if (line == weeklineCount()) { return DateRange( - DateTime(dateForMonth.year, dateForMonth.month, - Weekday.values.length * (line - 1) + 1 - _previousMonthDayCount()), + DateTime(dateForMonth.year, dateForMonth.month, Weekday.values.length * (line - 1) + 1 - _previousMonthDayCount()), DateTime(dateForMonth.year, dateForMonth.month, _lastDay()), ); } - var beginDay = - Weekday.values.length * (line - 1) - _previousMonthDayCount() + 1; + var beginDay = Weekday.values.length * (line - 1) - _previousMonthDayCount() + 1; var endDay = Weekday.values.length * line - _previousMonthDayCount(); return DateRange( DateTime(dateForMonth.year, dateForMonth.month, beginDay), @@ -33,8 +29,7 @@ class WeekCalendarDateRangeCalculator { } int _lastDay() => DateTime(dateForMonth.year, dateForMonth.month + 1, 0).day; - int _weekdayOffset() => - WeekdayFunctions.weekdayFromDate(_firstDayOfMonth(dateForMonth)).index; + int _weekdayOffset() => WeekdayFunctions.weekdayFromDate(_firstDayOfMonth(dateForMonth)).index; int _previousMonthDayCount() => _weekdayOffset(); int _tileCount() => _previousMonthDayCount() + _lastDay(); int weeklineCount() => (_tileCount() / Weekday.values.length).ceil(); diff --git a/lib/components/organisms/calendar/week/week_calendar.dart b/lib/components/organisms/calendar/week/week_calendar.dart index 9acfd2a43a..11f913d41a 100644 --- a/lib/components/organisms/calendar/week/week_calendar.dart +++ b/lib/components/organisms/calendar/week/week_calendar.dart @@ -27,8 +27,7 @@ class CalendarWeekLine extends HookConsumerWidget { final double horizontalPadding; final Widget Function(BuildContext, Weekday, DateTime) day; final List calendarMenstruationBandModels; - final List - calendarScheduledMenstruationBandModels; + final List calendarScheduledMenstruationBandModels; final List calendarNextPillSheetBandModels; const CalendarWeekLine({ @@ -42,9 +41,7 @@ class CalendarWeekLine extends HookConsumerWidget { }); @override Widget build(BuildContext context, WidgetRef ref) { - var tileWidth = - (MediaQuery.of(context).size.width - horizontalPadding * 2) / - Weekday.values.length; + var tileWidth = (MediaQuery.of(context).size.width - horizontalPadding * 2) / Weekday.values.length; return Stack( children: [ Row( @@ -109,8 +106,7 @@ class CalendarWeekLine extends HookConsumerWidget { } bool _contains(CalendarBandModel calendarBandModel) { - final isInRange = dateRange.inRange(calendarBandModel.begin) || - dateRange.inRange(calendarBandModel.end); + final isInRange = dateRange.inRange(calendarBandModel.begin) || dateRange.inRange(calendarBandModel.end); return isInRange; } @@ -121,8 +117,7 @@ class CalendarWeekLine extends HookConsumerWidget { required Widget Function(bool isLineBreak, double width) bandBuilder, }) { bool isLineBreak = isNecessaryLineBreak(calendarBandModel.begin, dateRange); - int start = - offsetForStartPositionAtLine(calendarBandModel.begin, dateRange); + int start = offsetForStartPositionAtLine(calendarBandModel.begin, dateRange); final length = bandLength(dateRange, calendarBandModel, isLineBreak); return Positioned( @@ -149,25 +144,18 @@ void transitionWhenCalendarDayTapped( return; } - final diary = - diaries.lastWhereOrNull((element) => isSameDay(element.date, date)); + final diary = diaries.lastWhereOrNull((element) => isSameDay(element.date, date)); if (schedules.where((e) => isSameDay(e.date, date)).isNotEmpty) { if (diary == null) { showModalBottomSheet( context: context, - builder: (context) => DiaryOrScheduleSheet( - showDiary: () => Navigator.of(context) - .push(DiaryPostPageRoute.route(date, null)), - showSchedule: () => - Navigator.of(context).push(SchedulePostPageRoute.route(date))), + builder: (context) => + DiaryOrScheduleSheet(showDiary: () => Navigator.of(context).push(DiaryPostPageRoute.route(date, null)), showSchedule: () => Navigator.of(context).push(SchedulePostPageRoute.route(date))), ); } else { showModalBottomSheet( context: context, - builder: (context) => DiaryOrScheduleSheet( - showDiary: () => _showConfirmDiarySheet(context, diary), - showSchedule: () => - Navigator.of(context).push(SchedulePostPageRoute.route(date))), + builder: (context) => DiaryOrScheduleSheet(showDiary: () => _showConfirmDiarySheet(context, diary), showSchedule: () => Navigator.of(context).push(SchedulePostPageRoute.route(date))), ); } return; diff --git a/lib/components/organisms/pill_mark/pill_mark.dart b/lib/components/organisms/pill_mark/pill_mark.dart index 0ee44c1623..8c90830bae 100644 --- a/lib/components/organisms/pill_mark/pill_mark.dart +++ b/lib/components/organisms/pill_mark/pill_mark.dart @@ -67,9 +67,7 @@ class PillMarkState extends State with TickerProviderStateMixin { PillMarkType.selected => const SelectedPillMark(), PillMarkType.done => const LightGrayPillMark(), }, - if (widget.showsCheckmark) - const Align( - alignment: Alignment.center, child: PillMarkDoneMark()), + if (widget.showsCheckmark) const Align(alignment: Alignment.center, child: PillMarkDoneMark()), ], ), if (widget.showsRippleAnimation) @@ -79,8 +77,7 @@ class PillMarkState extends State with TickerProviderStateMixin { left: -30, top: -30, child: CustomPaint( - size: const Size( - PillMarkConst.edgeOfRipple, PillMarkConst.edgeOfRipple), + size: const Size(PillMarkConst.edgeOfRipple, PillMarkConst.edgeOfRipple), painter: Ripple( _controller, color: PilllColors.secondary, diff --git a/lib/components/organisms/pill_sheet/pill_sheet_type_column.dart b/lib/components/organisms/pill_sheet/pill_sheet_type_column.dart index b85e156599..5fe6dbee15 100644 --- a/lib/components/organisms/pill_sheet/pill_sheet_type_column.dart +++ b/lib/components/organisms/pill_sheet/pill_sheet_type_column.dart @@ -26,9 +26,7 @@ class PillSheetTypeColumn extends StatelessWidget { return Container( constraints: PillSheetTypeColumn.boxConstraints, decoration: BoxDecoration( - color: selected - ? PilllColors.primary.withOpacity(0.08) - : PilllColors.white, + color: selected ? PilllColors.primary.withOpacity(0.08) : PilllColors.white, border: Border.all( width: selected ? 2 : 1, color: selected ? PilllColors.primary : PilllColors.border, diff --git a/lib/components/organisms/pill_sheet/pill_sheet_view_layout.dart b/lib/components/organisms/pill_sheet/pill_sheet_view_layout.dart index d78222b501..62bb541b02 100644 --- a/lib/components/organisms/pill_sheet/pill_sheet_view_layout.dart +++ b/lib/components/organisms/pill_sheet/pill_sheet_view_layout.dart @@ -15,18 +15,12 @@ class PillSheetViewLayout extends StatelessWidget { int numberOfLineInPillSheet, bool isHideWeekdayLine, ) { - const verticalSpacing = - PillSheetViewLayout.topSpace + PillSheetViewLayout.bottomSpace; - final pillMarkListHeight = - PillSheetViewLayout.lineHeight * numberOfLineInPillSheet + - verticalSpacing; - return isHideWeekdayLine - ? pillMarkListHeight - : pillMarkListHeight + WeekdayBadgeConst.height; + const verticalSpacing = PillSheetViewLayout.topSpace + PillSheetViewLayout.bottomSpace; + final pillMarkListHeight = PillSheetViewLayout.lineHeight * numberOfLineInPillSheet + verticalSpacing; + return isHideWeekdayLine ? pillMarkListHeight : pillMarkListHeight + WeekdayBadgeConst.height; } - static PillSheetType mostLargePillSheetType( - List pillSheetTypes) { + static PillSheetType mostLargePillSheetType(List pillSheetTypes) { final copied = [...pillSheetTypes]; copied.sort((a, b) => b.totalCount.compareTo(a.totalCount)); return copied.first; @@ -61,8 +55,7 @@ class PillSheetViewLayout extends StatelessWidget { ), ], ), - padding: - const EdgeInsets.fromLTRB(22, 0, 22, PillSheetViewLayout.bottomSpace), + padding: const EdgeInsets.fromLTRB(22, 0, 22, PillSheetViewLayout.bottomSpace), child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ diff --git a/lib/components/organisms/pill_sheet/setting_pill_sheet_view.dart b/lib/components/organisms/pill_sheet/setting_pill_sheet_view.dart index cd1a55a7df..0243b261dd 100644 --- a/lib/components/organisms/pill_sheet/setting_pill_sheet_view.dart +++ b/lib/components/organisms/pill_sheet/setting_pill_sheet_view.dart @@ -56,11 +56,8 @@ class SettingPillSheetView extends StatelessWidget { return Container(width: PillSheetViewLayout.componentWidth); } - final pillNumberInPillSheet = - PillMarkWithNumberLayoutHelper.calcPillNumberIntoPillSheet( - index, lineIndex); - final offset = summarizedPillCountWithPillSheetTypesToIndex( - pillSheetTypes: pillSheetTypes, toIndex: pageIndex); + final pillNumberInPillSheet = PillMarkWithNumberLayoutHelper.calcPillNumberIntoPillSheet(index, lineIndex); + final offset = summarizedPillCountWithPillSheetTypesToIndex(pillSheetTypes: pillSheetTypes, toIndex: pageIndex); return SizedBox( width: PillSheetViewLayout.componentWidth, @@ -103,10 +100,7 @@ class SettingPillSheetView extends StatelessWidget { } if (pillSheetType.dosingPeriod < pillNumberInPillSheet) { - return (pillSheetType == PillSheetType.pillsheet_21 || - pillSheetType == PillSheetType.pillsheet_24_rest_4) - ? PillMarkType.rest - : PillMarkType.fake; + return (pillSheetType == PillSheetType.pillsheet_21 || pillSheetType == PillSheetType.pillsheet_24_rest_4) ? PillMarkType.rest : PillMarkType.fake; } return PillMarkType.normal; } diff --git a/lib/components/page/discard_dialog.dart b/lib/components/page/discard_dialog.dart index 0bd8d3b3aa..0fa82a92ed 100644 --- a/lib/components/page/discard_dialog.dart +++ b/lib/components/page/discard_dialog.dart @@ -25,11 +25,7 @@ class DiscardDialog extends StatelessWidget { if (title.isNotEmpty) ...[ Text( title, - style: const TextStyle( - fontFamily: FontFamily.japanese, - fontWeight: FontWeight.w600, - fontSize: 16, - color: TextColor.main), + style: const TextStyle(fontFamily: FontFamily.japanese, fontWeight: FontWeight.w600, fontSize: 16, color: TextColor.main), textAlign: TextAlign.center, ), const SizedBox( diff --git a/lib/components/page/web_view.dart b/lib/components/page/web_view.dart index 59cc3f7486..db73ac04ec 100644 --- a/lib/components/page/web_view.dart +++ b/lib/components/page/web_view.dart @@ -30,8 +30,7 @@ class _WebViewPageState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: Text(widget.title, - style: const TextStyle(color: Colors.black, fontSize: 14)), + title: Text(widget.title, style: const TextStyle(color: Colors.black, fontSize: 14)), elevation: 2, leading: IconButton( icon: const Icon( diff --git a/lib/components/template/setting_menstruation/setting_menstruation_dynamic_description.dart b/lib/components/template/setting_menstruation/setting_menstruation_dynamic_description.dart index d5bfd9de7c..2b615b3b69 100644 --- a/lib/components/template/setting_menstruation/setting_menstruation_dynamic_description.dart +++ b/lib/components/template/setting_menstruation/setting_menstruation_dynamic_description.dart @@ -9,10 +9,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; abstract class SettingMenstruationDynamicDescriptionConstants { - static final List durationList = [ - "-", - ...List.generate(7, (index) => (index + 1).toString()) - ]; + static final List durationList = ["-", ...List.generate(7, (index) => (index + 1).toString())]; } class SettingMenstruationDynamicDescription extends StatelessWidget { @@ -75,12 +72,7 @@ class SettingMenstruationDynamicDescription extends StatelessWidget { onTap: () => _showDurationModalSheet(context), child: _duration(), ), - const Text(" 日間生理が続く", - style: TextStyle( - fontFamily: FontFamily.japanese, - fontWeight: FontWeight.w300, - fontSize: 14, - color: TextColor.main)), + const Text(" 日間生理が続く", style: TextStyle(fontFamily: FontFamily.japanese, fontWeight: FontWeight.w300, fontSize: 14, color: TextColor.main)), ], ) ], @@ -146,9 +138,7 @@ class SettingMenstruationDynamicDescription extends StatelessWidget { } void _showPicker(BuildContext context) { - final maximumCount = pillSheetTypes - .map((e) => e.totalCount) - .reduce((value, element) => value + element); + final maximumCount = pillSheetTypes.map((e) => e.totalCount).reduce((value, element) => value + element); int keepSelectedFromMenstruation = min(fromMenstruation, maximumCount); showModalBottomSheet( context: context, @@ -177,8 +167,7 @@ class SettingMenstruationDynamicDescription extends StatelessWidget { onSelectedItemChanged: (index) { keepSelectedFromMenstruation = index; }, - scrollController: FixedExtentScrollController( - initialItem: keepSelectedFromMenstruation), + scrollController: FixedExtentScrollController(initialItem: keepSelectedFromMenstruation), children: List.generate(maximumCount + 1, (index) { if (index == 0) { return "-"; @@ -223,12 +212,8 @@ class SettingMenstruationDynamicDescription extends StatelessWidget { onSelectedItemChanged: (index) { keepSelectedDurationMenstruation = index; }, - scrollController: FixedExtentScrollController( - initialItem: keepSelectedDurationMenstruation), - children: SettingMenstruationDynamicDescriptionConstants - .durationList - .map(_pickerItem) - .toList(), + scrollController: FixedExtentScrollController(initialItem: keepSelectedDurationMenstruation), + children: SettingMenstruationDynamicDescriptionConstants.durationList.map(_pickerItem).toList(), ), ), ), diff --git a/lib/components/template/setting_menstruation/setting_menstruation_pill_sheet_list.dart b/lib/components/template/setting_menstruation/setting_menstruation_pill_sheet_list.dart index e8dce9b68c..d46c84fbdb 100644 --- a/lib/components/template/setting_menstruation/setting_menstruation_pill_sheet_list.dart +++ b/lib/components/template/setting_menstruation/setting_menstruation_pill_sheet_list.dart @@ -23,16 +23,13 @@ class SettingMenstruationPillSheetList extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final pageController = usePageController( - viewportFraction: (PillSheetViewLayout.width + 20) / - MediaQuery.of(context).size.width); + final pageController = usePageController(viewportFraction: (PillSheetViewLayout.width + 20) / MediaQuery.of(context).size.width); return Column( children: [ Container( constraints: BoxConstraints( maxHeight: PillSheetViewLayout.calcHeight( - PillSheetViewLayout.mostLargePillSheetType(pillSheetTypes) - .numberOfLineInPillSheet, + PillSheetViewLayout.mostLargePillSheetType(pillSheetTypes).numberOfLineInPillSheet, true, ), ), @@ -50,10 +47,8 @@ class SettingMenstruationPillSheetList extends HookConsumerWidget { pageIndex: pageIndex, appearanceMode: appearanceMode, pillSheetTypes: pillSheetTypes, - selectedPillNumberIntoPillSheet: - selectedPillNumber(pageIndex), - markSelected: (pageIndex, number) => - markSelected(pageIndex, number), + selectedPillNumberIntoPillSheet: selectedPillNumber(pageIndex), + markSelected: (pageIndex, number) => markSelected(pageIndex, number), ), ), const Spacer(), diff --git a/lib/components/template/setting_pill_sheet_group/pill_sheet_group_select_pill_sheet_type_page.dart b/lib/components/template/setting_pill_sheet_group/pill_sheet_group_select_pill_sheet_type_page.dart index faf13ba9f8..7ae6c9526e 100644 --- a/lib/components/template/setting_pill_sheet_group/pill_sheet_group_select_pill_sheet_type_page.dart +++ b/lib/components/template/setting_pill_sheet_group/pill_sheet_group_select_pill_sheet_type_page.dart @@ -10,8 +10,7 @@ class PillSheetGroupSelectPillSheetTypePage extends StatelessWidget { final PillSheetType? pillSheetType; final Function(PillSheetType) onSelect; - const PillSheetGroupSelectPillSheetTypePage( - {super.key, required this.pillSheetType, required this.onSelect}); + const PillSheetGroupSelectPillSheetTypePage({super.key, required this.pillSheetType, required this.onSelect}); @override Widget build(BuildContext context) { return DraggableScrollableSheet( @@ -72,8 +71,7 @@ void showSettingPillSheetGroupSelectPillSheetTypePage({ required final PillSheetType? pillSheetType, required final Function(PillSheetType) onSelect, }) { - analytics.setCurrentScreen( - screenName: "PillSheetGroupSelectPillSheetTypePage"); + analytics.setCurrentScreen(screenName: "PillSheetGroupSelectPillSheetTypePage"); showModalBottomSheet( context: context, isScrollControlled: true, diff --git a/lib/components/template/setting_pill_sheet_group/setting_pill_sheet_group_pill_sheet_type_select_row.dart b/lib/components/template/setting_pill_sheet_group/setting_pill_sheet_group_pill_sheet_type_select_row.dart index bff73aa9c2..5ad979b2f7 100644 --- a/lib/components/template/setting_pill_sheet_group/setting_pill_sheet_group_pill_sheet_type_select_row.dart +++ b/lib/components/template/setting_pill_sheet_group/setting_pill_sheet_group_pill_sheet_type_select_row.dart @@ -67,8 +67,7 @@ class SettingPillSheetGroupPillSheetTypeSelectRow extends StatelessWidget { }, child: Container( padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 16), - constraints: BoxConstraints( - minWidth: MediaQuery.of(context).size.width - 80), + constraints: BoxConstraints(minWidth: MediaQuery.of(context).size.width - 80), decoration: BoxDecoration( color: PilllColors.white, borderRadius: BorderRadius.circular(4), diff --git a/lib/entity/config.codegen.freezed.dart b/lib/entity/config.codegen.freezed.dart index 3c4129f505..87b05fcf43 100644 --- a/lib/entity/config.codegen.freezed.dart +++ b/lib/entity/config.codegen.freezed.dart @@ -29,15 +29,13 @@ mixin _$Config { /// @nodoc abstract class $ConfigCopyWith<$Res> { - factory $ConfigCopyWith(Config value, $Res Function(Config) then) = - _$ConfigCopyWithImpl<$Res, Config>; + factory $ConfigCopyWith(Config value, $Res Function(Config) then) = _$ConfigCopyWithImpl<$Res, Config>; @useResult $Res call({String minimumSupportedAppVersion}); } /// @nodoc -class _$ConfigCopyWithImpl<$Res, $Val extends Config> - implements $ConfigCopyWith<$Res> { +class _$ConfigCopyWithImpl<$Res, $Val extends Config> implements $ConfigCopyWith<$Res> { _$ConfigCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -61,21 +59,15 @@ class _$ConfigCopyWithImpl<$Res, $Val extends Config> /// @nodoc abstract class _$$ConfigImplCopyWith<$Res> implements $ConfigCopyWith<$Res> { - factory _$$ConfigImplCopyWith( - _$ConfigImpl value, $Res Function(_$ConfigImpl) then) = - __$$ConfigImplCopyWithImpl<$Res>; + factory _$$ConfigImplCopyWith(_$ConfigImpl value, $Res Function(_$ConfigImpl) then) = __$$ConfigImplCopyWithImpl<$Res>; @override @useResult $Res call({String minimumSupportedAppVersion}); } /// @nodoc -class __$$ConfigImplCopyWithImpl<$Res> - extends _$ConfigCopyWithImpl<$Res, _$ConfigImpl> - implements _$$ConfigImplCopyWith<$Res> { - __$$ConfigImplCopyWithImpl( - _$ConfigImpl _value, $Res Function(_$ConfigImpl) _then) - : super(_value, _then); +class __$$ConfigImplCopyWithImpl<$Res> extends _$ConfigCopyWithImpl<$Res, _$ConfigImpl> implements _$$ConfigImplCopyWith<$Res> { + __$$ConfigImplCopyWithImpl(_$ConfigImpl _value, $Res Function(_$ConfigImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -96,8 +88,7 @@ class __$$ConfigImplCopyWithImpl<$Res> class _$ConfigImpl extends _Config { _$ConfigImpl({required this.minimumSupportedAppVersion}) : super._(); - factory _$ConfigImpl.fromJson(Map json) => - _$$ConfigImplFromJson(json); + factory _$ConfigImpl.fromJson(Map json) => _$$ConfigImplFromJson(json); @override final String minimumSupportedAppVersion; @@ -112,10 +103,7 @@ class _$ConfigImpl extends _Config { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ConfigImpl && - (identical(other.minimumSupportedAppVersion, - minimumSupportedAppVersion) || - other.minimumSupportedAppVersion == - minimumSupportedAppVersion)); + (identical(other.minimumSupportedAppVersion, minimumSupportedAppVersion) || other.minimumSupportedAppVersion == minimumSupportedAppVersion)); } @JsonKey(ignore: true) @@ -125,8 +113,7 @@ class _$ConfigImpl extends _Config { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ConfigImplCopyWith<_$ConfigImpl> get copyWith => - __$$ConfigImplCopyWithImpl<_$ConfigImpl>(this, _$identity); + _$$ConfigImplCopyWith<_$ConfigImpl> get copyWith => __$$ConfigImplCopyWithImpl<_$ConfigImpl>(this, _$identity); @override Map toJson() { @@ -137,8 +124,7 @@ class _$ConfigImpl extends _Config { } abstract class _Config extends Config { - factory _Config({required final String minimumSupportedAppVersion}) = - _$ConfigImpl; + factory _Config({required final String minimumSupportedAppVersion}) = _$ConfigImpl; _Config._() : super._(); factory _Config.fromJson(Map json) = _$ConfigImpl.fromJson; @@ -147,6 +133,5 @@ abstract class _Config extends Config { String get minimumSupportedAppVersion; @override @JsonKey(ignore: true) - _$$ConfigImplCopyWith<_$ConfigImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ConfigImplCopyWith<_$ConfigImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/entity/config.codegen.g.dart b/lib/entity/config.codegen.g.dart index 1d0c12ecb0..2220f20620 100644 --- a/lib/entity/config.codegen.g.dart +++ b/lib/entity/config.codegen.g.dart @@ -10,7 +10,6 @@ _$ConfigImpl _$$ConfigImplFromJson(Map json) => _$ConfigImpl( minimumSupportedAppVersion: json['minimumSupportedAppVersion'] as String, ); -Map _$$ConfigImplToJson(_$ConfigImpl instance) => - { +Map _$$ConfigImplToJson(_$ConfigImpl instance) => { 'minimumSupportedAppVersion': instance.minimumSupportedAppVersion, }; diff --git a/lib/entity/diary.codegen.dart b/lib/entity/diary.codegen.dart index 0bde03a1f7..70f628eea5 100644 --- a/lib/entity/diary.codegen.dart +++ b/lib/entity/diary.codegen.dart @@ -37,14 +37,8 @@ class Diary with _$Diary { }) = _Diary; const Diary._(); - factory Diary.fromDate(DateTime date) => Diary( - date: date, - memo: "", - createdAt: now(), - physicalConditions: [], - hasSex: false); + factory Diary.fromDate(DateTime date) => Diary(date: date, memo: "", createdAt: now(), physicalConditions: [], hasSex: false); factory Diary.fromJson(Map json) => _$DiaryFromJson(json); bool get hasPhysicalConditionStatus => physicalConditionStatus != null; - bool hasPhysicalConditionStatusFor(PhysicalConditionStatus status) => - physicalConditionStatus == status; + bool hasPhysicalConditionStatusFor(PhysicalConditionStatus status) => physicalConditionStatus == status; } diff --git a/lib/entity/diary.codegen.freezed.dart b/lib/entity/diary.codegen.freezed.dart index 12b413b273..52cc7dcbce 100644 --- a/lib/entity/diary.codegen.freezed.dart +++ b/lib/entity/diary.codegen.freezed.dart @@ -20,17 +20,11 @@ Diary _$DiaryFromJson(Map json) { /// @nodoc mixin _$Diary { - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime get date => - throw _privateConstructorUsedError; // NOTE: OLD data does't have createdAt - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) + DateTime get date => throw _privateConstructorUsedError; // NOTE: OLD data does't have createdAt + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get createdAt => throw _privateConstructorUsedError; - PhysicalConditionStatus? get physicalConditionStatus => - throw _privateConstructorUsedError; + PhysicalConditionStatus? get physicalConditionStatus => throw _privateConstructorUsedError; List get physicalConditions => throw _privateConstructorUsedError; bool get hasSex => throw _privateConstructorUsedError; String get memo => throw _privateConstructorUsedError; @@ -42,18 +36,11 @@ mixin _$Diary { /// @nodoc abstract class $DiaryCopyWith<$Res> { - factory $DiaryCopyWith(Diary value, $Res Function(Diary) then) = - _$DiaryCopyWithImpl<$Res, Diary>; + factory $DiaryCopyWith(Diary value, $Res Function(Diary) then) = _$DiaryCopyWithImpl<$Res, Diary>; @useResult $Res call( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime date, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? createdAt, + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime date, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? createdAt, PhysicalConditionStatus? physicalConditionStatus, List physicalConditions, bool hasSex, @@ -61,8 +48,7 @@ abstract class $DiaryCopyWith<$Res> { } /// @nodoc -class _$DiaryCopyWithImpl<$Res, $Val extends Diary> - implements $DiaryCopyWith<$Res> { +class _$DiaryCopyWithImpl<$Res, $Val extends Diary> implements $DiaryCopyWith<$Res> { _$DiaryCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -111,20 +97,12 @@ class _$DiaryCopyWithImpl<$Res, $Val extends Diary> /// @nodoc abstract class _$$DiaryImplCopyWith<$Res> implements $DiaryCopyWith<$Res> { - factory _$$DiaryImplCopyWith( - _$DiaryImpl value, $Res Function(_$DiaryImpl) then) = - __$$DiaryImplCopyWithImpl<$Res>; + factory _$$DiaryImplCopyWith(_$DiaryImpl value, $Res Function(_$DiaryImpl) then) = __$$DiaryImplCopyWithImpl<$Res>; @override @useResult $Res call( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime date, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? createdAt, + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime date, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? createdAt, PhysicalConditionStatus? physicalConditionStatus, List physicalConditions, bool hasSex, @@ -132,12 +110,8 @@ abstract class _$$DiaryImplCopyWith<$Res> implements $DiaryCopyWith<$Res> { } /// @nodoc -class __$$DiaryImplCopyWithImpl<$Res> - extends _$DiaryCopyWithImpl<$Res, _$DiaryImpl> - implements _$$DiaryImplCopyWith<$Res> { - __$$DiaryImplCopyWithImpl( - _$DiaryImpl _value, $Res Function(_$DiaryImpl) _then) - : super(_value, _then); +class __$$DiaryImplCopyWithImpl<$Res> extends _$DiaryCopyWithImpl<$Res, _$DiaryImpl> implements _$$DiaryImplCopyWith<$Res> { + __$$DiaryImplCopyWithImpl(_$DiaryImpl _value, $Res Function(_$DiaryImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -183,14 +157,8 @@ class __$$DiaryImplCopyWithImpl<$Res> @JsonSerializable(explicitToJson: true) class _$DiaryImpl extends _Diary { const _$DiaryImpl( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.date, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - required this.createdAt, + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.date, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) required this.createdAt, this.physicalConditionStatus, required final List physicalConditions, required this.hasSex, @@ -198,27 +166,21 @@ class _$DiaryImpl extends _Diary { : _physicalConditions = physicalConditions, super._(); - factory _$DiaryImpl.fromJson(Map json) => - _$$DiaryImplFromJson(json); + factory _$DiaryImpl.fromJson(Map json) => _$$DiaryImplFromJson(json); @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime date; // NOTE: OLD data does't have createdAt @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? createdAt; @override final PhysicalConditionStatus? physicalConditionStatus; final List _physicalConditions; @override List get physicalConditions { - if (_physicalConditions is EqualUnmodifiableListView) - return _physicalConditions; + if (_physicalConditions is EqualUnmodifiableListView) return _physicalConditions; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_physicalConditions); } @@ -239,33 +201,21 @@ class _$DiaryImpl extends _Diary { (other.runtimeType == runtimeType && other is _$DiaryImpl && (identical(other.date, date) || other.date == date) && - (identical(other.createdAt, createdAt) || - other.createdAt == createdAt) && - (identical( - other.physicalConditionStatus, physicalConditionStatus) || - other.physicalConditionStatus == physicalConditionStatus) && - const DeepCollectionEquality() - .equals(other._physicalConditions, _physicalConditions) && + (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && + (identical(other.physicalConditionStatus, physicalConditionStatus) || other.physicalConditionStatus == physicalConditionStatus) && + const DeepCollectionEquality().equals(other._physicalConditions, _physicalConditions) && (identical(other.hasSex, hasSex) || other.hasSex == hasSex) && (identical(other.memo, memo) || other.memo == memo)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, - date, - createdAt, - physicalConditionStatus, - const DeepCollectionEquality().hash(_physicalConditions), - hasSex, - memo); + int get hashCode => Object.hash(runtimeType, date, createdAt, physicalConditionStatus, const DeepCollectionEquality().hash(_physicalConditions), hasSex, memo); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$DiaryImplCopyWith<_$DiaryImpl> get copyWith => - __$$DiaryImplCopyWithImpl<_$DiaryImpl>(this, _$identity); + _$$DiaryImplCopyWith<_$DiaryImpl> get copyWith => __$$DiaryImplCopyWithImpl<_$DiaryImpl>(this, _$identity); @override Map toJson() { @@ -277,14 +227,8 @@ class _$DiaryImpl extends _Diary { abstract class _Diary extends Diary { const factory _Diary( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime date, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - required final DateTime? createdAt, + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime date, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) required final DateTime? createdAt, final PhysicalConditionStatus? physicalConditionStatus, required final List physicalConditions, required final bool hasSex, @@ -294,14 +238,10 @@ abstract class _Diary extends Diary { factory _Diary.fromJson(Map json) = _$DiaryImpl.fromJson; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get date; @override // NOTE: OLD data does't have createdAt - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get createdAt; @override PhysicalConditionStatus? get physicalConditionStatus; @@ -313,6 +253,5 @@ abstract class _Diary extends Diary { String get memo; @override @JsonKey(ignore: true) - _$$DiaryImplCopyWith<_$DiaryImpl> get copyWith => - throw _privateConstructorUsedError; + _$$DiaryImplCopyWith<_$DiaryImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/entity/diary.codegen.g.dart b/lib/entity/diary.codegen.g.dart index 25f445f710..94b19c751c 100644 --- a/lib/entity/diary.codegen.g.dart +++ b/lib/entity/diary.codegen.g.dart @@ -7,25 +7,18 @@ part of 'diary.codegen.dart'; // ************************************************************************** _$DiaryImpl _$$DiaryImplFromJson(Map json) => _$DiaryImpl( - date: NonNullTimestampConverter.timestampToDateTime( - json['date'] as Timestamp), - createdAt: TimestampConverter.timestampToDateTime( - json['createdAt'] as Timestamp?), - physicalConditionStatus: $enumDecodeNullable( - _$PhysicalConditionStatusEnumMap, json['physicalConditionStatus']), - physicalConditions: (json['physicalConditions'] as List) - .map((e) => e as String) - .toList(), + date: NonNullTimestampConverter.timestampToDateTime(json['date'] as Timestamp), + createdAt: TimestampConverter.timestampToDateTime(json['createdAt'] as Timestamp?), + physicalConditionStatus: $enumDecodeNullable(_$PhysicalConditionStatusEnumMap, json['physicalConditionStatus']), + physicalConditions: (json['physicalConditions'] as List).map((e) => e as String).toList(), hasSex: json['hasSex'] as bool, memo: json['memo'] as String, ); -Map _$$DiaryImplToJson(_$DiaryImpl instance) => - { +Map _$$DiaryImplToJson(_$DiaryImpl instance) => { 'date': NonNullTimestampConverter.dateTimeToTimestamp(instance.date), 'createdAt': TimestampConverter.dateTimeToTimestamp(instance.createdAt), - 'physicalConditionStatus': - _$PhysicalConditionStatusEnumMap[instance.physicalConditionStatus], + 'physicalConditionStatus': _$PhysicalConditionStatusEnumMap[instance.physicalConditionStatus], 'physicalConditions': instance.physicalConditions, 'hasSex': instance.hasSex, 'memo': instance.memo, diff --git a/lib/entity/diary_setting.codegen.dart b/lib/entity/diary_setting.codegen.dart index d94b00a472..8f7c597c41 100644 --- a/lib/entity/diary_setting.codegen.dart +++ b/lib/entity/diary_setting.codegen.dart @@ -36,6 +36,5 @@ class DiarySetting with _$DiarySetting { required DateTime createdAt, }) = _DiarySetting; - factory DiarySetting.fromJson(Map json) => - _$DiarySettingFromJson(json); + factory DiarySetting.fromJson(Map json) => _$DiarySettingFromJson(json); } diff --git a/lib/entity/diary_setting.codegen.freezed.dart b/lib/entity/diary_setting.codegen.freezed.dart index 966a1c2403..ff191db946 100644 --- a/lib/entity/diary_setting.codegen.freezed.dart +++ b/lib/entity/diary_setting.codegen.freezed.dart @@ -21,34 +21,23 @@ DiarySetting _$DiarySettingFromJson(Map json) { /// @nodoc mixin _$DiarySetting { List get physicalConditions => throw _privateConstructorUsedError; - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get createdAt => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $DiarySettingCopyWith get copyWith => - throw _privateConstructorUsedError; + $DiarySettingCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $DiarySettingCopyWith<$Res> { - factory $DiarySettingCopyWith( - DiarySetting value, $Res Function(DiarySetting) then) = - _$DiarySettingCopyWithImpl<$Res, DiarySetting>; + factory $DiarySettingCopyWith(DiarySetting value, $Res Function(DiarySetting) then) = _$DiarySettingCopyWithImpl<$Res, DiarySetting>; @useResult - $Res call( - {List physicalConditions, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime createdAt}); + $Res call({List physicalConditions, @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime createdAt}); } /// @nodoc -class _$DiarySettingCopyWithImpl<$Res, $Val extends DiarySetting> - implements $DiarySettingCopyWith<$Res> { +class _$DiarySettingCopyWithImpl<$Res, $Val extends DiarySetting> implements $DiarySettingCopyWith<$Res> { _$DiarySettingCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -76,28 +65,16 @@ class _$DiarySettingCopyWithImpl<$Res, $Val extends DiarySetting> } /// @nodoc -abstract class _$$DiarySettingImplCopyWith<$Res> - implements $DiarySettingCopyWith<$Res> { - factory _$$DiarySettingImplCopyWith( - _$DiarySettingImpl value, $Res Function(_$DiarySettingImpl) then) = - __$$DiarySettingImplCopyWithImpl<$Res>; +abstract class _$$DiarySettingImplCopyWith<$Res> implements $DiarySettingCopyWith<$Res> { + factory _$$DiarySettingImplCopyWith(_$DiarySettingImpl value, $Res Function(_$DiarySettingImpl) then) = __$$DiarySettingImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {List physicalConditions, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime createdAt}); + $Res call({List physicalConditions, @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime createdAt}); } /// @nodoc -class __$$DiarySettingImplCopyWithImpl<$Res> - extends _$DiarySettingCopyWithImpl<$Res, _$DiarySettingImpl> - implements _$$DiarySettingImplCopyWith<$Res> { - __$$DiarySettingImplCopyWithImpl( - _$DiarySettingImpl _value, $Res Function(_$DiarySettingImpl) _then) - : super(_value, _then); +class __$$DiarySettingImplCopyWithImpl<$Res> extends _$DiarySettingCopyWithImpl<$Res, _$DiarySettingImpl> implements _$$DiarySettingImplCopyWith<$Res> { + __$$DiarySettingImplCopyWithImpl(_$DiarySettingImpl _value, $Res Function(_$DiarySettingImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -124,30 +101,23 @@ class __$$DiarySettingImplCopyWithImpl<$Res> class _$DiarySettingImpl extends _DiarySetting with DiagnosticableTreeMixin { const _$DiarySettingImpl( {final List physicalConditions = defaultPhysicalConditions, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.createdAt}) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.createdAt}) : _physicalConditions = physicalConditions, super._(); - factory _$DiarySettingImpl.fromJson(Map json) => - _$$DiarySettingImplFromJson(json); + factory _$DiarySettingImpl.fromJson(Map json) => _$$DiarySettingImplFromJson(json); final List _physicalConditions; @override @JsonKey() List get physicalConditions { - if (_physicalConditions is EqualUnmodifiableListView) - return _physicalConditions; + if (_physicalConditions is EqualUnmodifiableListView) return _physicalConditions; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_physicalConditions); } @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime createdAt; @override @@ -169,22 +139,18 @@ class _$DiarySettingImpl extends _DiarySetting with DiagnosticableTreeMixin { return identical(this, other) || (other.runtimeType == runtimeType && other is _$DiarySettingImpl && - const DeepCollectionEquality() - .equals(other._physicalConditions, _physicalConditions) && - (identical(other.createdAt, createdAt) || - other.createdAt == createdAt)); + const DeepCollectionEquality().equals(other._physicalConditions, _physicalConditions) && + (identical(other.createdAt, createdAt) || other.createdAt == createdAt)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, - const DeepCollectionEquality().hash(_physicalConditions), createdAt); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_physicalConditions), createdAt); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$DiarySettingImplCopyWith<_$DiarySettingImpl> get copyWith => - __$$DiarySettingImplCopyWithImpl<_$DiarySettingImpl>(this, _$identity); + _$$DiarySettingImplCopyWith<_$DiarySettingImpl> get copyWith => __$$DiarySettingImplCopyWithImpl<_$DiarySettingImpl>(this, _$identity); @override Map toJson() { @@ -197,24 +163,17 @@ class _$DiarySettingImpl extends _DiarySetting with DiagnosticableTreeMixin { abstract class _DiarySetting extends DiarySetting { const factory _DiarySetting( {final List physicalConditions, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime createdAt}) = _$DiarySettingImpl; + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime createdAt}) = _$DiarySettingImpl; const _DiarySetting._() : super._(); - factory _DiarySetting.fromJson(Map json) = - _$DiarySettingImpl.fromJson; + factory _DiarySetting.fromJson(Map json) = _$DiarySettingImpl.fromJson; @override List get physicalConditions; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get createdAt; @override @JsonKey(ignore: true) - _$$DiarySettingImplCopyWith<_$DiarySettingImpl> get copyWith => - throw _privateConstructorUsedError; + _$$DiarySettingImplCopyWith<_$DiarySettingImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/entity/diary_setting.codegen.g.dart b/lib/entity/diary_setting.codegen.g.dart index 18c1b3f8a9..76c277abca 100644 --- a/lib/entity/diary_setting.codegen.g.dart +++ b/lib/entity/diary_setting.codegen.g.dart @@ -6,19 +6,12 @@ part of 'diary_setting.codegen.dart'; // JsonSerializableGenerator // ************************************************************************** -_$DiarySettingImpl _$$DiarySettingImplFromJson(Map json) => - _$DiarySettingImpl( - physicalConditions: (json['physicalConditions'] as List?) - ?.map((e) => e as String) - .toList() ?? - defaultPhysicalConditions, - createdAt: NonNullTimestampConverter.timestampToDateTime( - json['createdAt'] as Timestamp), +_$DiarySettingImpl _$$DiarySettingImplFromJson(Map json) => _$DiarySettingImpl( + physicalConditions: (json['physicalConditions'] as List?)?.map((e) => e as String).toList() ?? defaultPhysicalConditions, + createdAt: NonNullTimestampConverter.timestampToDateTime(json['createdAt'] as Timestamp), ); -Map _$$DiarySettingImplToJson(_$DiarySettingImpl instance) => - { +Map _$$DiarySettingImplToJson(_$DiarySettingImpl instance) => { 'physicalConditions': instance.physicalConditions, - 'createdAt': - NonNullTimestampConverter.dateTimeToTimestamp(instance.createdAt), + 'createdAt': NonNullTimestampConverter.dateTimeToTimestamp(instance.createdAt), }; diff --git a/lib/entity/firestore_timestamp_converter.dart b/lib/entity/firestore_timestamp_converter.dart index 6bc0b2ff7c..eec2be0b15 100644 --- a/lib/entity/firestore_timestamp_converter.dart +++ b/lib/entity/firestore_timestamp_converter.dart @@ -1,15 +1,11 @@ import 'package:cloud_firestore/cloud_firestore.dart'; class TimestampConverter { - static Timestamp? dateTimeToTimestamp(DateTime? dateTime) => - dateTime == null ? null : Timestamp.fromDate(dateTime); - static DateTime? timestampToDateTime(Timestamp? timestamp) => - timestamp?.toDate(); + static Timestamp? dateTimeToTimestamp(DateTime? dateTime) => dateTime == null ? null : Timestamp.fromDate(dateTime); + static DateTime? timestampToDateTime(Timestamp? timestamp) => timestamp?.toDate(); } class NonNullTimestampConverter { - static Timestamp dateTimeToTimestamp(DateTime dateTime) => - Timestamp.fromDate(dateTime); - static DateTime timestampToDateTime(Timestamp timestamp) => - timestamp.toDate(); + static Timestamp dateTimeToTimestamp(DateTime dateTime) => Timestamp.fromDate(dateTime); + static DateTime timestampToDateTime(Timestamp timestamp) => timestamp.toDate(); } diff --git a/lib/entity/menstruation.codegen.dart b/lib/entity/menstruation.codegen.dart index 804372c54a..ccbfa37283 100644 --- a/lib/entity/menstruation.codegen.dart +++ b/lib/entity/menstruation.codegen.dart @@ -18,8 +18,7 @@ class MenstruationFirestoreKey { class Menstruation with _$Menstruation { String? get documentID => id; - factory Menstruation.fromJson(Map json) => - _$MenstruationFromJson(json); + factory Menstruation.fromJson(Map json) => _$MenstruationFromJson(json); const Menstruation._(); @JsonSerializable(explicitToJson: true) @@ -49,8 +48,7 @@ class Menstruation with _$Menstruation { }) = _Menstruation; DateRange get dateRange => DateRange(beginDate, endDate); - DateTimeRange get dateTimeRange => - DateTimeRange(start: beginDate, end: endDate); + DateTimeRange get dateTimeRange => DateTimeRange(start: beginDate, end: endDate); bool get isActive => dateRange.inRange(today()); } diff --git a/lib/entity/menstruation.codegen.freezed.dart b/lib/entity/menstruation.codegen.freezed.dart index 9d3e79c191..3073b54a05 100644 --- a/lib/entity/menstruation.codegen.freezed.dart +++ b/lib/entity/menstruation.codegen.freezed.dart @@ -22,60 +22,36 @@ Menstruation _$MenstruationFromJson(Map json) { mixin _$Menstruation { @JsonKey(includeIfNull: false) String? get id => throw _privateConstructorUsedError; - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get beginDate => throw _privateConstructorUsedError; - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get endDate => throw _privateConstructorUsedError; - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get deletedAt => throw _privateConstructorUsedError; - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get createdAt => throw _privateConstructorUsedError; String? get healthKitSampleDataUUID => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $MenstruationCopyWith get copyWith => - throw _privateConstructorUsedError; + $MenstruationCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $MenstruationCopyWith<$Res> { - factory $MenstruationCopyWith( - Menstruation value, $Res Function(Menstruation) then) = - _$MenstruationCopyWithImpl<$Res, Menstruation>; + factory $MenstruationCopyWith(Menstruation value, $Res Function(Menstruation) then) = _$MenstruationCopyWithImpl<$Res, Menstruation>; @useResult $Res call( {@JsonKey(includeIfNull: false) String? id, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime beginDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime endDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? deletedAt, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime createdAt, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime beginDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime endDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? deletedAt, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime createdAt, String? healthKitSampleDataUUID}); } /// @nodoc -class _$MenstruationCopyWithImpl<$Res, $Val extends Menstruation> - implements $MenstruationCopyWith<$Res> { +class _$MenstruationCopyWithImpl<$Res, $Val extends Menstruation> implements $MenstruationCopyWith<$Res> { _$MenstruationCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -123,41 +99,22 @@ class _$MenstruationCopyWithImpl<$Res, $Val extends Menstruation> } /// @nodoc -abstract class _$$MenstruationImplCopyWith<$Res> - implements $MenstruationCopyWith<$Res> { - factory _$$MenstruationImplCopyWith( - _$MenstruationImpl value, $Res Function(_$MenstruationImpl) then) = - __$$MenstruationImplCopyWithImpl<$Res>; +abstract class _$$MenstruationImplCopyWith<$Res> implements $MenstruationCopyWith<$Res> { + factory _$$MenstruationImplCopyWith(_$MenstruationImpl value, $Res Function(_$MenstruationImpl) then) = __$$MenstruationImplCopyWithImpl<$Res>; @override @useResult $Res call( {@JsonKey(includeIfNull: false) String? id, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime beginDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime endDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? deletedAt, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime createdAt, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime beginDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime endDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? deletedAt, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime createdAt, String? healthKitSampleDataUUID}); } /// @nodoc -class __$$MenstruationImplCopyWithImpl<$Res> - extends _$MenstruationCopyWithImpl<$Res, _$MenstruationImpl> - implements _$$MenstruationImplCopyWith<$Res> { - __$$MenstruationImplCopyWithImpl( - _$MenstruationImpl _value, $Res Function(_$MenstruationImpl) _then) - : super(_value, _then); +class __$$MenstruationImplCopyWithImpl<$Res> extends _$MenstruationCopyWithImpl<$Res, _$MenstruationImpl> implements _$$MenstruationImplCopyWith<$Res> { + __$$MenstruationImplCopyWithImpl(_$MenstruationImpl _value, $Res Function(_$MenstruationImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -204,50 +161,29 @@ class __$$MenstruationImplCopyWithImpl<$Res> class _$MenstruationImpl extends _Menstruation { const _$MenstruationImpl( {@JsonKey(includeIfNull: false) this.id, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.beginDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.endDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - this.deletedAt, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.createdAt, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.beginDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.endDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) this.deletedAt, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.createdAt, this.healthKitSampleDataUUID}) : super._(); - factory _$MenstruationImpl.fromJson(Map json) => - _$$MenstruationImplFromJson(json); + factory _$MenstruationImpl.fromJson(Map json) => _$$MenstruationImplFromJson(json); @override @JsonKey(includeIfNull: false) final String? id; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime beginDate; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime endDate; @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? deletedAt; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime createdAt; @override final String? healthKitSampleDataUUID; @@ -263,28 +199,21 @@ class _$MenstruationImpl extends _Menstruation { (other.runtimeType == runtimeType && other is _$MenstruationImpl && (identical(other.id, id) || other.id == id) && - (identical(other.beginDate, beginDate) || - other.beginDate == beginDate) && + (identical(other.beginDate, beginDate) || other.beginDate == beginDate) && (identical(other.endDate, endDate) || other.endDate == endDate) && - (identical(other.deletedAt, deletedAt) || - other.deletedAt == deletedAt) && - (identical(other.createdAt, createdAt) || - other.createdAt == createdAt) && - (identical( - other.healthKitSampleDataUUID, healthKitSampleDataUUID) || - other.healthKitSampleDataUUID == healthKitSampleDataUUID)); + (identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt) && + (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && + (identical(other.healthKitSampleDataUUID, healthKitSampleDataUUID) || other.healthKitSampleDataUUID == healthKitSampleDataUUID)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, id, beginDate, endDate, - deletedAt, createdAt, healthKitSampleDataUUID); + int get hashCode => Object.hash(runtimeType, id, beginDate, endDate, deletedAt, createdAt, healthKitSampleDataUUID); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$MenstruationImplCopyWith<_$MenstruationImpl> get copyWith => - __$$MenstruationImplCopyWithImpl<_$MenstruationImpl>(this, _$identity); + _$$MenstruationImplCopyWith<_$MenstruationImpl> get copyWith => __$$MenstruationImplCopyWithImpl<_$MenstruationImpl>(this, _$identity); @override Map toJson() { @@ -297,55 +226,33 @@ class _$MenstruationImpl extends _Menstruation { abstract class _Menstruation extends Menstruation { const factory _Menstruation( {@JsonKey(includeIfNull: false) final String? id, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime beginDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime endDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - final DateTime? deletedAt, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime createdAt, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime beginDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime endDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? deletedAt, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime createdAt, final String? healthKitSampleDataUUID}) = _$MenstruationImpl; const _Menstruation._() : super._(); - factory _Menstruation.fromJson(Map json) = - _$MenstruationImpl.fromJson; + factory _Menstruation.fromJson(Map json) = _$MenstruationImpl.fromJson; @override @JsonKey(includeIfNull: false) String? get id; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get beginDate; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get endDate; @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get deletedAt; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get createdAt; @override String? get healthKitSampleDataUUID; @override @JsonKey(ignore: true) - _$$MenstruationImplCopyWith<_$MenstruationImpl> get copyWith => - throw _privateConstructorUsedError; + _$$MenstruationImplCopyWith<_$MenstruationImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/entity/menstruation.codegen.g.dart b/lib/entity/menstruation.codegen.g.dart index 2bc3c83237..5f97eaebab 100644 --- a/lib/entity/menstruation.codegen.g.dart +++ b/lib/entity/menstruation.codegen.g.dart @@ -6,17 +6,12 @@ part of 'menstruation.codegen.dart'; // JsonSerializableGenerator // ************************************************************************** -_$MenstruationImpl _$$MenstruationImplFromJson(Map json) => - _$MenstruationImpl( +_$MenstruationImpl _$$MenstruationImplFromJson(Map json) => _$MenstruationImpl( id: json['id'] as String?, - beginDate: NonNullTimestampConverter.timestampToDateTime( - json['beginDate'] as Timestamp), - endDate: NonNullTimestampConverter.timestampToDateTime( - json['endDate'] as Timestamp), - deletedAt: TimestampConverter.timestampToDateTime( - json['deletedAt'] as Timestamp?), - createdAt: NonNullTimestampConverter.timestampToDateTime( - json['createdAt'] as Timestamp), + beginDate: NonNullTimestampConverter.timestampToDateTime(json['beginDate'] as Timestamp), + endDate: NonNullTimestampConverter.timestampToDateTime(json['endDate'] as Timestamp), + deletedAt: TimestampConverter.timestampToDateTime(json['deletedAt'] as Timestamp?), + createdAt: NonNullTimestampConverter.timestampToDateTime(json['createdAt'] as Timestamp), healthKitSampleDataUUID: json['healthKitSampleDataUUID'] as String?, ); @@ -30,13 +25,10 @@ Map _$$MenstruationImplToJson(_$MenstruationImpl instance) { } writeNotNull('id', instance.id); - val['beginDate'] = - NonNullTimestampConverter.dateTimeToTimestamp(instance.beginDate); - val['endDate'] = - NonNullTimestampConverter.dateTimeToTimestamp(instance.endDate); + val['beginDate'] = NonNullTimestampConverter.dateTimeToTimestamp(instance.beginDate); + val['endDate'] = NonNullTimestampConverter.dateTimeToTimestamp(instance.endDate); val['deletedAt'] = TimestampConverter.dateTimeToTimestamp(instance.deletedAt); - val['createdAt'] = - NonNullTimestampConverter.dateTimeToTimestamp(instance.createdAt); + val['createdAt'] = NonNullTimestampConverter.dateTimeToTimestamp(instance.createdAt); val['healthKitSampleDataUUID'] = instance.healthKitSampleDataUUID; return val; } diff --git a/lib/entity/package.codegen.dart b/lib/entity/package.codegen.dart index a2930a8cfa..cd3371ac50 100644 --- a/lib/entity/package.codegen.dart +++ b/lib/entity/package.codegen.dart @@ -17,6 +17,5 @@ class Package with _$Package { required String buildNumber, }) = _Package; - factory Package.fromJson(Map json) => - _$PackageFromJson(json); + factory Package.fromJson(Map json) => _$PackageFromJson(json); } diff --git a/lib/entity/package.codegen.freezed.dart b/lib/entity/package.codegen.freezed.dart index cc6c54c65a..be8b25ee0c 100644 --- a/lib/entity/package.codegen.freezed.dart +++ b/lib/entity/package.codegen.freezed.dart @@ -32,16 +32,13 @@ mixin _$Package { /// @nodoc abstract class $PackageCopyWith<$Res> { - factory $PackageCopyWith(Package value, $Res Function(Package) then) = - _$PackageCopyWithImpl<$Res, Package>; + factory $PackageCopyWith(Package value, $Res Function(Package) then) = _$PackageCopyWithImpl<$Res, Package>; @useResult - $Res call( - {String latestOS, String appName, String appVersion, String buildNumber}); + $Res call({String latestOS, String appName, String appVersion, String buildNumber}); } /// @nodoc -class _$PackageCopyWithImpl<$Res, $Val extends Package> - implements $PackageCopyWith<$Res> { +class _$PackageCopyWithImpl<$Res, $Val extends Package> implements $PackageCopyWith<$Res> { _$PackageCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -80,22 +77,15 @@ class _$PackageCopyWithImpl<$Res, $Val extends Package> /// @nodoc abstract class _$$PackageImplCopyWith<$Res> implements $PackageCopyWith<$Res> { - factory _$$PackageImplCopyWith( - _$PackageImpl value, $Res Function(_$PackageImpl) then) = - __$$PackageImplCopyWithImpl<$Res>; + factory _$$PackageImplCopyWith(_$PackageImpl value, $Res Function(_$PackageImpl) then) = __$$PackageImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String latestOS, String appName, String appVersion, String buildNumber}); + $Res call({String latestOS, String appName, String appVersion, String buildNumber}); } /// @nodoc -class __$$PackageImplCopyWithImpl<$Res> - extends _$PackageCopyWithImpl<$Res, _$PackageImpl> - implements _$$PackageImplCopyWith<$Res> { - __$$PackageImplCopyWithImpl( - _$PackageImpl _value, $Res Function(_$PackageImpl) _then) - : super(_value, _then); +class __$$PackageImplCopyWithImpl<$Res> extends _$PackageCopyWithImpl<$Res, _$PackageImpl> implements _$$PackageImplCopyWith<$Res> { + __$$PackageImplCopyWithImpl(_$PackageImpl _value, $Res Function(_$PackageImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -130,14 +120,9 @@ class __$$PackageImplCopyWithImpl<$Res> @JsonSerializable(explicitToJson: true) class _$PackageImpl implements _Package { - const _$PackageImpl( - {required this.latestOS, - required this.appName, - required this.appVersion, - required this.buildNumber}); + const _$PackageImpl({required this.latestOS, required this.appName, required this.appVersion, required this.buildNumber}); - factory _$PackageImpl.fromJson(Map json) => - _$$PackageImplFromJson(json); + factory _$PackageImpl.fromJson(Map json) => _$$PackageImplFromJson(json); @override final String latestOS; @@ -158,25 +143,20 @@ class _$PackageImpl implements _Package { return identical(this, other) || (other.runtimeType == runtimeType && other is _$PackageImpl && - (identical(other.latestOS, latestOS) || - other.latestOS == latestOS) && + (identical(other.latestOS, latestOS) || other.latestOS == latestOS) && (identical(other.appName, appName) || other.appName == appName) && - (identical(other.appVersion, appVersion) || - other.appVersion == appVersion) && - (identical(other.buildNumber, buildNumber) || - other.buildNumber == buildNumber)); + (identical(other.appVersion, appVersion) || other.appVersion == appVersion) && + (identical(other.buildNumber, buildNumber) || other.buildNumber == buildNumber)); } @JsonKey(ignore: true) @override - int get hashCode => - Object.hash(runtimeType, latestOS, appName, appVersion, buildNumber); + int get hashCode => Object.hash(runtimeType, latestOS, appName, appVersion, buildNumber); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PackageImplCopyWith<_$PackageImpl> get copyWith => - __$$PackageImplCopyWithImpl<_$PackageImpl>(this, _$identity); + _$$PackageImplCopyWith<_$PackageImpl> get copyWith => __$$PackageImplCopyWithImpl<_$PackageImpl>(this, _$identity); @override Map toJson() { @@ -187,11 +167,7 @@ class _$PackageImpl implements _Package { } abstract class _Package implements Package { - const factory _Package( - {required final String latestOS, - required final String appName, - required final String appVersion, - required final String buildNumber}) = _$PackageImpl; + const factory _Package({required final String latestOS, required final String appName, required final String appVersion, required final String buildNumber}) = _$PackageImpl; factory _Package.fromJson(Map json) = _$PackageImpl.fromJson; @@ -205,6 +181,5 @@ abstract class _Package implements Package { String get buildNumber; @override @JsonKey(ignore: true) - _$$PackageImplCopyWith<_$PackageImpl> get copyWith => - throw _privateConstructorUsedError; + _$$PackageImplCopyWith<_$PackageImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/entity/package.codegen.g.dart b/lib/entity/package.codegen.g.dart index bc99ca1a26..0f446d544a 100644 --- a/lib/entity/package.codegen.g.dart +++ b/lib/entity/package.codegen.g.dart @@ -6,16 +6,14 @@ part of 'package.codegen.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PackageImpl _$$PackageImplFromJson(Map json) => - _$PackageImpl( +_$PackageImpl _$$PackageImplFromJson(Map json) => _$PackageImpl( latestOS: json['latestOS'] as String, appName: json['appName'] as String, appVersion: json['appVersion'] as String, buildNumber: json['buildNumber'] as String, ); -Map _$$PackageImplToJson(_$PackageImpl instance) => - { +Map _$$PackageImplToJson(_$PackageImpl instance) => { 'latestOS': instance.latestOS, 'appName': instance.appName, 'appVersion': instance.appVersion, diff --git a/lib/entity/pill_sheet.codegen.dart b/lib/entity/pill_sheet.codegen.dart index 9e25666f00..7310a2858c 100644 --- a/lib/entity/pill_sheet.codegen.dart +++ b/lib/entity/pill_sheet.codegen.dart @@ -29,8 +29,7 @@ class PillSheetTypeInfo with _$PillSheetTypeInfo { required int dosingPeriod, }) = _PillSheetTypeInfo; - factory PillSheetTypeInfo.fromJson(Map json) => - _$PillSheetTypeInfoFromJson(json); + factory PillSheetTypeInfo.fromJson(Map json) => _$PillSheetTypeInfoFromJson(json); } @freezed @@ -57,19 +56,16 @@ class RestDuration with _$RestDuration { }) = _RestDuration; const RestDuration._(); - factory RestDuration.fromJson(Map json) => - _$RestDurationFromJson(json); + factory RestDuration.fromJson(Map json) => _$RestDurationFromJson(json); - DateTimeRange? get dateTimeRange => - endDate == null ? null : DateTimeRange(start: beginDate, end: endDate!); + DateTimeRange? get dateTimeRange => endDate == null ? null : DateTimeRange(start: beginDate, end: endDate!); } @freezed class PillSheet with _$PillSheet { String? get documentID => id; - PillSheetType get sheetType => - PillSheetTypeFunctions.fromRawPath(typeInfo.pillSheetTypeReferencePath); + PillSheetType get sheetType => PillSheetTypeFunctions.fromRawPath(typeInfo.pillSheetTypeReferencePath); PillSheet._(); @JsonSerializable(explicitToJson: true) @@ -117,11 +113,9 @@ class PillSheet with _$PillSheet { createdAt: now(), ); - factory PillSheet.fromJson(Map json) => - _$PillSheetFromJson(json); + factory PillSheet.fromJson(Map json) => _$PillSheetFromJson(json); - PillSheetType get pillSheetType => - PillSheetTypeFunctions.fromRawPath(typeInfo.pillSheetTypeReferencePath); + PillSheetType get pillSheetType => PillSheetTypeFunctions.fromRawPath(typeInfo.pillSheetTypeReferencePath); // NOTE: [SyncData:Widget] このプロパティはWidgetに同期されてる int get todayPillNumber { @@ -151,12 +145,9 @@ class PillSheet with _$PillSheet { } bool get isTakenAll => typeInfo.totalCount == lastTakenPillNumber; - bool get isBegan => - beginingDate.date().toUtc().millisecondsSinceEpoch < - now().toUtc().millisecondsSinceEpoch; + bool get isBegan => beginingDate.date().toUtc().millisecondsSinceEpoch < now().toUtc().millisecondsSinceEpoch; bool get inNotTakenDuration => todayPillNumber > typeInfo.dosingPeriod; - bool get pillSheetHasRestOrFakeDuration => - !pillSheetType.isNotExistsNotTakenDuration; + bool get pillSheetHasRestOrFakeDuration => !pillSheetType.isNotExistsNotTakenDuration; bool get isActive => isActiveFor(now()); bool isActiveFor(DateTime date) { @@ -165,8 +156,7 @@ class PillSheet with _$PillSheet { DateTime get estimatedEndTakenDate => beginingDate .addDays(pillSheetType.totalCount - 1) - .addDays(summarizedRestDuration( - restDurations: restDurations, upperDate: today())) + .addDays(summarizedRestDuration(restDurations: restDurations, upperDate: today())) .date() .add(const Duration(days: 1)) .subtract(const Duration(seconds: 1)); @@ -175,8 +165,7 @@ class PillSheet with _$PillSheet { if (restDurations.isEmpty) { return null; } else { - if (restDurations.last.endDate == null && - restDurations.last.beginDate.isBefore(now())) { + if (restDurations.last.endDate == null && restDurations.last.beginDate.isBefore(now())) { return restDurations.last; } else { return null; @@ -191,10 +180,7 @@ class PillSheet with _$PillSheet { } int pillNumberFor({required DateTime targetDate}) { - return daysBetween(beginingDate.date(), targetDate) - - summarizedRestDuration( - restDurations: restDurations, upperDate: targetDate) + - 1; + return daysBetween(beginingDate.date(), targetDate) - summarizedRestDuration(restDurations: restDurations, upperDate: targetDate) + 1; } // ピルシートのピルの日付を取得する @@ -205,8 +191,7 @@ class PillSheet with _$PillSheet { var date = beginingDate.addDays(index + offset).date(); for (final restDuration in restDurations) { - if (restDuration.beginDate.isBefore(date) || - isSameDay(restDuration.beginDate, date)) { + if (restDuration.beginDate.isBefore(date) || isSameDay(restDuration.beginDate, date)) { final restDurationEndDateOrToday = restDuration.endDate ?? today(); if (restDurationEndDateOrToday.isAfter(date)) { final diff = daysBetween(date, restDurationEndDateOrToday); diff --git a/lib/entity/pill_sheet.codegen.freezed.dart b/lib/entity/pill_sheet.codegen.freezed.dart index cdc24dbb14..7da09591ab 100644 --- a/lib/entity/pill_sheet.codegen.freezed.dart +++ b/lib/entity/pill_sheet.codegen.freezed.dart @@ -27,26 +27,18 @@ mixin _$PillSheetTypeInfo { Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $PillSheetTypeInfoCopyWith get copyWith => - throw _privateConstructorUsedError; + $PillSheetTypeInfoCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $PillSheetTypeInfoCopyWith<$Res> { - factory $PillSheetTypeInfoCopyWith( - PillSheetTypeInfo value, $Res Function(PillSheetTypeInfo) then) = - _$PillSheetTypeInfoCopyWithImpl<$Res, PillSheetTypeInfo>; + factory $PillSheetTypeInfoCopyWith(PillSheetTypeInfo value, $Res Function(PillSheetTypeInfo) then) = _$PillSheetTypeInfoCopyWithImpl<$Res, PillSheetTypeInfo>; @useResult - $Res call( - {String pillSheetTypeReferencePath, - String name, - int totalCount, - int dosingPeriod}); + $Res call({String pillSheetTypeReferencePath, String name, int totalCount, int dosingPeriod}); } /// @nodoc -class _$PillSheetTypeInfoCopyWithImpl<$Res, $Val extends PillSheetTypeInfo> - implements $PillSheetTypeInfoCopyWith<$Res> { +class _$PillSheetTypeInfoCopyWithImpl<$Res, $Val extends PillSheetTypeInfo> implements $PillSheetTypeInfoCopyWith<$Res> { _$PillSheetTypeInfoCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -84,27 +76,16 @@ class _$PillSheetTypeInfoCopyWithImpl<$Res, $Val extends PillSheetTypeInfo> } /// @nodoc -abstract class _$$PillSheetTypeInfoImplCopyWith<$Res> - implements $PillSheetTypeInfoCopyWith<$Res> { - factory _$$PillSheetTypeInfoImplCopyWith(_$PillSheetTypeInfoImpl value, - $Res Function(_$PillSheetTypeInfoImpl) then) = - __$$PillSheetTypeInfoImplCopyWithImpl<$Res>; +abstract class _$$PillSheetTypeInfoImplCopyWith<$Res> implements $PillSheetTypeInfoCopyWith<$Res> { + factory _$$PillSheetTypeInfoImplCopyWith(_$PillSheetTypeInfoImpl value, $Res Function(_$PillSheetTypeInfoImpl) then) = __$$PillSheetTypeInfoImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String pillSheetTypeReferencePath, - String name, - int totalCount, - int dosingPeriod}); + $Res call({String pillSheetTypeReferencePath, String name, int totalCount, int dosingPeriod}); } /// @nodoc -class __$$PillSheetTypeInfoImplCopyWithImpl<$Res> - extends _$PillSheetTypeInfoCopyWithImpl<$Res, _$PillSheetTypeInfoImpl> - implements _$$PillSheetTypeInfoImplCopyWith<$Res> { - __$$PillSheetTypeInfoImplCopyWithImpl(_$PillSheetTypeInfoImpl _value, - $Res Function(_$PillSheetTypeInfoImpl) _then) - : super(_value, _then); +class __$$PillSheetTypeInfoImplCopyWithImpl<$Res> extends _$PillSheetTypeInfoCopyWithImpl<$Res, _$PillSheetTypeInfoImpl> implements _$$PillSheetTypeInfoImplCopyWith<$Res> { + __$$PillSheetTypeInfoImplCopyWithImpl(_$PillSheetTypeInfoImpl _value, $Res Function(_$PillSheetTypeInfoImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -139,14 +120,9 @@ class __$$PillSheetTypeInfoImplCopyWithImpl<$Res> @JsonSerializable(explicitToJson: true) class _$PillSheetTypeInfoImpl implements _PillSheetTypeInfo { - const _$PillSheetTypeInfoImpl( - {required this.pillSheetTypeReferencePath, - required this.name, - required this.totalCount, - required this.dosingPeriod}); + const _$PillSheetTypeInfoImpl({required this.pillSheetTypeReferencePath, required this.name, required this.totalCount, required this.dosingPeriod}); - factory _$PillSheetTypeInfoImpl.fromJson(Map json) => - _$$PillSheetTypeInfoImplFromJson(json); + factory _$PillSheetTypeInfoImpl.fromJson(Map json) => _$$PillSheetTypeInfoImplFromJson(json); @override final String pillSheetTypeReferencePath; @@ -167,28 +143,20 @@ class _$PillSheetTypeInfoImpl implements _PillSheetTypeInfo { return identical(this, other) || (other.runtimeType == runtimeType && other is _$PillSheetTypeInfoImpl && - (identical(other.pillSheetTypeReferencePath, - pillSheetTypeReferencePath) || - other.pillSheetTypeReferencePath == - pillSheetTypeReferencePath) && + (identical(other.pillSheetTypeReferencePath, pillSheetTypeReferencePath) || other.pillSheetTypeReferencePath == pillSheetTypeReferencePath) && (identical(other.name, name) || other.name == name) && - (identical(other.totalCount, totalCount) || - other.totalCount == totalCount) && - (identical(other.dosingPeriod, dosingPeriod) || - other.dosingPeriod == dosingPeriod)); + (identical(other.totalCount, totalCount) || other.totalCount == totalCount) && + (identical(other.dosingPeriod, dosingPeriod) || other.dosingPeriod == dosingPeriod)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, pillSheetTypeReferencePath, name, totalCount, dosingPeriod); + int get hashCode => Object.hash(runtimeType, pillSheetTypeReferencePath, name, totalCount, dosingPeriod); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PillSheetTypeInfoImplCopyWith<_$PillSheetTypeInfoImpl> get copyWith => - __$$PillSheetTypeInfoImplCopyWithImpl<_$PillSheetTypeInfoImpl>( - this, _$identity); + _$$PillSheetTypeInfoImplCopyWith<_$PillSheetTypeInfoImpl> get copyWith => __$$PillSheetTypeInfoImplCopyWithImpl<_$PillSheetTypeInfoImpl>(this, _$identity); @override Map toJson() { @@ -199,14 +167,10 @@ class _$PillSheetTypeInfoImpl implements _PillSheetTypeInfo { } abstract class _PillSheetTypeInfo implements PillSheetTypeInfo { - const factory _PillSheetTypeInfo( - {required final String pillSheetTypeReferencePath, - required final String name, - required final int totalCount, - required final int dosingPeriod}) = _$PillSheetTypeInfoImpl; + const factory _PillSheetTypeInfo({required final String pillSheetTypeReferencePath, required final String name, required final int totalCount, required final int dosingPeriod}) = + _$PillSheetTypeInfoImpl; - factory _PillSheetTypeInfo.fromJson(Map json) = - _$PillSheetTypeInfoImpl.fromJson; + factory _PillSheetTypeInfo.fromJson(Map json) = _$PillSheetTypeInfoImpl.fromJson; @override String get pillSheetTypeReferencePath; @@ -218,8 +182,7 @@ abstract class _PillSheetTypeInfo implements PillSheetTypeInfo { int get dosingPeriod; @override @JsonKey(ignore: true) - _$$PillSheetTypeInfoImplCopyWith<_$PillSheetTypeInfoImpl> get copyWith => - throw _privateConstructorUsedError; + _$$PillSheetTypeInfoImplCopyWith<_$PillSheetTypeInfoImpl> get copyWith => throw _privateConstructorUsedError; } RestDuration _$RestDurationFromJson(Map json) { @@ -230,50 +193,31 @@ RestDuration _$RestDurationFromJson(Map json) { mixin _$RestDuration { // from: 2024-03-28の実装時に追加。調査しやすいようにuuidを入れておく String? get id => throw _privateConstructorUsedError; - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get beginDate => throw _privateConstructorUsedError; - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get endDate => throw _privateConstructorUsedError; - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get createdDate => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $RestDurationCopyWith get copyWith => - throw _privateConstructorUsedError; + $RestDurationCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $RestDurationCopyWith<$Res> { - factory $RestDurationCopyWith( - RestDuration value, $Res Function(RestDuration) then) = - _$RestDurationCopyWithImpl<$Res, RestDuration>; + factory $RestDurationCopyWith(RestDuration value, $Res Function(RestDuration) then) = _$RestDurationCopyWithImpl<$Res, RestDuration>; @useResult $Res call( {String? id, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime beginDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? endDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime createdDate}); + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime beginDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? endDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime createdDate}); } /// @nodoc -class _$RestDurationCopyWithImpl<$Res, $Val extends RestDuration> - implements $RestDurationCopyWith<$Res> { +class _$RestDurationCopyWithImpl<$Res, $Val extends RestDuration> implements $RestDurationCopyWith<$Res> { _$RestDurationCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -311,36 +255,20 @@ class _$RestDurationCopyWithImpl<$Res, $Val extends RestDuration> } /// @nodoc -abstract class _$$RestDurationImplCopyWith<$Res> - implements $RestDurationCopyWith<$Res> { - factory _$$RestDurationImplCopyWith( - _$RestDurationImpl value, $Res Function(_$RestDurationImpl) then) = - __$$RestDurationImplCopyWithImpl<$Res>; +abstract class _$$RestDurationImplCopyWith<$Res> implements $RestDurationCopyWith<$Res> { + factory _$$RestDurationImplCopyWith(_$RestDurationImpl value, $Res Function(_$RestDurationImpl) then) = __$$RestDurationImplCopyWithImpl<$Res>; @override @useResult $Res call( {String? id, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime beginDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? endDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime createdDate}); + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime beginDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? endDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime createdDate}); } /// @nodoc -class __$$RestDurationImplCopyWithImpl<$Res> - extends _$RestDurationCopyWithImpl<$Res, _$RestDurationImpl> - implements _$$RestDurationImplCopyWith<$Res> { - __$$RestDurationImplCopyWithImpl( - _$RestDurationImpl _value, $Res Function(_$RestDurationImpl) _then) - : super(_value, _then); +class __$$RestDurationImplCopyWithImpl<$Res> extends _$RestDurationCopyWithImpl<$Res, _$RestDurationImpl> implements _$$RestDurationImplCopyWith<$Res> { + __$$RestDurationImplCopyWithImpl(_$RestDurationImpl _value, $Res Function(_$RestDurationImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -377,40 +305,24 @@ class __$$RestDurationImplCopyWithImpl<$Res> class _$RestDurationImpl extends _RestDuration { const _$RestDurationImpl( {required this.id, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.beginDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - this.endDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.createdDate}) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.beginDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) this.endDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.createdDate}) : super._(); - factory _$RestDurationImpl.fromJson(Map json) => - _$$RestDurationImplFromJson(json); + factory _$RestDurationImpl.fromJson(Map json) => _$$RestDurationImplFromJson(json); // from: 2024-03-28の実装時に追加。調査しやすいようにuuidを入れておく @override final String? id; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime beginDate; @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? endDate; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime createdDate; @override @@ -424,23 +336,19 @@ class _$RestDurationImpl extends _RestDuration { (other.runtimeType == runtimeType && other is _$RestDurationImpl && (identical(other.id, id) || other.id == id) && - (identical(other.beginDate, beginDate) || - other.beginDate == beginDate) && + (identical(other.beginDate, beginDate) || other.beginDate == beginDate) && (identical(other.endDate, endDate) || other.endDate == endDate) && - (identical(other.createdDate, createdDate) || - other.createdDate == createdDate)); + (identical(other.createdDate, createdDate) || other.createdDate == createdDate)); } @JsonKey(ignore: true) @override - int get hashCode => - Object.hash(runtimeType, id, beginDate, endDate, createdDate); + int get hashCode => Object.hash(runtimeType, id, beginDate, endDate, createdDate); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RestDurationImplCopyWith<_$RestDurationImpl> get copyWith => - __$$RestDurationImplCopyWithImpl<_$RestDurationImpl>(this, _$identity); + _$$RestDurationImplCopyWith<_$RestDurationImpl> get copyWith => __$$RestDurationImplCopyWithImpl<_$RestDurationImpl>(this, _$identity); @override Map toJson() { @@ -453,44 +361,27 @@ class _$RestDurationImpl extends _RestDuration { abstract class _RestDuration extends RestDuration { const factory _RestDuration( {required final String? id, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime beginDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - final DateTime? endDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime createdDate}) = _$RestDurationImpl; + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime beginDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? endDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime createdDate}) = _$RestDurationImpl; const _RestDuration._() : super._(); - factory _RestDuration.fromJson(Map json) = - _$RestDurationImpl.fromJson; + factory _RestDuration.fromJson(Map json) = _$RestDurationImpl.fromJson; @override // from: 2024-03-28の実装時に追加。調査しやすいようにuuidを入れておく String? get id; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get beginDate; @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get endDate; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get createdDate; @override @JsonKey(ignore: true) - _$$RestDurationImplCopyWith<_$RestDurationImpl> get copyWith => - throw _privateConstructorUsedError; + _$$RestDurationImplCopyWith<_$RestDurationImpl> get copyWith => throw _privateConstructorUsedError; } PillSheet _$PillSheetFromJson(Map json) { @@ -503,56 +394,33 @@ mixin _$PillSheet { String? get id => throw _privateConstructorUsedError; @JsonKey() PillSheetTypeInfo get typeInfo => throw _privateConstructorUsedError; - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime get beginingDate => - throw _privateConstructorUsedError; // NOTE: [SyncData:Widget] このプロパティはWidgetに同期されてる - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) + DateTime get beginingDate => throw _privateConstructorUsedError; // NOTE: [SyncData:Widget] このプロパティはWidgetに同期されてる + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get lastTakenDate => throw _privateConstructorUsedError; - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get createdAt => throw _privateConstructorUsedError; - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get deletedAt => throw _privateConstructorUsedError; int get groupIndex => throw _privateConstructorUsedError; List get restDurations => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $PillSheetCopyWith get copyWith => - throw _privateConstructorUsedError; + $PillSheetCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $PillSheetCopyWith<$Res> { - factory $PillSheetCopyWith(PillSheet value, $Res Function(PillSheet) then) = - _$PillSheetCopyWithImpl<$Res, PillSheet>; + factory $PillSheetCopyWith(PillSheet value, $Res Function(PillSheet) then) = _$PillSheetCopyWithImpl<$Res, PillSheet>; @useResult $Res call( {@JsonKey(includeIfNull: false) String? id, @JsonKey() PillSheetTypeInfo typeInfo, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime beginingDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? lastTakenDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? createdAt, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? deletedAt, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime beginingDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? lastTakenDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? createdAt, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? deletedAt, int groupIndex, List restDurations}); @@ -560,8 +428,7 @@ abstract class $PillSheetCopyWith<$Res> { } /// @nodoc -class _$PillSheetCopyWithImpl<$Res, $Val extends PillSheet> - implements $PillSheetCopyWith<$Res> { +class _$PillSheetCopyWithImpl<$Res, $Val extends PillSheet> implements $PillSheetCopyWith<$Res> { _$PillSheetCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -627,32 +494,17 @@ class _$PillSheetCopyWithImpl<$Res, $Val extends PillSheet> } /// @nodoc -abstract class _$$PillSheetImplCopyWith<$Res> - implements $PillSheetCopyWith<$Res> { - factory _$$PillSheetImplCopyWith( - _$PillSheetImpl value, $Res Function(_$PillSheetImpl) then) = - __$$PillSheetImplCopyWithImpl<$Res>; +abstract class _$$PillSheetImplCopyWith<$Res> implements $PillSheetCopyWith<$Res> { + factory _$$PillSheetImplCopyWith(_$PillSheetImpl value, $Res Function(_$PillSheetImpl) then) = __$$PillSheetImplCopyWithImpl<$Res>; @override @useResult $Res call( {@JsonKey(includeIfNull: false) String? id, @JsonKey() PillSheetTypeInfo typeInfo, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime beginingDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? lastTakenDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? createdAt, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? deletedAt, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime beginingDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? lastTakenDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? createdAt, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? deletedAt, int groupIndex, List restDurations}); @@ -661,12 +513,8 @@ abstract class _$$PillSheetImplCopyWith<$Res> } /// @nodoc -class __$$PillSheetImplCopyWithImpl<$Res> - extends _$PillSheetCopyWithImpl<$Res, _$PillSheetImpl> - implements _$$PillSheetImplCopyWith<$Res> { - __$$PillSheetImplCopyWithImpl( - _$PillSheetImpl _value, $Res Function(_$PillSheetImpl) _then) - : super(_value, _then); +class __$$PillSheetImplCopyWithImpl<$Res> extends _$PillSheetCopyWithImpl<$Res, _$PillSheetImpl> implements _$$PillSheetImplCopyWith<$Res> { + __$$PillSheetImplCopyWithImpl(_$PillSheetImpl _value, $Res Function(_$PillSheetImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -724,29 +572,16 @@ class _$PillSheetImpl extends _PillSheet { _$PillSheetImpl( {@JsonKey(includeIfNull: false) required this.id, @JsonKey() required this.typeInfo, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.beginingDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - required this.lastTakenDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - required this.createdAt, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - this.deletedAt, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.beginingDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) required this.lastTakenDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) required this.createdAt, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) this.deletedAt, this.groupIndex = 0, final List restDurations = const []}) : _restDurations = restDurations, super._(); - factory _$PillSheetImpl.fromJson(Map json) => - _$$PillSheetImplFromJson(json); + factory _$PillSheetImpl.fromJson(Map json) => _$$PillSheetImplFromJson(json); @override @JsonKey(includeIfNull: false) @@ -755,25 +590,17 @@ class _$PillSheetImpl extends _PillSheet { @JsonKey() final PillSheetTypeInfo typeInfo; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime beginingDate; // NOTE: [SyncData:Widget] このプロパティはWidgetに同期されてる @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? lastTakenDate; @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? createdAt; @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? deletedAt; @override @JsonKey() @@ -798,40 +625,23 @@ class _$PillSheetImpl extends _PillSheet { (other.runtimeType == runtimeType && other is _$PillSheetImpl && (identical(other.id, id) || other.id == id) && - (identical(other.typeInfo, typeInfo) || - other.typeInfo == typeInfo) && - (identical(other.beginingDate, beginingDate) || - other.beginingDate == beginingDate) && - (identical(other.lastTakenDate, lastTakenDate) || - other.lastTakenDate == lastTakenDate) && - (identical(other.createdAt, createdAt) || - other.createdAt == createdAt) && - (identical(other.deletedAt, deletedAt) || - other.deletedAt == deletedAt) && - (identical(other.groupIndex, groupIndex) || - other.groupIndex == groupIndex) && - const DeepCollectionEquality() - .equals(other._restDurations, _restDurations)); + (identical(other.typeInfo, typeInfo) || other.typeInfo == typeInfo) && + (identical(other.beginingDate, beginingDate) || other.beginingDate == beginingDate) && + (identical(other.lastTakenDate, lastTakenDate) || other.lastTakenDate == lastTakenDate) && + (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && + (identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt) && + (identical(other.groupIndex, groupIndex) || other.groupIndex == groupIndex) && + const DeepCollectionEquality().equals(other._restDurations, _restDurations)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, - id, - typeInfo, - beginingDate, - lastTakenDate, - createdAt, - deletedAt, - groupIndex, - const DeepCollectionEquality().hash(_restDurations)); + int get hashCode => Object.hash(runtimeType, id, typeInfo, beginingDate, lastTakenDate, createdAt, deletedAt, groupIndex, const DeepCollectionEquality().hash(_restDurations)); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PillSheetImplCopyWith<_$PillSheetImpl> get copyWith => - __$$PillSheetImplCopyWithImpl<_$PillSheetImpl>(this, _$identity); + _$$PillSheetImplCopyWith<_$PillSheetImpl> get copyWith => __$$PillSheetImplCopyWithImpl<_$PillSheetImpl>(this, _$identity); @override Map toJson() { @@ -845,28 +655,15 @@ abstract class _PillSheet extends PillSheet { factory _PillSheet( {@JsonKey(includeIfNull: false) required final String? id, @JsonKey() required final PillSheetTypeInfo typeInfo, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime beginingDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - required final DateTime? lastTakenDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - required final DateTime? createdAt, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - final DateTime? deletedAt, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime beginingDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) required final DateTime? lastTakenDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) required final DateTime? createdAt, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? deletedAt, final int groupIndex, final List restDurations}) = _$PillSheetImpl; _PillSheet._() : super._(); - factory _PillSheet.fromJson(Map json) = - _$PillSheetImpl.fromJson; + factory _PillSheet.fromJson(Map json) = _$PillSheetImpl.fromJson; @override @JsonKey(includeIfNull: false) @@ -875,24 +672,16 @@ abstract class _PillSheet extends PillSheet { @JsonKey() PillSheetTypeInfo get typeInfo; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get beginingDate; @override // NOTE: [SyncData:Widget] このプロパティはWidgetに同期されてる - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get lastTakenDate; @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get createdAt; @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get deletedAt; @override int get groupIndex; @@ -900,6 +689,5 @@ abstract class _PillSheet extends PillSheet { List get restDurations; @override @JsonKey(ignore: true) - _$$PillSheetImplCopyWith<_$PillSheetImpl> get copyWith => - throw _privateConstructorUsedError; + _$$PillSheetImplCopyWith<_$PillSheetImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/entity/pill_sheet.codegen.g.dart b/lib/entity/pill_sheet.codegen.g.dart index 008e93255e..0f5e41b751 100644 --- a/lib/entity/pill_sheet.codegen.g.dart +++ b/lib/entity/pill_sheet.codegen.g.dart @@ -6,63 +6,43 @@ part of 'pill_sheet.codegen.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PillSheetTypeInfoImpl _$$PillSheetTypeInfoImplFromJson( - Map json) => - _$PillSheetTypeInfoImpl( +_$PillSheetTypeInfoImpl _$$PillSheetTypeInfoImplFromJson(Map json) => _$PillSheetTypeInfoImpl( pillSheetTypeReferencePath: json['pillSheetTypeReferencePath'] as String, name: json['name'] as String, totalCount: (json['totalCount'] as num).toInt(), dosingPeriod: (json['dosingPeriod'] as num).toInt(), ); -Map _$$PillSheetTypeInfoImplToJson( - _$PillSheetTypeInfoImpl instance) => - { +Map _$$PillSheetTypeInfoImplToJson(_$PillSheetTypeInfoImpl instance) => { 'pillSheetTypeReferencePath': instance.pillSheetTypeReferencePath, 'name': instance.name, 'totalCount': instance.totalCount, 'dosingPeriod': instance.dosingPeriod, }; -_$RestDurationImpl _$$RestDurationImplFromJson(Map json) => - _$RestDurationImpl( +_$RestDurationImpl _$$RestDurationImplFromJson(Map json) => _$RestDurationImpl( id: json['id'] as String?, - beginDate: NonNullTimestampConverter.timestampToDateTime( - json['beginDate'] as Timestamp), - endDate: - TimestampConverter.timestampToDateTime(json['endDate'] as Timestamp?), - createdDate: NonNullTimestampConverter.timestampToDateTime( - json['createdDate'] as Timestamp), + beginDate: NonNullTimestampConverter.timestampToDateTime(json['beginDate'] as Timestamp), + endDate: TimestampConverter.timestampToDateTime(json['endDate'] as Timestamp?), + createdDate: NonNullTimestampConverter.timestampToDateTime(json['createdDate'] as Timestamp), ); -Map _$$RestDurationImplToJson(_$RestDurationImpl instance) => - { +Map _$$RestDurationImplToJson(_$RestDurationImpl instance) => { 'id': instance.id, - 'beginDate': - NonNullTimestampConverter.dateTimeToTimestamp(instance.beginDate), + 'beginDate': NonNullTimestampConverter.dateTimeToTimestamp(instance.beginDate), 'endDate': TimestampConverter.dateTimeToTimestamp(instance.endDate), - 'createdDate': - NonNullTimestampConverter.dateTimeToTimestamp(instance.createdDate), + 'createdDate': NonNullTimestampConverter.dateTimeToTimestamp(instance.createdDate), }; -_$PillSheetImpl _$$PillSheetImplFromJson(Map json) => - _$PillSheetImpl( +_$PillSheetImpl _$$PillSheetImplFromJson(Map json) => _$PillSheetImpl( id: json['id'] as String?, - typeInfo: - PillSheetTypeInfo.fromJson(json['typeInfo'] as Map), - beginingDate: NonNullTimestampConverter.timestampToDateTime( - json['beginingDate'] as Timestamp), - lastTakenDate: TimestampConverter.timestampToDateTime( - json['lastTakenDate'] as Timestamp?), - createdAt: TimestampConverter.timestampToDateTime( - json['createdAt'] as Timestamp?), - deletedAt: TimestampConverter.timestampToDateTime( - json['deletedAt'] as Timestamp?), + typeInfo: PillSheetTypeInfo.fromJson(json['typeInfo'] as Map), + beginingDate: NonNullTimestampConverter.timestampToDateTime(json['beginingDate'] as Timestamp), + lastTakenDate: TimestampConverter.timestampToDateTime(json['lastTakenDate'] as Timestamp?), + createdAt: TimestampConverter.timestampToDateTime(json['createdAt'] as Timestamp?), + deletedAt: TimestampConverter.timestampToDateTime(json['deletedAt'] as Timestamp?), groupIndex: (json['groupIndex'] as num?)?.toInt() ?? 0, - restDurations: (json['restDurations'] as List?) - ?.map((e) => RestDuration.fromJson(e as Map)) - .toList() ?? - const [], + restDurations: (json['restDurations'] as List?)?.map((e) => RestDuration.fromJson(e as Map)).toList() ?? const [], ); Map _$$PillSheetImplToJson(_$PillSheetImpl instance) { @@ -76,10 +56,8 @@ Map _$$PillSheetImplToJson(_$PillSheetImpl instance) { writeNotNull('id', instance.id); val['typeInfo'] = instance.typeInfo.toJson(); - val['beginingDate'] = - NonNullTimestampConverter.dateTimeToTimestamp(instance.beginingDate); - val['lastTakenDate'] = - TimestampConverter.dateTimeToTimestamp(instance.lastTakenDate); + val['beginingDate'] = NonNullTimestampConverter.dateTimeToTimestamp(instance.beginingDate); + val['lastTakenDate'] = TimestampConverter.dateTimeToTimestamp(instance.lastTakenDate); val['createdAt'] = TimestampConverter.dateTimeToTimestamp(instance.createdAt); val['deletedAt'] = TimestampConverter.dateTimeToTimestamp(instance.deletedAt); val['groupIndex'] = instance.groupIndex; diff --git a/lib/entity/pill_sheet_group.codegen.dart b/lib/entity/pill_sheet_group.codegen.dart index 92cf3f16e7..d530ff84c0 100644 --- a/lib/entity/pill_sheet_group.codegen.dart +++ b/lib/entity/pill_sheet_group.codegen.dart @@ -38,13 +38,11 @@ class PillSheetGroup with _$PillSheetGroup { DateTime? deletedAt, // NOTE: [SyncData:Widget] このプロパティはWidgetに同期されてる PillSheetGroupDisplayNumberSetting? displayNumberSetting, - @Default(PillSheetAppearanceMode.number) - PillSheetAppearanceMode pillSheetAppearanceMode, + @Default(PillSheetAppearanceMode.number) PillSheetAppearanceMode pillSheetAppearanceMode, }) = _PillSheetGroup; PillSheetGroup._(); - factory PillSheetGroup.fromJson(Map json) => - _$PillSheetGroupFromJson(json); + factory PillSheetGroup.fromJson(Map json) => _$PillSheetGroupFromJson(json); PillSheet? get activePillSheet => activePillSheetWhen(now()); @@ -57,8 +55,7 @@ class PillSheetGroup with _$PillSheetGroup { if (pillSheet.id == null) { throw const FormatException("ピルシートの置き換えによる更新できませんでした"); } - final index = - pillSheets.indexWhere((element) => element.id == pillSheet.id); + final index = pillSheets.indexWhere((element) => element.id == pillSheet.id); if (index == -1) { throw FormatException("ピルシートの置き換えによる更新できませんでした。id: ${pillSheet.id}"); } @@ -78,15 +75,9 @@ class PillSheetGroup with _$PillSheetGroup { case PillSheetAppearanceMode.date: return 0; case PillSheetAppearanceMode.sequential: - return pillNumbersForSequential - .firstWhereOrNull((element) => isSameDay(element.date, today())) - ?.number ?? - 0; + return pillNumbersForSequential.firstWhereOrNull((element) => isSameDay(element.date, today()))?.number ?? 0; case PillSheetAppearanceMode.cyclicSequential: - return pillNumbersForCyclicSequential - .firstWhereOrNull((element) => isSameDay(element.date, today())) - ?.number ?? - 0; + return pillNumbersForCyclicSequential.firstWhereOrNull((element) => isSameDay(element.date, today()))?.number ?? 0; } } @@ -101,17 +92,9 @@ class PillSheetGroup with _$PillSheetGroup { case PillSheetAppearanceMode.date: return 0; case PillSheetAppearanceMode.sequential: - return pillNumbersForSequential - .firstWhereOrNull((element) => - isSameDay(element.date, activePillSheetLastTakenDate)) - ?.number ?? - 0; + return pillNumbersForSequential.firstWhereOrNull((element) => isSameDay(element.date, activePillSheetLastTakenDate))?.number ?? 0; case PillSheetAppearanceMode.cyclicSequential: - return pillNumbersForCyclicSequential - .firstWhereOrNull((element) => - isSameDay(element.date, activePillSheetLastTakenDate)) - ?.number ?? - 0; + return pillNumbersForCyclicSequential.firstWhereOrNull((element) => isSameDay(element.date, activePillSheetLastTakenDate))?.number ?? 0; } } @@ -127,8 +110,7 @@ class PillSheetGroup with _$PillSheetGroup { } } - List get pillSheetTypes => - pillSheets.map((e) => e.pillSheetType).toList(); + List get pillSheetTypes => pillSheets.map((e) => e.pillSheetType).toList(); List get restDurations { return pillSheets.fold>( @@ -137,12 +119,9 @@ class PillSheetGroup with _$PillSheetGroup { ); } - late final List - pillMarksPillNumber = _pillMarksPillNumber(); - late final List - pillNumbersForSequential = _pillNumbersForSequential(); - late final List - pillNumbersForCyclicSequential = _pillNumbersForCyclicSequential(); + late final List pillMarksPillNumber = _pillMarksPillNumber(); + late final List pillNumbersForSequential = _pillNumbersForSequential(); + late final List pillNumbersForCyclicSequential = _pillNumbersForCyclicSequential(); } extension PillSheetGroupDisplayDomain on PillSheetGroup { @@ -154,17 +133,13 @@ extension PillSheetGroupDisplayDomain on PillSheetGroup { }) { switch (pillSheetAppearanceMode) { case PillSheetAppearanceMode.sequential: - return _displaySequentialPillSheetNumber( - pageIndex: pageIndex, pillNumberInPillSheet: pillNumberInPillSheet); + return _displaySequentialPillSheetNumber(pageIndex: pageIndex, pillNumberInPillSheet: pillNumberInPillSheet); case PillSheetAppearanceMode.number: - return _displayPillNumberInPillSheet( - pillNumberInPillSheet: pillNumberInPillSheet); + return _displayPillNumberInPillSheet(pillNumberInPillSheet: pillNumberInPillSheet); case PillSheetAppearanceMode.date: - return _displayPillNumberInPillSheet( - pillNumberInPillSheet: pillNumberInPillSheet); + return _displayPillNumberInPillSheet(pillNumberInPillSheet: pillNumberInPillSheet); case PillSheetAppearanceMode.cyclicSequential: - return _displayCycleSequentialPillSheetNumber( - pageIndex: pageIndex, pillNumberInPillSheet: pillNumberInPillSheet); + return _displayCycleSequentialPillSheetNumber(pageIndex: pageIndex, pillNumberInPillSheet: pillNumberInPillSheet); } } @@ -174,19 +149,11 @@ extension PillSheetGroupDisplayDomain on PillSheetGroup { required int pillNumberInPillSheet, }) { return switch (pillSheetAppearanceMode) { - PillSheetAppearanceMode.number => _displayPillNumberInPillSheet( - pillNumberInPillSheet: pillNumberInPillSheet), - PillSheetAppearanceMode.date => premiumOrTrial - ? _displayPillSheetDate( - pageIndex: pageIndex, - pillNumberInPillSheet: pillNumberInPillSheet) - : _displayPillNumberInPillSheet( - pillNumberInPillSheet: pillNumberInPillSheet), - PillSheetAppearanceMode.sequential => _displaySequentialPillSheetNumber( - pageIndex: pageIndex, pillNumberInPillSheet: pillNumberInPillSheet), - PillSheetAppearanceMode.cyclicSequential => - _displayCycleSequentialPillSheetNumber( - pageIndex: pageIndex, pillNumberInPillSheet: pillNumberInPillSheet), + PillSheetAppearanceMode.number => _displayPillNumberInPillSheet(pillNumberInPillSheet: pillNumberInPillSheet), + PillSheetAppearanceMode.date => + premiumOrTrial ? _displayPillSheetDate(pageIndex: pageIndex, pillNumberInPillSheet: pillNumberInPillSheet) : _displayPillNumberInPillSheet(pillNumberInPillSheet: pillNumberInPillSheet), + PillSheetAppearanceMode.sequential => _displaySequentialPillSheetNumber(pageIndex: pageIndex, pillNumberInPillSheet: pillNumberInPillSheet), + PillSheetAppearanceMode.cyclicSequential => _displayCycleSequentialPillSheetNumber(pageIndex: pageIndex, pillNumberInPillSheet: pillNumberInPillSheet), }; } @@ -201,16 +168,14 @@ extension PillSheetGroupDisplayDomain on PillSheetGroup { required int pageIndex, required int pillNumberInPillSheet, }) { - return _displayPillSheetDate( - pageIndex: pageIndex, pillNumberInPillSheet: pillNumberInPillSheet); + return _displayPillSheetDate(pageIndex: pageIndex, pillNumberInPillSheet: pillNumberInPillSheet); } String _displayPillSheetDate({ required int pageIndex, required int pillNumberInPillSheet, }) { - return DateTimeFormatter.monthAndDay( - pillSheets[pageIndex].displayPillTakeDate(pillNumberInPillSheet)); + return DateTimeFormatter.monthAndDay(pillSheets[pageIndex].displayPillTakeDate(pillNumberInPillSheet)); } @visibleForTesting @@ -218,19 +183,14 @@ extension PillSheetGroupDisplayDomain on PillSheetGroup { required int pageIndex, required int pillNumberInPillSheet, }) { - return _displaySequentialPillSheetNumber( - pageIndex: pageIndex, pillNumberInPillSheet: pillNumberInPillSheet); + return _displaySequentialPillSheetNumber(pageIndex: pageIndex, pillNumberInPillSheet: pillNumberInPillSheet); } String _displaySequentialPillSheetNumber({ required int pageIndex, required int pillNumberInPillSheet, }) { - return pillNumbersForSequential - .where((e) => e.pillSheet.groupIndex == pageIndex) - .toList()[pillNumberInPillSheet - 1] - .number - .toString(); + return pillNumbersForSequential.where((e) => e.pillSheet.groupIndex == pageIndex).toList()[pillNumberInPillSheet - 1].number.toString(); } @visibleForTesting @@ -238,25 +198,19 @@ extension PillSheetGroupDisplayDomain on PillSheetGroup { required int pageIndex, required int pillNumberInPillSheet, }) { - return _displayCycleSequentialPillSheetNumber( - pageIndex: pageIndex, pillNumberInPillSheet: pillNumberInPillSheet); + return _displayCycleSequentialPillSheetNumber(pageIndex: pageIndex, pillNumberInPillSheet: pillNumberInPillSheet); } String _displayCycleSequentialPillSheetNumber({ required int pageIndex, required int pillNumberInPillSheet, }) { - return pillNumbersForCyclicSequential - .where((e) => e.pillSheet.groupIndex == pageIndex) - .toList()[pillNumberInPillSheet - 1] - .number - .toString(); + return pillNumbersForCyclicSequential.where((e) => e.pillSheet.groupIndex == pageIndex).toList()[pillNumberInPillSheet - 1].number.toString(); } } @freezed -class PillSheetGroupPillNumberDomainPillMarkValue - with _$PillSheetGroupPillNumberDomainPillMarkValue { +class PillSheetGroupPillNumberDomainPillMarkValue with _$PillSheetGroupPillNumberDomainPillMarkValue { const factory PillSheetGroupPillNumberDomainPillMarkValue({ required PillSheet pillSheet, required DateTime date, @@ -269,12 +223,10 @@ extension PillSheetGroupPillNumberDomain on PillSheetGroup { required PillSheet pillSheet, required PillSheetAppearanceMode pillSheetAppearanceMode, }) { - return pillMarks(pillSheetAppearanceMode: pillSheetAppearanceMode) - .firstWhere((e) => e.pillSheet.id == pillSheet.id); + return pillMarks(pillSheetAppearanceMode: pillSheetAppearanceMode).firstWhere((e) => e.pillSheet.id == pillSheet.id); } - List pillMarks( - {required PillSheetAppearanceMode pillSheetAppearanceMode}) { + List pillMarks({required PillSheetAppearanceMode pillSheetAppearanceMode}) { switch (pillSheetAppearanceMode) { // NOTE: 日付のbegin,endも.numberと一緒な扱いにする case PillSheetAppearanceMode.number: @@ -288,17 +240,10 @@ extension PillSheetGroupPillNumberDomain on PillSheetGroup { } List _pillMarksPillNumber() { - return pillSheets - .map((pillSheet) => pillSheet.dates.indexed - .map((e) => PillSheetGroupPillNumberDomainPillMarkValue( - pillSheet: pillSheet, date: e.$2, number: e.$1)) - .toList()) - .flattened - .toList(); + return pillSheets.map((pillSheet) => pillSheet.dates.indexed.map((e) => PillSheetGroupPillNumberDomainPillMarkValue(pillSheet: pillSheet, date: e.$2, number: e.$1)).toList()).flattened.toList(); } - List - _pillNumbersForSequential() { + List _pillNumbersForSequential() { List pillMarks = []; var offset = 0; for (final pillSheet in pillSheets) { @@ -319,29 +264,17 @@ extension PillSheetGroupPillNumberDomain on PillSheetGroup { if (displayNumberSetting != null) { final beginPillNumberOffset = displayNumberSetting.beginPillNumber; if (beginPillNumberOffset != null && beginPillNumberOffset > 0) { - pillMarks = pillMarks - .map( - (e) => e.copyWith(number: e.number + beginPillNumberOffset - 1)) - .toList(); + pillMarks = pillMarks.map((e) => e.copyWith(number: e.number + beginPillNumberOffset - 1)).toList(); } final endPillNumberOffset = displayNumberSetting.endPillNumber; if (endPillNumberOffset != null && endPillNumberOffset > 0) { - final endPillNumberOffsetIndexes = pillMarks.indexed - .where((e) => e.$2.number % endPillNumberOffset == 0) - .map((e) => e.$1); - final beginPillNumberOffsetIndexes = - endPillNumberOffsetIndexes.map((e) => e + 1).toList(); + final endPillNumberOffsetIndexes = pillMarks.indexed.where((e) => e.$2.number % endPillNumberOffset == 0).map((e) => e.$1); + final beginPillNumberOffsetIndexes = endPillNumberOffsetIndexes.map((e) => e + 1).toList(); for (int beginPillNumberOffsetIndex in beginPillNumberOffsetIndexes) { if (beginPillNumberOffsetIndex < pillMarks.length) { - for (final (sublistIndex, (pillMarkIndex, pillMark)) in pillMarks - .indexed - .toList() - .sublist(beginPillNumberOffsetIndex) - .indexed - .toList()) { - pillMarks[pillMarkIndex] = - pillMark.copyWith(number: sublistIndex + 1); + for (final (sublistIndex, (pillMarkIndex, pillMark)) in pillMarks.indexed.toList().sublist(beginPillNumberOffsetIndex).indexed.toList()) { + pillMarks[pillMarkIndex] = pillMark.copyWith(number: sublistIndex + 1); } } } @@ -351,8 +284,7 @@ extension PillSheetGroupPillNumberDomain on PillSheetGroup { return pillMarks; } - List - _pillNumbersForCyclicSequential() { + List _pillNumbersForCyclicSequential() { List pillMarks = []; var offset = 0; for (final pillSheet in pillSheets) { @@ -372,14 +304,10 @@ extension PillSheetGroupPillNumberDomain on PillSheetGroup { for (final restDuration in restDurations) { final restDurationEndDate = restDuration.endDate; if (restDurationEndDate != null) { - final index = pillMarks.indexed - .firstWhereOrNull((e) => isSameDay(e.$2.date, restDurationEndDate)) - ?.$1; + final index = pillMarks.indexed.firstWhereOrNull((e) => isSameDay(e.$2.date, restDurationEndDate))?.$1; if (index != null) { - for (final (sublistIndex, (pillMarkIndex, pillMark)) - in pillMarks.indexed.toList().sublist(index).indexed.toList()) { - pillMarks[pillMarkIndex] = - pillMark.copyWith(number: sublistIndex + 1); + for (final (sublistIndex, (pillMarkIndex, pillMark)) in pillMarks.indexed.toList().sublist(index).indexed.toList()) { + pillMarks[pillMarkIndex] = pillMark.copyWith(number: sublistIndex + 1); } } } @@ -389,29 +317,17 @@ extension PillSheetGroupPillNumberDomain on PillSheetGroup { if (displayNumberSetting != null) { final beginPillNumberOffset = displayNumberSetting.beginPillNumber; if (beginPillNumberOffset != null && beginPillNumberOffset > 0) { - pillMarks = pillMarks - .map( - (e) => e.copyWith(number: e.number + beginPillNumberOffset - 1)) - .toList(); + pillMarks = pillMarks.map((e) => e.copyWith(number: e.number + beginPillNumberOffset - 1)).toList(); } final endPillNumberOffset = displayNumberSetting.endPillNumber; if (endPillNumberOffset != null && endPillNumberOffset > 0) { - final endPillNumberOffsetIndexes = pillMarks.indexed - .where((e) => e.$2.number % endPillNumberOffset == 0) - .map((e) => e.$1); - final beginPillNumberOffsetIndexes = - endPillNumberOffsetIndexes.map((e) => e + 1).toList(); + final endPillNumberOffsetIndexes = pillMarks.indexed.where((e) => e.$2.number % endPillNumberOffset == 0).map((e) => e.$1); + final beginPillNumberOffsetIndexes = endPillNumberOffsetIndexes.map((e) => e + 1).toList(); for (int beginPillNumberOffsetIndex in beginPillNumberOffsetIndexes) { if (beginPillNumberOffsetIndex < pillMarks.length) { - for (final (sublistIndex, (pillMarkIndex, pillMark)) in pillMarks - .indexed - .toList() - .sublist(beginPillNumberOffsetIndex) - .indexed - .toList()) { - pillMarks[pillMarkIndex] = - pillMark.copyWith(number: sublistIndex + 1); + for (final (sublistIndex, (pillMarkIndex, pillMark)) in pillMarks.indexed.toList().sublist(beginPillNumberOffsetIndex).indexed.toList()) { + pillMarks[pillMarkIndex] = pillMark.copyWith(number: sublistIndex + 1); } } } @@ -446,44 +362,36 @@ extension PillSheetGroupPillNumberDomain on PillSheetGroup { extension PillSheetGroupMenstruationDomain on PillSheetGroup { List menstruationDateRanges({required Setting setting}) { // 0が設定できる。その場合は生理設定をあえて無視したいと考えて0を返す - if (setting.pillNumberForFromMenstruation == 0 || - setting.durationMenstruation == 0) { + if (setting.pillNumberForFromMenstruation == 0 || setting.durationMenstruation == 0) { return []; } final menstruationDateRanges = []; for (final pillSheet in pillSheets) { - if (setting.pillNumberForFromMenstruation < - pillSheet.typeInfo.totalCount) { - final left = pillSheet - .displayPillTakeDate(setting.pillNumberForFromMenstruation); + if (setting.pillNumberForFromMenstruation < pillSheet.typeInfo.totalCount) { + final left = pillSheet.displayPillTakeDate(setting.pillNumberForFromMenstruation); final right = left.addDays(setting.durationMenstruation - 1); menstruationDateRanges.add(DateRange(left, right)); } else { final summarizedPillCount = pillSheets.fold( 0, - (previousValue, element) => - previousValue + element.typeInfo.totalCount, + (previousValue, element) => previousValue + element.typeInfo.totalCount, ); // ピルシートグループの中に何度pillNumberForFromMenstruation が出てくるか算出 - final numberOfMenstruationSettingInPillSheetGroup = - summarizedPillCount ~/ setting.pillNumberForFromMenstruation; + final numberOfMenstruationSettingInPillSheetGroup = summarizedPillCount ~/ setting.pillNumberForFromMenstruation; // 28番ごとなら28,56,84番目開始の番号とマッチさせるために各始まりの番号を配列にする List fromMenstruations = []; for (var i = 0; i < numberOfMenstruationSettingInPillSheetGroup; i++) { - fromMenstruations.add(setting.pillNumberForFromMenstruation + - (setting.pillNumberForFromMenstruation * i)); + fromMenstruations.add(setting.pillNumberForFromMenstruation + (setting.pillNumberForFromMenstruation * i)); } - final offset = summarizedPillCountWithPillSheetTypesToIndex( - pillSheetTypes: pillSheetTypes, toIndex: pillSheet.groupIndex); + final offset = summarizedPillCountWithPillSheetTypesToIndex(pillSheetTypes: pillSheetTypes, toIndex: pillSheet.groupIndex); final begin = offset + 1; final end = begin + (pillSheet.typeInfo.totalCount - 1); for (final fromMenstruation in fromMenstruations) { if (begin <= fromMenstruation && fromMenstruation <= end) { - final left = - pillSheet.displayPillTakeDate(fromMenstruation - offset); + final left = pillSheet.displayPillTakeDate(fromMenstruation - offset); final right = left.addDays(setting.durationMenstruation - 1); menstruationDateRanges.add(DateRange(left, right)); } @@ -497,10 +405,7 @@ extension PillSheetGroupMenstruationDomain on PillSheetGroup { extension PillSheetGroupRestDurationDomain on PillSheetGroup { RestDuration? get lastActiveRestDuration { - return pillSheets - .map((e) => e.activeRestDuration) - .whereNotNull() - .firstOrNull; + return pillSheets.map((e) => e.activeRestDuration).whereNotNull().firstOrNull; } PillSheet get lastTakenPillSheetOrFirstPillSheet { @@ -518,8 +423,7 @@ extension PillSheetGroupRestDurationDomain on PillSheetGroup { if (lastTakenPillSheetOrFirstPillSheet.isTakenAll) { // 最後に飲んだピルシートのピルが全て服用済みの場合は、次のピルシートを対象としてrestDurationを設定する // すでに服用済みの場合は、次のピルの番号から服用お休みを開始する必要があるから - targetPillSheet = - pillSheets[lastTakenPillSheetOrFirstPillSheet.groupIndex + 1]; + targetPillSheet = pillSheets[lastTakenPillSheetOrFirstPillSheet.groupIndex + 1]; } else { targetPillSheet = lastTakenPillSheetOrFirstPillSheet; } @@ -545,15 +449,12 @@ extension PillSheetGroupRestDurationDomain on PillSheetGroup { } @freezed -class PillSheetGroupDisplayNumberSetting - with _$PillSheetGroupDisplayNumberSetting { +class PillSheetGroupDisplayNumberSetting with _$PillSheetGroupDisplayNumberSetting { @JsonSerializable(explicitToJson: true) const factory PillSheetGroupDisplayNumberSetting({ int? beginPillNumber, int? endPillNumber, }) = _PillSheetGroupDisplayNumberSetting; - factory PillSheetGroupDisplayNumberSetting.fromJson( - Map json) => - _$PillSheetGroupDisplayNumberSettingFromJson(json); + factory PillSheetGroupDisplayNumberSetting.fromJson(Map json) => _$PillSheetGroupDisplayNumberSettingFromJson(json); } diff --git a/lib/entity/pill_sheet_group.codegen.freezed.dart b/lib/entity/pill_sheet_group.codegen.freezed.dart index 1fb05ad125..c55f01b05f 100644 --- a/lib/entity/pill_sheet_group.codegen.freezed.dart +++ b/lib/entity/pill_sheet_group.codegen.freezed.dart @@ -24,44 +24,28 @@ mixin _$PillSheetGroup { String? get id => throw _privateConstructorUsedError; List get pillSheetIDs => throw _privateConstructorUsedError; List get pillSheets => throw _privateConstructorUsedError; - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get createdAt => throw _privateConstructorUsedError; - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? get deletedAt => - throw _privateConstructorUsedError; // NOTE: [SyncData:Widget] このプロパティはWidgetに同期されてる - PillSheetGroupDisplayNumberSetting? get displayNumberSetting => - throw _privateConstructorUsedError; - PillSheetAppearanceMode get pillSheetAppearanceMode => - throw _privateConstructorUsedError; + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) + DateTime? get deletedAt => throw _privateConstructorUsedError; // NOTE: [SyncData:Widget] このプロパティはWidgetに同期されてる + PillSheetGroupDisplayNumberSetting? get displayNumberSetting => throw _privateConstructorUsedError; + PillSheetAppearanceMode get pillSheetAppearanceMode => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $PillSheetGroupCopyWith get copyWith => - throw _privateConstructorUsedError; + $PillSheetGroupCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $PillSheetGroupCopyWith<$Res> { - factory $PillSheetGroupCopyWith( - PillSheetGroup value, $Res Function(PillSheetGroup) then) = - _$PillSheetGroupCopyWithImpl<$Res, PillSheetGroup>; + factory $PillSheetGroupCopyWith(PillSheetGroup value, $Res Function(PillSheetGroup) then) = _$PillSheetGroupCopyWithImpl<$Res, PillSheetGroup>; @useResult $Res call( {@JsonKey(includeIfNull: false) String? id, List pillSheetIDs, List pillSheets, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime createdAt, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? deletedAt, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime createdAt, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? deletedAt, PillSheetGroupDisplayNumberSetting? displayNumberSetting, PillSheetAppearanceMode pillSheetAppearanceMode}); @@ -69,8 +53,7 @@ abstract class $PillSheetGroupCopyWith<$Res> { } /// @nodoc -class _$PillSheetGroupCopyWithImpl<$Res, $Val extends PillSheetGroup> - implements $PillSheetGroupCopyWith<$Res> { +class _$PillSheetGroupCopyWithImpl<$Res, $Val extends PillSheetGroup> implements $PillSheetGroupCopyWith<$Res> { _$PillSheetGroupCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -128,33 +111,23 @@ class _$PillSheetGroupCopyWithImpl<$Res, $Val extends PillSheetGroup> return null; } - return $PillSheetGroupDisplayNumberSettingCopyWith<$Res>( - _value.displayNumberSetting!, (value) { + return $PillSheetGroupDisplayNumberSettingCopyWith<$Res>(_value.displayNumberSetting!, (value) { return _then(_value.copyWith(displayNumberSetting: value) as $Val); }); } } /// @nodoc -abstract class _$$PillSheetGroupImplCopyWith<$Res> - implements $PillSheetGroupCopyWith<$Res> { - factory _$$PillSheetGroupImplCopyWith(_$PillSheetGroupImpl value, - $Res Function(_$PillSheetGroupImpl) then) = - __$$PillSheetGroupImplCopyWithImpl<$Res>; +abstract class _$$PillSheetGroupImplCopyWith<$Res> implements $PillSheetGroupCopyWith<$Res> { + factory _$$PillSheetGroupImplCopyWith(_$PillSheetGroupImpl value, $Res Function(_$PillSheetGroupImpl) then) = __$$PillSheetGroupImplCopyWithImpl<$Res>; @override @useResult $Res call( {@JsonKey(includeIfNull: false) String? id, List pillSheetIDs, List pillSheets, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime createdAt, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? deletedAt, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime createdAt, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? deletedAt, PillSheetGroupDisplayNumberSetting? displayNumberSetting, PillSheetAppearanceMode pillSheetAppearanceMode}); @@ -163,12 +136,8 @@ abstract class _$$PillSheetGroupImplCopyWith<$Res> } /// @nodoc -class __$$PillSheetGroupImplCopyWithImpl<$Res> - extends _$PillSheetGroupCopyWithImpl<$Res, _$PillSheetGroupImpl> - implements _$$PillSheetGroupImplCopyWith<$Res> { - __$$PillSheetGroupImplCopyWithImpl( - _$PillSheetGroupImpl _value, $Res Function(_$PillSheetGroupImpl) _then) - : super(_value, _then); +class __$$PillSheetGroupImplCopyWithImpl<$Res> extends _$PillSheetGroupCopyWithImpl<$Res, _$PillSheetGroupImpl> implements _$$PillSheetGroupImplCopyWith<$Res> { + __$$PillSheetGroupImplCopyWithImpl(_$PillSheetGroupImpl _value, $Res Function(_$PillSheetGroupImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -222,22 +191,15 @@ class _$PillSheetGroupImpl extends _PillSheetGroup { {@JsonKey(includeIfNull: false) this.id, required final List pillSheetIDs, required final List pillSheets, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.createdAt, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - this.deletedAt, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.createdAt, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) this.deletedAt, this.displayNumberSetting, this.pillSheetAppearanceMode = PillSheetAppearanceMode.number}) : _pillSheetIDs = pillSheetIDs, _pillSheets = pillSheets, super._(); - factory _$PillSheetGroupImpl.fromJson(Map json) => - _$$PillSheetGroupImplFromJson(json); + factory _$PillSheetGroupImpl.fromJson(Map json) => _$$PillSheetGroupImplFromJson(json); @override @JsonKey(includeIfNull: false) @@ -259,14 +221,10 @@ class _$PillSheetGroupImpl extends _PillSheetGroup { } @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime createdAt; @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? deletedAt; // NOTE: [SyncData:Widget] このプロパティはWidgetに同期されてる @override @@ -286,39 +244,23 @@ class _$PillSheetGroupImpl extends _PillSheetGroup { (other.runtimeType == runtimeType && other is _$PillSheetGroupImpl && (identical(other.id, id) || other.id == id) && - const DeepCollectionEquality() - .equals(other._pillSheetIDs, _pillSheetIDs) && - const DeepCollectionEquality() - .equals(other._pillSheets, _pillSheets) && - (identical(other.createdAt, createdAt) || - other.createdAt == createdAt) && - (identical(other.deletedAt, deletedAt) || - other.deletedAt == deletedAt) && - (identical(other.displayNumberSetting, displayNumberSetting) || - other.displayNumberSetting == displayNumberSetting) && - (identical( - other.pillSheetAppearanceMode, pillSheetAppearanceMode) || - other.pillSheetAppearanceMode == pillSheetAppearanceMode)); + const DeepCollectionEquality().equals(other._pillSheetIDs, _pillSheetIDs) && + const DeepCollectionEquality().equals(other._pillSheets, _pillSheets) && + (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && + (identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt) && + (identical(other.displayNumberSetting, displayNumberSetting) || other.displayNumberSetting == displayNumberSetting) && + (identical(other.pillSheetAppearanceMode, pillSheetAppearanceMode) || other.pillSheetAppearanceMode == pillSheetAppearanceMode)); } @JsonKey(ignore: true) @override int get hashCode => Object.hash( - runtimeType, - id, - const DeepCollectionEquality().hash(_pillSheetIDs), - const DeepCollectionEquality().hash(_pillSheets), - createdAt, - deletedAt, - displayNumberSetting, - pillSheetAppearanceMode); + runtimeType, id, const DeepCollectionEquality().hash(_pillSheetIDs), const DeepCollectionEquality().hash(_pillSheets), createdAt, deletedAt, displayNumberSetting, pillSheetAppearanceMode); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PillSheetGroupImplCopyWith<_$PillSheetGroupImpl> get copyWith => - __$$PillSheetGroupImplCopyWithImpl<_$PillSheetGroupImpl>( - this, _$identity); + _$$PillSheetGroupImplCopyWith<_$PillSheetGroupImpl> get copyWith => __$$PillSheetGroupImplCopyWithImpl<_$PillSheetGroupImpl>(this, _$identity); @override Map toJson() { @@ -330,24 +272,16 @@ class _$PillSheetGroupImpl extends _PillSheetGroup { abstract class _PillSheetGroup extends PillSheetGroup { factory _PillSheetGroup( - {@JsonKey(includeIfNull: false) final String? id, - required final List pillSheetIDs, - required final List pillSheets, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime createdAt, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - final DateTime? deletedAt, - final PillSheetGroupDisplayNumberSetting? displayNumberSetting, - final PillSheetAppearanceMode pillSheetAppearanceMode}) = - _$PillSheetGroupImpl; + {@JsonKey(includeIfNull: false) final String? id, + required final List pillSheetIDs, + required final List pillSheets, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime createdAt, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? deletedAt, + final PillSheetGroupDisplayNumberSetting? displayNumberSetting, + final PillSheetAppearanceMode pillSheetAppearanceMode}) = _$PillSheetGroupImpl; _PillSheetGroup._() : super._(); - factory _PillSheetGroup.fromJson(Map json) = - _$PillSheetGroupImpl.fromJson; + factory _PillSheetGroup.fromJson(Map json) = _$PillSheetGroupImpl.fromJson; @override @JsonKey(includeIfNull: false) @@ -357,14 +291,10 @@ abstract class _PillSheetGroup extends PillSheetGroup { @override List get pillSheets; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get createdAt; @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get deletedAt; @override // NOTE: [SyncData:Widget] このプロパティはWidgetに同期されてる PillSheetGroupDisplayNumberSetting? get displayNumberSetting; @@ -372,8 +302,7 @@ abstract class _PillSheetGroup extends PillSheetGroup { PillSheetAppearanceMode get pillSheetAppearanceMode; @override @JsonKey(ignore: true) - _$$PillSheetGroupImplCopyWith<_$PillSheetGroupImpl> get copyWith => - throw _privateConstructorUsedError; + _$$PillSheetGroupImplCopyWith<_$PillSheetGroupImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc @@ -383,18 +312,13 @@ mixin _$PillSheetGroupPillNumberDomainPillMarkValue { int get number => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $PillSheetGroupPillNumberDomainPillMarkValueCopyWith< - PillSheetGroupPillNumberDomainPillMarkValue> - get copyWith => throw _privateConstructorUsedError; + $PillSheetGroupPillNumberDomainPillMarkValueCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $PillSheetGroupPillNumberDomainPillMarkValueCopyWith<$Res> { - factory $PillSheetGroupPillNumberDomainPillMarkValueCopyWith( - PillSheetGroupPillNumberDomainPillMarkValue value, - $Res Function(PillSheetGroupPillNumberDomainPillMarkValue) then) = - _$PillSheetGroupPillNumberDomainPillMarkValueCopyWithImpl<$Res, - PillSheetGroupPillNumberDomainPillMarkValue>; + factory $PillSheetGroupPillNumberDomainPillMarkValueCopyWith(PillSheetGroupPillNumberDomainPillMarkValue value, $Res Function(PillSheetGroupPillNumberDomainPillMarkValue) then) = + _$PillSheetGroupPillNumberDomainPillMarkValueCopyWithImpl<$Res, PillSheetGroupPillNumberDomainPillMarkValue>; @useResult $Res call({PillSheet pillSheet, DateTime date, int number}); @@ -402,11 +326,8 @@ abstract class $PillSheetGroupPillNumberDomainPillMarkValueCopyWith<$Res> { } /// @nodoc -class _$PillSheetGroupPillNumberDomainPillMarkValueCopyWithImpl<$Res, - $Val extends PillSheetGroupPillNumberDomainPillMarkValue> - implements $PillSheetGroupPillNumberDomainPillMarkValueCopyWith<$Res> { - _$PillSheetGroupPillNumberDomainPillMarkValueCopyWithImpl( - this._value, this._then); +class _$PillSheetGroupPillNumberDomainPillMarkValueCopyWithImpl<$Res, $Val extends PillSheetGroupPillNumberDomainPillMarkValue> implements $PillSheetGroupPillNumberDomainPillMarkValueCopyWith<$Res> { + _$PillSheetGroupPillNumberDomainPillMarkValueCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -446,12 +367,8 @@ class _$PillSheetGroupPillNumberDomainPillMarkValueCopyWithImpl<$Res, } /// @nodoc -abstract class _$$PillSheetGroupPillNumberDomainPillMarkValueImplCopyWith<$Res> - implements $PillSheetGroupPillNumberDomainPillMarkValueCopyWith<$Res> { - factory _$$PillSheetGroupPillNumberDomainPillMarkValueImplCopyWith( - _$PillSheetGroupPillNumberDomainPillMarkValueImpl value, - $Res Function(_$PillSheetGroupPillNumberDomainPillMarkValueImpl) - then) = +abstract class _$$PillSheetGroupPillNumberDomainPillMarkValueImplCopyWith<$Res> implements $PillSheetGroupPillNumberDomainPillMarkValueCopyWith<$Res> { + factory _$$PillSheetGroupPillNumberDomainPillMarkValueImplCopyWith(_$PillSheetGroupPillNumberDomainPillMarkValueImpl value, $Res Function(_$PillSheetGroupPillNumberDomainPillMarkValueImpl) then) = __$$PillSheetGroupPillNumberDomainPillMarkValueImplCopyWithImpl<$Res>; @override @useResult @@ -462,14 +379,9 @@ abstract class _$$PillSheetGroupPillNumberDomainPillMarkValueImplCopyWith<$Res> } /// @nodoc -class __$$PillSheetGroupPillNumberDomainPillMarkValueImplCopyWithImpl<$Res> - extends _$PillSheetGroupPillNumberDomainPillMarkValueCopyWithImpl<$Res, - _$PillSheetGroupPillNumberDomainPillMarkValueImpl> - implements - _$$PillSheetGroupPillNumberDomainPillMarkValueImplCopyWith<$Res> { - __$$PillSheetGroupPillNumberDomainPillMarkValueImplCopyWithImpl( - _$PillSheetGroupPillNumberDomainPillMarkValueImpl _value, - $Res Function(_$PillSheetGroupPillNumberDomainPillMarkValueImpl) _then) +class __$$PillSheetGroupPillNumberDomainPillMarkValueImplCopyWithImpl<$Res> extends _$PillSheetGroupPillNumberDomainPillMarkValueCopyWithImpl<$Res, _$PillSheetGroupPillNumberDomainPillMarkValueImpl> + implements _$$PillSheetGroupPillNumberDomainPillMarkValueImplCopyWith<$Res> { + __$$PillSheetGroupPillNumberDomainPillMarkValueImplCopyWithImpl(_$PillSheetGroupPillNumberDomainPillMarkValueImpl _value, $Res Function(_$PillSheetGroupPillNumberDomainPillMarkValueImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -498,10 +410,8 @@ class __$$PillSheetGroupPillNumberDomainPillMarkValueImplCopyWithImpl<$Res> /// @nodoc -class _$PillSheetGroupPillNumberDomainPillMarkValueImpl - implements _PillSheetGroupPillNumberDomainPillMarkValue { - const _$PillSheetGroupPillNumberDomainPillMarkValueImpl( - {required this.pillSheet, required this.date, required this.number}); +class _$PillSheetGroupPillNumberDomainPillMarkValueImpl implements _PillSheetGroupPillNumberDomainPillMarkValue { + const _$PillSheetGroupPillNumberDomainPillMarkValueImpl({required this.pillSheet, required this.date, required this.number}); @override final PillSheet pillSheet; @@ -520,8 +430,7 @@ class _$PillSheetGroupPillNumberDomainPillMarkValueImpl return identical(this, other) || (other.runtimeType == runtimeType && other is _$PillSheetGroupPillNumberDomainPillMarkValueImpl && - (identical(other.pillSheet, pillSheet) || - other.pillSheet == pillSheet) && + (identical(other.pillSheet, pillSheet) || other.pillSheet == pillSheet) && (identical(other.date, date) || other.date == date) && (identical(other.number, number) || other.number == number)); } @@ -532,20 +441,12 @@ class _$PillSheetGroupPillNumberDomainPillMarkValueImpl @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PillSheetGroupPillNumberDomainPillMarkValueImplCopyWith< - _$PillSheetGroupPillNumberDomainPillMarkValueImpl> - get copyWith => - __$$PillSheetGroupPillNumberDomainPillMarkValueImplCopyWithImpl< - _$PillSheetGroupPillNumberDomainPillMarkValueImpl>( - this, _$identity); + _$$PillSheetGroupPillNumberDomainPillMarkValueImplCopyWith<_$PillSheetGroupPillNumberDomainPillMarkValueImpl> get copyWith => + __$$PillSheetGroupPillNumberDomainPillMarkValueImplCopyWithImpl<_$PillSheetGroupPillNumberDomainPillMarkValueImpl>(this, _$identity); } -abstract class _PillSheetGroupPillNumberDomainPillMarkValue - implements PillSheetGroupPillNumberDomainPillMarkValue { - const factory _PillSheetGroupPillNumberDomainPillMarkValue( - {required final PillSheet pillSheet, - required final DateTime date, - required final int number}) = +abstract class _PillSheetGroupPillNumberDomainPillMarkValue implements PillSheetGroupPillNumberDomainPillMarkValue { + const factory _PillSheetGroupPillNumberDomainPillMarkValue({required final PillSheet pillSheet, required final DateTime date, required final int number}) = _$PillSheetGroupPillNumberDomainPillMarkValueImpl; @override @@ -556,13 +457,10 @@ abstract class _PillSheetGroupPillNumberDomainPillMarkValue int get number; @override @JsonKey(ignore: true) - _$$PillSheetGroupPillNumberDomainPillMarkValueImplCopyWith< - _$PillSheetGroupPillNumberDomainPillMarkValueImpl> - get copyWith => throw _privateConstructorUsedError; + _$$PillSheetGroupPillNumberDomainPillMarkValueImplCopyWith<_$PillSheetGroupPillNumberDomainPillMarkValueImpl> get copyWith => throw _privateConstructorUsedError; } -PillSheetGroupDisplayNumberSetting _$PillSheetGroupDisplayNumberSettingFromJson( - Map json) { +PillSheetGroupDisplayNumberSetting _$PillSheetGroupDisplayNumberSettingFromJson(Map json) { return _PillSheetGroupDisplayNumberSetting.fromJson(json); } @@ -573,26 +471,19 @@ mixin _$PillSheetGroupDisplayNumberSetting { Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $PillSheetGroupDisplayNumberSettingCopyWith< - PillSheetGroupDisplayNumberSetting> - get copyWith => throw _privateConstructorUsedError; + $PillSheetGroupDisplayNumberSettingCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $PillSheetGroupDisplayNumberSettingCopyWith<$Res> { - factory $PillSheetGroupDisplayNumberSettingCopyWith( - PillSheetGroupDisplayNumberSetting value, - $Res Function(PillSheetGroupDisplayNumberSetting) then) = - _$PillSheetGroupDisplayNumberSettingCopyWithImpl<$Res, - PillSheetGroupDisplayNumberSetting>; + factory $PillSheetGroupDisplayNumberSettingCopyWith(PillSheetGroupDisplayNumberSetting value, $Res Function(PillSheetGroupDisplayNumberSetting) then) = + _$PillSheetGroupDisplayNumberSettingCopyWithImpl<$Res, PillSheetGroupDisplayNumberSetting>; @useResult $Res call({int? beginPillNumber, int? endPillNumber}); } /// @nodoc -class _$PillSheetGroupDisplayNumberSettingCopyWithImpl<$Res, - $Val extends PillSheetGroupDisplayNumberSetting> - implements $PillSheetGroupDisplayNumberSettingCopyWith<$Res> { +class _$PillSheetGroupDisplayNumberSettingCopyWithImpl<$Res, $Val extends PillSheetGroupDisplayNumberSetting> implements $PillSheetGroupDisplayNumberSettingCopyWith<$Res> { _$PillSheetGroupDisplayNumberSettingCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -620,11 +511,8 @@ class _$PillSheetGroupDisplayNumberSettingCopyWithImpl<$Res, } /// @nodoc -abstract class _$$PillSheetGroupDisplayNumberSettingImplCopyWith<$Res> - implements $PillSheetGroupDisplayNumberSettingCopyWith<$Res> { - factory _$$PillSheetGroupDisplayNumberSettingImplCopyWith( - _$PillSheetGroupDisplayNumberSettingImpl value, - $Res Function(_$PillSheetGroupDisplayNumberSettingImpl) then) = +abstract class _$$PillSheetGroupDisplayNumberSettingImplCopyWith<$Res> implements $PillSheetGroupDisplayNumberSettingCopyWith<$Res> { + factory _$$PillSheetGroupDisplayNumberSettingImplCopyWith(_$PillSheetGroupDisplayNumberSettingImpl value, $Res Function(_$PillSheetGroupDisplayNumberSettingImpl) then) = __$$PillSheetGroupDisplayNumberSettingImplCopyWithImpl<$Res>; @override @useResult @@ -632,14 +520,9 @@ abstract class _$$PillSheetGroupDisplayNumberSettingImplCopyWith<$Res> } /// @nodoc -class __$$PillSheetGroupDisplayNumberSettingImplCopyWithImpl<$Res> - extends _$PillSheetGroupDisplayNumberSettingCopyWithImpl<$Res, - _$PillSheetGroupDisplayNumberSettingImpl> +class __$$PillSheetGroupDisplayNumberSettingImplCopyWithImpl<$Res> extends _$PillSheetGroupDisplayNumberSettingCopyWithImpl<$Res, _$PillSheetGroupDisplayNumberSettingImpl> implements _$$PillSheetGroupDisplayNumberSettingImplCopyWith<$Res> { - __$$PillSheetGroupDisplayNumberSettingImplCopyWithImpl( - _$PillSheetGroupDisplayNumberSettingImpl _value, - $Res Function(_$PillSheetGroupDisplayNumberSettingImpl) _then) - : super(_value, _then); + __$$PillSheetGroupDisplayNumberSettingImplCopyWithImpl(_$PillSheetGroupDisplayNumberSettingImpl _value, $Res Function(_$PillSheetGroupDisplayNumberSettingImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -663,14 +546,10 @@ class __$$PillSheetGroupDisplayNumberSettingImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PillSheetGroupDisplayNumberSettingImpl - implements _PillSheetGroupDisplayNumberSetting { - const _$PillSheetGroupDisplayNumberSettingImpl( - {this.beginPillNumber, this.endPillNumber}); +class _$PillSheetGroupDisplayNumberSettingImpl implements _PillSheetGroupDisplayNumberSetting { + const _$PillSheetGroupDisplayNumberSettingImpl({this.beginPillNumber, this.endPillNumber}); - factory _$PillSheetGroupDisplayNumberSettingImpl.fromJson( - Map json) => - _$$PillSheetGroupDisplayNumberSettingImplFromJson(json); + factory _$PillSheetGroupDisplayNumberSettingImpl.fromJson(Map json) => _$$PillSheetGroupDisplayNumberSettingImplFromJson(json); @override final int? beginPillNumber; @@ -687,10 +566,8 @@ class _$PillSheetGroupDisplayNumberSettingImpl return identical(this, other) || (other.runtimeType == runtimeType && other is _$PillSheetGroupDisplayNumberSettingImpl && - (identical(other.beginPillNumber, beginPillNumber) || - other.beginPillNumber == beginPillNumber) && - (identical(other.endPillNumber, endPillNumber) || - other.endPillNumber == endPillNumber)); + (identical(other.beginPillNumber, beginPillNumber) || other.beginPillNumber == beginPillNumber) && + (identical(other.endPillNumber, endPillNumber) || other.endPillNumber == endPillNumber)); } @JsonKey(ignore: true) @@ -700,10 +577,8 @@ class _$PillSheetGroupDisplayNumberSettingImpl @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PillSheetGroupDisplayNumberSettingImplCopyWith< - _$PillSheetGroupDisplayNumberSettingImpl> - get copyWith => __$$PillSheetGroupDisplayNumberSettingImplCopyWithImpl< - _$PillSheetGroupDisplayNumberSettingImpl>(this, _$identity); + _$$PillSheetGroupDisplayNumberSettingImplCopyWith<_$PillSheetGroupDisplayNumberSettingImpl> get copyWith => + __$$PillSheetGroupDisplayNumberSettingImplCopyWithImpl<_$PillSheetGroupDisplayNumberSettingImpl>(this, _$identity); @override Map toJson() { @@ -713,15 +588,10 @@ class _$PillSheetGroupDisplayNumberSettingImpl } } -abstract class _PillSheetGroupDisplayNumberSetting - implements PillSheetGroupDisplayNumberSetting { - const factory _PillSheetGroupDisplayNumberSetting( - {final int? beginPillNumber, - final int? endPillNumber}) = _$PillSheetGroupDisplayNumberSettingImpl; +abstract class _PillSheetGroupDisplayNumberSetting implements PillSheetGroupDisplayNumberSetting { + const factory _PillSheetGroupDisplayNumberSetting({final int? beginPillNumber, final int? endPillNumber}) = _$PillSheetGroupDisplayNumberSettingImpl; - factory _PillSheetGroupDisplayNumberSetting.fromJson( - Map json) = - _$PillSheetGroupDisplayNumberSettingImpl.fromJson; + factory _PillSheetGroupDisplayNumberSetting.fromJson(Map json) = _$PillSheetGroupDisplayNumberSettingImpl.fromJson; @override int? get beginPillNumber; @@ -729,7 +599,5 @@ abstract class _PillSheetGroupDisplayNumberSetting int? get endPillNumber; @override @JsonKey(ignore: true) - _$$PillSheetGroupDisplayNumberSettingImplCopyWith< - _$PillSheetGroupDisplayNumberSettingImpl> - get copyWith => throw _privateConstructorUsedError; + _$$PillSheetGroupDisplayNumberSettingImplCopyWith<_$PillSheetGroupDisplayNumberSettingImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/entity/pill_sheet_group.codegen.g.dart b/lib/entity/pill_sheet_group.codegen.g.dart index 45a46bf7ef..7610dd1787 100644 --- a/lib/entity/pill_sheet_group.codegen.g.dart +++ b/lib/entity/pill_sheet_group.codegen.g.dart @@ -6,31 +6,17 @@ part of 'pill_sheet_group.codegen.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PillSheetGroupImpl _$$PillSheetGroupImplFromJson(Map json) => - _$PillSheetGroupImpl( +_$PillSheetGroupImpl _$$PillSheetGroupImplFromJson(Map json) => _$PillSheetGroupImpl( id: json['id'] as String?, - pillSheetIDs: (json['pillSheetIDs'] as List) - .map((e) => e as String) - .toList(), - pillSheets: (json['pillSheets'] as List) - .map((e) => PillSheet.fromJson(e as Map)) - .toList(), - createdAt: NonNullTimestampConverter.timestampToDateTime( - json['createdAt'] as Timestamp), - deletedAt: TimestampConverter.timestampToDateTime( - json['deletedAt'] as Timestamp?), - displayNumberSetting: json['displayNumberSetting'] == null - ? null - : PillSheetGroupDisplayNumberSetting.fromJson( - json['displayNumberSetting'] as Map), - pillSheetAppearanceMode: $enumDecodeNullable( - _$PillSheetAppearanceModeEnumMap, - json['pillSheetAppearanceMode']) ?? - PillSheetAppearanceMode.number, + pillSheetIDs: (json['pillSheetIDs'] as List).map((e) => e as String).toList(), + pillSheets: (json['pillSheets'] as List).map((e) => PillSheet.fromJson(e as Map)).toList(), + createdAt: NonNullTimestampConverter.timestampToDateTime(json['createdAt'] as Timestamp), + deletedAt: TimestampConverter.timestampToDateTime(json['deletedAt'] as Timestamp?), + displayNumberSetting: json['displayNumberSetting'] == null ? null : PillSheetGroupDisplayNumberSetting.fromJson(json['displayNumberSetting'] as Map), + pillSheetAppearanceMode: $enumDecodeNullable(_$PillSheetAppearanceModeEnumMap, json['pillSheetAppearanceMode']) ?? PillSheetAppearanceMode.number, ); -Map _$$PillSheetGroupImplToJson( - _$PillSheetGroupImpl instance) { +Map _$$PillSheetGroupImplToJson(_$PillSheetGroupImpl instance) { final val = {}; void writeNotNull(String key, dynamic value) { @@ -42,12 +28,10 @@ Map _$$PillSheetGroupImplToJson( writeNotNull('id', instance.id); val['pillSheetIDs'] = instance.pillSheetIDs; val['pillSheets'] = instance.pillSheets.map((e) => e.toJson()).toList(); - val['createdAt'] = - NonNullTimestampConverter.dateTimeToTimestamp(instance.createdAt); + val['createdAt'] = NonNullTimestampConverter.dateTimeToTimestamp(instance.createdAt); val['deletedAt'] = TimestampConverter.dateTimeToTimestamp(instance.deletedAt); val['displayNumberSetting'] = instance.displayNumberSetting?.toJson(); - val['pillSheetAppearanceMode'] = - _$PillSheetAppearanceModeEnumMap[instance.pillSheetAppearanceMode]!; + val['pillSheetAppearanceMode'] = _$PillSheetAppearanceModeEnumMap[instance.pillSheetAppearanceMode]!; return val; } @@ -58,17 +42,12 @@ const _$PillSheetAppearanceModeEnumMap = { PillSheetAppearanceMode.cyclicSequential: 'cyclicSequential', }; -_$PillSheetGroupDisplayNumberSettingImpl - _$$PillSheetGroupDisplayNumberSettingImplFromJson( - Map json) => - _$PillSheetGroupDisplayNumberSettingImpl( - beginPillNumber: (json['beginPillNumber'] as num?)?.toInt(), - endPillNumber: (json['endPillNumber'] as num?)?.toInt(), - ); +_$PillSheetGroupDisplayNumberSettingImpl _$$PillSheetGroupDisplayNumberSettingImplFromJson(Map json) => _$PillSheetGroupDisplayNumberSettingImpl( + beginPillNumber: (json['beginPillNumber'] as num?)?.toInt(), + endPillNumber: (json['endPillNumber'] as num?)?.toInt(), + ); -Map _$$PillSheetGroupDisplayNumberSettingImplToJson( - _$PillSheetGroupDisplayNumberSettingImpl instance) => - { +Map _$$PillSheetGroupDisplayNumberSettingImplToJson(_$PillSheetGroupDisplayNumberSettingImpl instance) => { 'beginPillNumber': instance.beginPillNumber, 'endPillNumber': instance.endPillNumber, }; diff --git a/lib/entity/pill_sheet_modified_history.codegen.dart b/lib/entity/pill_sheet_modified_history.codegen.dart index 6314d15cc9..306935a01c 100644 --- a/lib/entity/pill_sheet_modified_history.codegen.dart +++ b/lib/entity/pill_sheet_modified_history.codegen.dart @@ -120,17 +120,12 @@ class PillSheetModifiedHistory with _$PillSheetModifiedHistory { }) = _PillSheetModifiedHistory; const PillSheetModifiedHistory._(); - factory PillSheetModifiedHistory.fromJson(Map json) => - _$PillSheetModifiedHistoryFromJson(json); + factory PillSheetModifiedHistory.fromJson(Map json) => _$PillSheetModifiedHistoryFromJson(json); - PillSheetModifiedActionType? get enumActionType => - PillSheetModifiedActionType.values - .firstWhereOrNull((element) => element.name == actionType); + PillSheetModifiedActionType? get enumActionType => PillSheetModifiedActionType.values.firstWhereOrNull((element) => element.name == actionType); - PillSheet? get beforeActivePillSheet => - beforePillSheetGroup?.activePillSheetWhen(estimatedEventCausingDate); - PillSheet? get afterActivePillSheet => - afterPillSheetGroup?.activePillSheetWhen(estimatedEventCausingDate); + PillSheet? get beforeActivePillSheet => beforePillSheetGroup?.activePillSheetWhen(estimatedEventCausingDate); + PillSheet? get afterActivePillSheet => afterPillSheetGroup?.activePillSheetWhen(estimatedEventCausingDate); } // Factories @@ -184,8 +179,7 @@ abstract class PillSheetModifiedHistoryServiceActionFactory { final afterID = after.id; final afterLastTakenDate = after.lastTakenDate; if (afterID == null || afterLastTakenDate == null) { - throw FormatException( - "unexpected afterPillSheetID: $afterID or lastTakenDate:${after.lastTakenDate} is null for takenPill action"); + throw FormatException("unexpected afterPillSheetID: $afterID or lastTakenDate:${after.lastTakenDate} is null for takenPill action"); } return _create( actionType: PillSheetModifiedActionType.takenPill, @@ -220,14 +214,12 @@ abstract class PillSheetModifiedHistoryServiceActionFactory { final afterID = after.id; final afterLastTakenDate = after.lastTakenDate; if (afterID == null || afterLastTakenDate == null) { - throw FormatException( - "unexpected afterPillSheetID: $afterID or lastTakenDate:${after.lastTakenDate} is null for revertTakenPill action"); + throw FormatException("unexpected afterPillSheetID: $afterID or lastTakenDate:${after.lastTakenDate} is null for revertTakenPill action"); } final beforeID = before.id; final beforeLastTakenDate = before.lastTakenDate; if (beforeID == null || beforeLastTakenDate == null) { - throw FormatException( - "unexpected before pill sheet id or lastTakenDate is null id: ${before.id}, lastTakenDate: ${before.lastTakenDate} for revertTakenPill action"); + throw FormatException("unexpected before pill sheet id or lastTakenDate is null id: ${before.id}, lastTakenDate: ${before.lastTakenDate} for revertTakenPill action"); } return _create( actionType: PillSheetModifiedActionType.revertTakenPill, @@ -286,8 +278,7 @@ abstract class PillSheetModifiedHistoryServiceActionFactory { final afterID = after.id; if (afterID == null || pillSheetGroupID == null) { - throw FormatException( - "unexpected pillSheetGroupID: $pillSheetGroupID, or afterPillSheetID: $afterID is null for changePillNumber action"); + throw FormatException("unexpected pillSheetGroupID: $pillSheetGroupID, or afterPillSheetID: $afterID is null for changePillNumber action"); } return _create( diff --git a/lib/entity/pill_sheet_modified_history.codegen.freezed.dart b/lib/entity/pill_sheet_modified_history.codegen.freezed.dart index 5ef3db1e48..bfbd6aa765 100644 --- a/lib/entity/pill_sheet_modified_history.codegen.freezed.dart +++ b/lib/entity/pill_sheet_modified_history.codegen.freezed.dart @@ -14,63 +14,46 @@ T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); -PillSheetModifiedHistory _$PillSheetModifiedHistoryFromJson( - Map json) { +PillSheetModifiedHistory _$PillSheetModifiedHistoryFromJson(Map json) { return _PillSheetModifiedHistory.fromJson(json); } /// @nodoc mixin _$PillSheetModifiedHistory { // Added since 2023-08-01 - dynamic get version => - throw _privateConstructorUsedError; // ============ BEGIN: Added since v1 ============ + dynamic get version => throw _privateConstructorUsedError; // ============ BEGIN: Added since v1 ============ @JsonKey(includeIfNull: false) String? get id => throw _privateConstructorUsedError; String get actionType => throw _privateConstructorUsedError; - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get estimatedEventCausingDate => throw _privateConstructorUsedError; - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime get createdAt => - throw _privateConstructorUsedError; // ============ END: Added since v1 ============ + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) + DateTime get createdAt => throw _privateConstructorUsedError; // ============ END: Added since v1 ============ // ============ BEGIN: Added since v2 ============ // beforePillSheetGroup and afterPillSheetGroup is nullable // Because, actions for createdPillSheet and deletedPillSheet are not exists target single pill sheet - PillSheetGroup? get beforePillSheetGroup => - throw _privateConstructorUsedError; + PillSheetGroup? get beforePillSheetGroup => throw _privateConstructorUsedError; PillSheetGroup? get afterPillSheetGroup => throw _privateConstructorUsedError; - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? get ttlExpiresDateTime => - throw _privateConstructorUsedError; // TODO: [Archive-PillSheetModifiedHistory]: 2024-04以降に対応 + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) + DateTime? get ttlExpiresDateTime => throw _privateConstructorUsedError; // TODO: [Archive-PillSheetModifiedHistory]: 2024-04以降に対応 // 古いPillSheetModifiedHistoryのisArchivedにインデックスが貼られないため、TTLの期間内のデータが残っている間はこのフィールドが使えない // null含めて値を入れないとクエリの条件に合致しないので、2024-04まではarchivedDateTime,isArchivedのデータが必ず存在するPillSheetModifiedHistoryの準備機関とする // バッチを書いても良いが件数が多いのでこの方法をとっている - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get archivedDateTime => throw _privateConstructorUsedError; // archivedDateTime isNull: false の条件だと、下記のエラーの条件に引っ掛かるため、archivedDateTime以外にもisArchivedを用意している。isArchived == true | isArchived == false の用途で使う // You can combine constraints with a logical AND by chaining multiple equality operators (== or array-contains). However, you must create a composite index to combine equality operators with the inequality operators, <, <=, >, and !=. - bool get isArchived => - throw _privateConstructorUsedError; // ============ END: Added since v2 ============ + bool get isArchived => throw _privateConstructorUsedError; // ============ END: Added since v2 ============ // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 // Instead of calculating from beforePillSheetGroup and afterPillSheetGroup - PillSheetModifiedHistoryValue get value => - throw _privateConstructorUsedError; // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 + PillSheetModifiedHistoryValue get value => throw _privateConstructorUsedError; // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 // Instead of beforePillSheetID and afterPillSheetID - String? get pillSheetID => - throw _privateConstructorUsedError; // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 + String? get pillSheetID => throw _privateConstructorUsedError; // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 // There are new properties for pill_sheet grouping. So it's all optional String? get pillSheetGroupID => throw _privateConstructorUsedError; String? get beforePillSheetID => throw _privateConstructorUsedError; - String? get afterPillSheetID => - throw _privateConstructorUsedError; // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 + String? get afterPillSheetID => throw _privateConstructorUsedError; // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 // Instead of beforePillSheetGroup and afterPillSheetGroup // before and after is nullable // Because, actions for createdPillSheet and deletedPillSheet are not exists target single pill sheet @@ -79,38 +62,23 @@ mixin _$PillSheetModifiedHistory { Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $PillSheetModifiedHistoryCopyWith get copyWith => - throw _privateConstructorUsedError; + $PillSheetModifiedHistoryCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $PillSheetModifiedHistoryCopyWith<$Res> { - factory $PillSheetModifiedHistoryCopyWith(PillSheetModifiedHistory value, - $Res Function(PillSheetModifiedHistory) then) = - _$PillSheetModifiedHistoryCopyWithImpl<$Res, PillSheetModifiedHistory>; + factory $PillSheetModifiedHistoryCopyWith(PillSheetModifiedHistory value, $Res Function(PillSheetModifiedHistory) then) = _$PillSheetModifiedHistoryCopyWithImpl<$Res, PillSheetModifiedHistory>; @useResult $Res call( {dynamic version, @JsonKey(includeIfNull: false) String? id, String actionType, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime estimatedEventCausingDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime createdAt, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime estimatedEventCausingDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime createdAt, PillSheetGroup? beforePillSheetGroup, PillSheetGroup? afterPillSheetGroup, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? ttlExpiresDateTime, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? archivedDateTime, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? ttlExpiresDateTime, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? archivedDateTime, bool isArchived, PillSheetModifiedHistoryValue value, String? pillSheetID, @@ -128,9 +96,7 @@ abstract class $PillSheetModifiedHistoryCopyWith<$Res> { } /// @nodoc -class _$PillSheetModifiedHistoryCopyWithImpl<$Res, - $Val extends PillSheetModifiedHistory> - implements $PillSheetModifiedHistoryCopyWith<$Res> { +class _$PillSheetModifiedHistoryCopyWithImpl<$Res, $Val extends PillSheetModifiedHistory> implements $PillSheetModifiedHistoryCopyWith<$Res> { _$PillSheetModifiedHistoryCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -289,36 +255,20 @@ class _$PillSheetModifiedHistoryCopyWithImpl<$Res, } /// @nodoc -abstract class _$$PillSheetModifiedHistoryImplCopyWith<$Res> - implements $PillSheetModifiedHistoryCopyWith<$Res> { - factory _$$PillSheetModifiedHistoryImplCopyWith( - _$PillSheetModifiedHistoryImpl value, - $Res Function(_$PillSheetModifiedHistoryImpl) then) = - __$$PillSheetModifiedHistoryImplCopyWithImpl<$Res>; +abstract class _$$PillSheetModifiedHistoryImplCopyWith<$Res> implements $PillSheetModifiedHistoryCopyWith<$Res> { + factory _$$PillSheetModifiedHistoryImplCopyWith(_$PillSheetModifiedHistoryImpl value, $Res Function(_$PillSheetModifiedHistoryImpl) then) = __$$PillSheetModifiedHistoryImplCopyWithImpl<$Res>; @override @useResult $Res call( {dynamic version, @JsonKey(includeIfNull: false) String? id, String actionType, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime estimatedEventCausingDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime createdAt, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime estimatedEventCausingDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime createdAt, PillSheetGroup? beforePillSheetGroup, PillSheetGroup? afterPillSheetGroup, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? ttlExpiresDateTime, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? archivedDateTime, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? ttlExpiresDateTime, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? archivedDateTime, bool isArchived, PillSheetModifiedHistoryValue value, String? pillSheetID, @@ -341,14 +291,8 @@ abstract class _$$PillSheetModifiedHistoryImplCopyWith<$Res> } /// @nodoc -class __$$PillSheetModifiedHistoryImplCopyWithImpl<$Res> - extends _$PillSheetModifiedHistoryCopyWithImpl<$Res, - _$PillSheetModifiedHistoryImpl> - implements _$$PillSheetModifiedHistoryImplCopyWith<$Res> { - __$$PillSheetModifiedHistoryImplCopyWithImpl( - _$PillSheetModifiedHistoryImpl _value, - $Res Function(_$PillSheetModifiedHistoryImpl) _then) - : super(_value, _then); +class __$$PillSheetModifiedHistoryImplCopyWithImpl<$Res> extends _$PillSheetModifiedHistoryCopyWithImpl<$Res, _$PillSheetModifiedHistoryImpl> implements _$$PillSheetModifiedHistoryImplCopyWith<$Res> { + __$$PillSheetModifiedHistoryImplCopyWithImpl(_$PillSheetModifiedHistoryImpl _value, $Res Function(_$PillSheetModifiedHistoryImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -449,24 +393,12 @@ class _$PillSheetModifiedHistoryImpl extends _PillSheetModifiedHistory { {this.version = "v1", @JsonKey(includeIfNull: false) required this.id, required this.actionType, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.estimatedEventCausingDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.createdAt, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.estimatedEventCausingDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.createdAt, required this.beforePillSheetGroup, required this.afterPillSheetGroup, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - this.ttlExpiresDateTime, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - this.archivedDateTime, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) this.ttlExpiresDateTime, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) this.archivedDateTime, this.isArchived = false, required this.value, required this.pillSheetID, @@ -477,8 +409,7 @@ class _$PillSheetModifiedHistoryImpl extends _PillSheetModifiedHistory { required this.after}) : super._(); - factory _$PillSheetModifiedHistoryImpl.fromJson(Map json) => - _$$PillSheetModifiedHistoryImplFromJson(json); + factory _$PillSheetModifiedHistoryImpl.fromJson(Map json) => _$$PillSheetModifiedHistoryImplFromJson(json); // Added since 2023-08-01 @override @@ -491,14 +422,10 @@ class _$PillSheetModifiedHistoryImpl extends _PillSheetModifiedHistory { @override final String actionType; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime estimatedEventCausingDate; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime createdAt; // ============ END: Added since v1 ============ // ============ BEGIN: Added since v2 ============ @@ -509,18 +436,14 @@ class _$PillSheetModifiedHistoryImpl extends _PillSheetModifiedHistory { @override final PillSheetGroup? afterPillSheetGroup; @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? ttlExpiresDateTime; // TODO: [Archive-PillSheetModifiedHistory]: 2024-04以降に対応 // 古いPillSheetModifiedHistoryのisArchivedにインデックスが貼られないため、TTLの期間内のデータが残っている間はこのフィールドが使えない // null含めて値を入れないとクエリの条件に合致しないので、2024-04まではarchivedDateTime,isArchivedのデータが必ず存在するPillSheetModifiedHistoryの準備機関とする // バッチを書いても良いが件数が多いのでこの方法をとっている @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? archivedDateTime; // archivedDateTime isNull: false の条件だと、下記のエラーの条件に引っ掛かるため、archivedDateTime以外にもisArchivedを用意している。isArchived == true | isArchived == false の用途で使う // You can combine constraints with a logical AND by chaining multiple equality operators (== or array-contains). However, you must create a composite index to combine equality operators with the inequality operators, <, <=, >, and !=. @@ -566,64 +489,32 @@ class _$PillSheetModifiedHistoryImpl extends _PillSheetModifiedHistory { other is _$PillSheetModifiedHistoryImpl && const DeepCollectionEquality().equals(other.version, version) && (identical(other.id, id) || other.id == id) && - (identical(other.actionType, actionType) || - other.actionType == actionType) && - (identical(other.estimatedEventCausingDate, - estimatedEventCausingDate) || - other.estimatedEventCausingDate == estimatedEventCausingDate) && - (identical(other.createdAt, createdAt) || - other.createdAt == createdAt) && - (identical(other.beforePillSheetGroup, beforePillSheetGroup) || - other.beforePillSheetGroup == beforePillSheetGroup) && - (identical(other.afterPillSheetGroup, afterPillSheetGroup) || - other.afterPillSheetGroup == afterPillSheetGroup) && - (identical(other.ttlExpiresDateTime, ttlExpiresDateTime) || - other.ttlExpiresDateTime == ttlExpiresDateTime) && - (identical(other.archivedDateTime, archivedDateTime) || - other.archivedDateTime == archivedDateTime) && - (identical(other.isArchived, isArchived) || - other.isArchived == isArchived) && + (identical(other.actionType, actionType) || other.actionType == actionType) && + (identical(other.estimatedEventCausingDate, estimatedEventCausingDate) || other.estimatedEventCausingDate == estimatedEventCausingDate) && + (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && + (identical(other.beforePillSheetGroup, beforePillSheetGroup) || other.beforePillSheetGroup == beforePillSheetGroup) && + (identical(other.afterPillSheetGroup, afterPillSheetGroup) || other.afterPillSheetGroup == afterPillSheetGroup) && + (identical(other.ttlExpiresDateTime, ttlExpiresDateTime) || other.ttlExpiresDateTime == ttlExpiresDateTime) && + (identical(other.archivedDateTime, archivedDateTime) || other.archivedDateTime == archivedDateTime) && + (identical(other.isArchived, isArchived) || other.isArchived == isArchived) && (identical(other.value, value) || other.value == value) && - (identical(other.pillSheetID, pillSheetID) || - other.pillSheetID == pillSheetID) && - (identical(other.pillSheetGroupID, pillSheetGroupID) || - other.pillSheetGroupID == pillSheetGroupID) && - (identical(other.beforePillSheetID, beforePillSheetID) || - other.beforePillSheetID == beforePillSheetID) && - (identical(other.afterPillSheetID, afterPillSheetID) || - other.afterPillSheetID == afterPillSheetID) && + (identical(other.pillSheetID, pillSheetID) || other.pillSheetID == pillSheetID) && + (identical(other.pillSheetGroupID, pillSheetGroupID) || other.pillSheetGroupID == pillSheetGroupID) && + (identical(other.beforePillSheetID, beforePillSheetID) || other.beforePillSheetID == beforePillSheetID) && + (identical(other.afterPillSheetID, afterPillSheetID) || other.afterPillSheetID == afterPillSheetID) && (identical(other.before, before) || other.before == before) && (identical(other.after, after) || other.after == after)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(version), - id, - actionType, - estimatedEventCausingDate, - createdAt, - beforePillSheetGroup, - afterPillSheetGroup, - ttlExpiresDateTime, - archivedDateTime, - isArchived, - value, - pillSheetID, - pillSheetGroupID, - beforePillSheetID, - afterPillSheetID, - before, - after); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(version), id, actionType, estimatedEventCausingDate, createdAt, beforePillSheetGroup, afterPillSheetGroup, + ttlExpiresDateTime, archivedDateTime, isArchived, value, pillSheetID, pillSheetGroupID, beforePillSheetID, afterPillSheetID, before, after); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PillSheetModifiedHistoryImplCopyWith<_$PillSheetModifiedHistoryImpl> - get copyWith => __$$PillSheetModifiedHistoryImplCopyWithImpl< - _$PillSheetModifiedHistoryImpl>(this, _$identity); + _$$PillSheetModifiedHistoryImplCopyWith<_$PillSheetModifiedHistoryImpl> get copyWith => __$$PillSheetModifiedHistoryImplCopyWithImpl<_$PillSheetModifiedHistoryImpl>(this, _$identity); @override Map toJson() { @@ -638,24 +529,12 @@ abstract class _PillSheetModifiedHistory extends PillSheetModifiedHistory { {final dynamic version, @JsonKey(includeIfNull: false) required final String? id, required final String actionType, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime estimatedEventCausingDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime createdAt, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime estimatedEventCausingDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime createdAt, required final PillSheetGroup? beforePillSheetGroup, required final PillSheetGroup? afterPillSheetGroup, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - final DateTime? ttlExpiresDateTime, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - final DateTime? archivedDateTime, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? ttlExpiresDateTime, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? archivedDateTime, final bool isArchived, required final PillSheetModifiedHistoryValue value, required final String? pillSheetID, @@ -666,8 +545,7 @@ abstract class _PillSheetModifiedHistory extends PillSheetModifiedHistory { required final PillSheet? after}) = _$PillSheetModifiedHistoryImpl; const _PillSheetModifiedHistory._() : super._(); - factory _PillSheetModifiedHistory.fromJson(Map json) = - _$PillSheetModifiedHistoryImpl.fromJson; + factory _PillSheetModifiedHistory.fromJson(Map json) = _$PillSheetModifiedHistoryImpl.fromJson; @override // Added since 2023-08-01 dynamic get version; @@ -677,14 +555,10 @@ abstract class _PillSheetModifiedHistory extends PillSheetModifiedHistory { @override String get actionType; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get estimatedEventCausingDate; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get createdAt; @override // ============ END: Added since v1 ============ // ============ BEGIN: Added since v2 ============ @@ -694,17 +568,13 @@ abstract class _PillSheetModifiedHistory extends PillSheetModifiedHistory { @override PillSheetGroup? get afterPillSheetGroup; @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get ttlExpiresDateTime; @override // TODO: [Archive-PillSheetModifiedHistory]: 2024-04以降に対応 // 古いPillSheetModifiedHistoryのisArchivedにインデックスが貼られないため、TTLの期間内のデータが残っている間はこのフィールドが使えない // null含めて値を入れないとクエリの条件に合致しないので、2024-04まではarchivedDateTime,isArchivedのデータが必ず存在するPillSheetModifiedHistoryの準備機関とする // バッチを書いても良いが件数が多いのでこの方法をとっている - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get archivedDateTime; @override // archivedDateTime isNull: false の条件だと、下記のエラーの条件に引っ掛かるため、archivedDateTime以外にもisArchivedを用意している。isArchived == true | isArchived == false の用途で使う // You can combine constraints with a logical AND by chaining multiple equality operators (== or array-contains). However, you must create a composite index to combine equality operators with the inequality operators, <, <=, >, and !=. @@ -733,6 +603,5 @@ abstract class _PillSheetModifiedHistory extends PillSheetModifiedHistory { PillSheet? get after; @override @JsonKey(ignore: true) - _$$PillSheetModifiedHistoryImplCopyWith<_$PillSheetModifiedHistoryImpl> - get copyWith => throw _privateConstructorUsedError; + _$$PillSheetModifiedHistoryImplCopyWith<_$PillSheetModifiedHistoryImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/entity/pill_sheet_modified_history.codegen.g.dart b/lib/entity/pill_sheet_modified_history.codegen.g.dart index 443bf531fd..f04984d7b5 100644 --- a/lib/entity/pill_sheet_modified_history.codegen.g.dart +++ b/lib/entity/pill_sheet_modified_history.codegen.g.dart @@ -6,45 +6,27 @@ part of 'pill_sheet_modified_history.codegen.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PillSheetModifiedHistoryImpl _$$PillSheetModifiedHistoryImplFromJson( - Map json) => - _$PillSheetModifiedHistoryImpl( +_$PillSheetModifiedHistoryImpl _$$PillSheetModifiedHistoryImplFromJson(Map json) => _$PillSheetModifiedHistoryImpl( version: json['version'] ?? "v1", id: json['id'] as String?, actionType: json['actionType'] as String, - estimatedEventCausingDate: NonNullTimestampConverter.timestampToDateTime( - json['estimatedEventCausingDate'] as Timestamp), - createdAt: NonNullTimestampConverter.timestampToDateTime( - json['createdAt'] as Timestamp), - beforePillSheetGroup: json['beforePillSheetGroup'] == null - ? null - : PillSheetGroup.fromJson( - json['beforePillSheetGroup'] as Map), - afterPillSheetGroup: json['afterPillSheetGroup'] == null - ? null - : PillSheetGroup.fromJson( - json['afterPillSheetGroup'] as Map), - ttlExpiresDateTime: TimestampConverter.timestampToDateTime( - json['ttlExpiresDateTime'] as Timestamp?), - archivedDateTime: TimestampConverter.timestampToDateTime( - json['archivedDateTime'] as Timestamp?), + estimatedEventCausingDate: NonNullTimestampConverter.timestampToDateTime(json['estimatedEventCausingDate'] as Timestamp), + createdAt: NonNullTimestampConverter.timestampToDateTime(json['createdAt'] as Timestamp), + beforePillSheetGroup: json['beforePillSheetGroup'] == null ? null : PillSheetGroup.fromJson(json['beforePillSheetGroup'] as Map), + afterPillSheetGroup: json['afterPillSheetGroup'] == null ? null : PillSheetGroup.fromJson(json['afterPillSheetGroup'] as Map), + ttlExpiresDateTime: TimestampConverter.timestampToDateTime(json['ttlExpiresDateTime'] as Timestamp?), + archivedDateTime: TimestampConverter.timestampToDateTime(json['archivedDateTime'] as Timestamp?), isArchived: json['isArchived'] as bool? ?? false, - value: PillSheetModifiedHistoryValue.fromJson( - json['value'] as Map), + value: PillSheetModifiedHistoryValue.fromJson(json['value'] as Map), pillSheetID: json['pillSheetID'] as String?, pillSheetGroupID: json['pillSheetGroupID'] as String?, beforePillSheetID: json['beforePillSheetID'] as String?, afterPillSheetID: json['afterPillSheetID'] as String?, - before: json['before'] == null - ? null - : PillSheet.fromJson(json['before'] as Map), - after: json['after'] == null - ? null - : PillSheet.fromJson(json['after'] as Map), + before: json['before'] == null ? null : PillSheet.fromJson(json['before'] as Map), + after: json['after'] == null ? null : PillSheet.fromJson(json['after'] as Map), ); -Map _$$PillSheetModifiedHistoryImplToJson( - _$PillSheetModifiedHistoryImpl instance) { +Map _$$PillSheetModifiedHistoryImplToJson(_$PillSheetModifiedHistoryImpl instance) { final val = { 'version': instance.version, }; @@ -57,17 +39,12 @@ Map _$$PillSheetModifiedHistoryImplToJson( writeNotNull('id', instance.id); val['actionType'] = instance.actionType; - val['estimatedEventCausingDate'] = - NonNullTimestampConverter.dateTimeToTimestamp( - instance.estimatedEventCausingDate); - val['createdAt'] = - NonNullTimestampConverter.dateTimeToTimestamp(instance.createdAt); + val['estimatedEventCausingDate'] = NonNullTimestampConverter.dateTimeToTimestamp(instance.estimatedEventCausingDate); + val['createdAt'] = NonNullTimestampConverter.dateTimeToTimestamp(instance.createdAt); val['beforePillSheetGroup'] = instance.beforePillSheetGroup?.toJson(); val['afterPillSheetGroup'] = instance.afterPillSheetGroup?.toJson(); - val['ttlExpiresDateTime'] = - TimestampConverter.dateTimeToTimestamp(instance.ttlExpiresDateTime); - val['archivedDateTime'] = - TimestampConverter.dateTimeToTimestamp(instance.archivedDateTime); + val['ttlExpiresDateTime'] = TimestampConverter.dateTimeToTimestamp(instance.ttlExpiresDateTime); + val['archivedDateTime'] = TimestampConverter.dateTimeToTimestamp(instance.archivedDateTime); val['isArchived'] = instance.isArchived; val['value'] = instance.value.toJson(); val['pillSheetID'] = instance.pillSheetID; diff --git a/lib/entity/pill_sheet_modified_history_value.codegen.dart b/lib/entity/pill_sheet_modified_history_value.codegen.dart index e7c4ecd538..4c07b3a8a3 100644 --- a/lib/entity/pill_sheet_modified_history_value.codegen.dart +++ b/lib/entity/pill_sheet_modified_history_value.codegen.dart @@ -13,8 +13,7 @@ class PillSheetModifiedHistoryValue with _$PillSheetModifiedHistoryValue { @JsonSerializable(explicitToJson: true) const factory PillSheetModifiedHistoryValue({ @Default(null) CreatedPillSheetValue? createdPillSheet, - @Default(null) - AutomaticallyRecordedLastTakenDateValue? automaticallyRecordedLastTakenDate, + @Default(null) AutomaticallyRecordedLastTakenDateValue? automaticallyRecordedLastTakenDate, @Default(null) DeletedPillSheetValue? deletedPillSheet, @Default(null) TakenPillValue? takenPill, @Default(null) RevertTakenPillValue? revertTakenPill, @@ -22,15 +21,13 @@ class PillSheetModifiedHistoryValue with _$PillSheetModifiedHistoryValue { @Default(null) EndedPillSheetValue? endedPillSheet, @Default(null) BeganRestDurationValue? beganRestDurationValue, @Default(null) EndedRestDurationValue? endedRestDurationValue, - @Default(null) - ChangedRestDurationBeginDateValue? changedRestDurationBeginDateValue, + @Default(null) ChangedRestDurationBeginDateValue? changedRestDurationBeginDateValue, @Default(null) ChangedRestDurationValue? changedRestDurationValue, @Default(null) ChangedBeginDisplayNumberValue? changedBeginDisplayNumber, @Default(null) ChangedEndDisplayNumberValue? changedEndDisplayNumber, }) = _PillSheetModifiedHistoryValue; - factory PillSheetModifiedHistoryValue.fromJson(Map json) => - _$PillSheetModifiedHistoryValueFromJson(json); + factory PillSheetModifiedHistoryValue.fromJson(Map json) => _$PillSheetModifiedHistoryValueFromJson(json); } @freezed @@ -48,13 +45,11 @@ class CreatedPillSheetValue with _$CreatedPillSheetValue { @Default([]) List pillSheetIDs, }) = _CreatedPillSheetValue; - factory CreatedPillSheetValue.fromJson(Map json) => - _$CreatedPillSheetValueFromJson(json); + factory CreatedPillSheetValue.fromJson(Map json) => _$CreatedPillSheetValueFromJson(json); } @freezed -class AutomaticallyRecordedLastTakenDateValue - with _$AutomaticallyRecordedLastTakenDateValue { +class AutomaticallyRecordedLastTakenDateValue with _$AutomaticallyRecordedLastTakenDateValue { const AutomaticallyRecordedLastTakenDateValue._(); @JsonSerializable(explicitToJson: true) const factory AutomaticallyRecordedLastTakenDateValue({ @@ -74,9 +69,7 @@ class AutomaticallyRecordedLastTakenDateValue required int afterLastTakenPillNumber, }) = _AutomaticallyRecordedLastTakenDateValue; - factory AutomaticallyRecordedLastTakenDateValue.fromJson( - Map json) => - _$AutomaticallyRecordedLastTakenDateValueFromJson(json); + factory AutomaticallyRecordedLastTakenDateValue.fromJson(Map json) => _$AutomaticallyRecordedLastTakenDateValueFromJson(json); } @freezed @@ -94,8 +87,7 @@ class DeletedPillSheetValue with _$DeletedPillSheetValue { @Default([]) List pillSheetIDs, }) = _DeletedPillSheetValue; - factory DeletedPillSheetValue.fromJson(Map json) => - _$DeletedPillSheetValueFromJson(json); + factory DeletedPillSheetValue.fromJson(Map json) => _$DeletedPillSheetValueFromJson(json); } @freezed @@ -125,8 +117,7 @@ class TakenPillValue with _$TakenPillValue { required int afterLastTakenPillNumber, }) = _TakenPillValue; - factory TakenPillValue.fromJson(Map json) => - _$TakenPillValueFromJson(json); + factory TakenPillValue.fromJson(Map json) => _$TakenPillValueFromJson(json); } @freezed @@ -155,8 +146,7 @@ class TakenPillEditedValue with _$TakenPillEditedValue { }) = _TakenPillEditedValue; const TakenPillEditedValue._(); - factory TakenPillEditedValue.fromJson(Map json) => - _$TakenPillEditedValueFromJson(json); + factory TakenPillEditedValue.fromJson(Map json) => _$TakenPillEditedValueFromJson(json); } @freezed @@ -180,8 +170,7 @@ class RevertTakenPillValue with _$RevertTakenPillValue { required int afterLastTakenPillNumber, }) = _RevertTakenPillValue; - factory RevertTakenPillValue.fromJson(Map json) => - _$RevertTakenPillValueFromJson(json); + factory RevertTakenPillValue.fromJson(Map json) => _$RevertTakenPillValueFromJson(json); } @freezed @@ -207,8 +196,7 @@ class ChangedPillNumberValue with _$ChangedPillNumberValue { @Default(1) int afterGroupIndex, }) = _ChangedPillNumberValue; - factory ChangedPillNumberValue.fromJson(Map json) => - _$ChangedPillNumberValueFromJson(json); + factory ChangedPillNumberValue.fromJson(Map json) => _$ChangedPillNumberValueFromJson(json); } @freezed @@ -230,8 +218,7 @@ class EndedPillSheetValue with _$EndedPillSheetValue { required DateTime lastTakenDate, }) = _EndedPillSheetValue; - factory EndedPillSheetValue.fromJson(Map json) => - _$EndedPillSheetValueFromJson(json); + factory EndedPillSheetValue.fromJson(Map json) => _$EndedPillSheetValueFromJson(json); } @freezed @@ -245,8 +232,7 @@ class BeganRestDurationValue with _$BeganRestDurationValue { // ============ END: Added since v1 ============ }) = _BeganRestDurationValue; - factory BeganRestDurationValue.fromJson(Map json) => - _$BeganRestDurationValueFromJson(json); + factory BeganRestDurationValue.fromJson(Map json) => _$BeganRestDurationValueFromJson(json); } @freezed @@ -260,14 +246,12 @@ class EndedRestDurationValue with _$EndedRestDurationValue { // ============ END: Added since v1 ============ }) = _EndedRestDurationValue; - factory EndedRestDurationValue.fromJson(Map json) => - _$EndedRestDurationValueFromJson(json); + factory EndedRestDurationValue.fromJson(Map json) => _$EndedRestDurationValueFromJson(json); } // ChangedRestDurationBeginDateValue は v2 からの構造体 @freezed -class ChangedRestDurationBeginDateValue - with _$ChangedRestDurationBeginDateValue { +class ChangedRestDurationBeginDateValue with _$ChangedRestDurationBeginDateValue { const ChangedRestDurationBeginDateValue._(); @JsonSerializable(explicitToJson: true) const factory ChangedRestDurationBeginDateValue({ @@ -275,9 +259,7 @@ class ChangedRestDurationBeginDateValue required RestDuration afterRestDuration, }) = _ChangedRestDurationBeginDateValue; - factory ChangedRestDurationBeginDateValue.fromJson( - Map json) => - _$ChangedRestDurationBeginDateValueFromJson(json); + factory ChangedRestDurationBeginDateValue.fromJson(Map json) => _$ChangedRestDurationBeginDateValueFromJson(json); } // ChangedRestDurationValue は v2 からの構造体 @@ -290,8 +272,7 @@ class ChangedRestDurationValue with _$ChangedRestDurationValue { required RestDuration afterRestDuration, }) = _ChangedRestDurationValue; - factory ChangedRestDurationValue.fromJson(Map json) => - _$ChangedRestDurationValueFromJson(json); + factory ChangedRestDurationValue.fromJson(Map json) => _$ChangedRestDurationValueFromJson(json); } @freezed @@ -306,8 +287,7 @@ class ChangedBeginDisplayNumberValue with _$ChangedBeginDisplayNumberValue { required PillSheetGroupDisplayNumberSetting afterDisplayNumberSetting, }) = _ChangedBeginDisplayNumberValue; - factory ChangedBeginDisplayNumberValue.fromJson(Map json) => - _$ChangedBeginDisplayNumberValueFromJson(json); + factory ChangedBeginDisplayNumberValue.fromJson(Map json) => _$ChangedBeginDisplayNumberValueFromJson(json); } @freezed @@ -322,6 +302,5 @@ class ChangedEndDisplayNumberValue with _$ChangedEndDisplayNumberValue { required PillSheetGroupDisplayNumberSetting afterDisplayNumberSetting, }) = _ChangedEndDisplayNumberValue; - factory ChangedEndDisplayNumberValue.fromJson(Map json) => - _$ChangedEndDisplayNumberValueFromJson(json); + factory ChangedEndDisplayNumberValue.fromJson(Map json) => _$ChangedEndDisplayNumberValueFromJson(json); } diff --git a/lib/entity/pill_sheet_modified_history_value.codegen.freezed.dart b/lib/entity/pill_sheet_modified_history_value.codegen.freezed.dart index 54ab12aa87..861c9ae5b6 100644 --- a/lib/entity/pill_sheet_modified_history_value.codegen.freezed.dart +++ b/lib/entity/pill_sheet_modified_history_value.codegen.freezed.dart @@ -14,57 +14,39 @@ T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); -PillSheetModifiedHistoryValue _$PillSheetModifiedHistoryValueFromJson( - Map json) { +PillSheetModifiedHistoryValue _$PillSheetModifiedHistoryValueFromJson(Map json) { return _PillSheetModifiedHistoryValue.fromJson(json); } /// @nodoc mixin _$PillSheetModifiedHistoryValue { - CreatedPillSheetValue? get createdPillSheet => - throw _privateConstructorUsedError; - AutomaticallyRecordedLastTakenDateValue? - get automaticallyRecordedLastTakenDate => - throw _privateConstructorUsedError; - DeletedPillSheetValue? get deletedPillSheet => - throw _privateConstructorUsedError; + CreatedPillSheetValue? get createdPillSheet => throw _privateConstructorUsedError; + AutomaticallyRecordedLastTakenDateValue? get automaticallyRecordedLastTakenDate => throw _privateConstructorUsedError; + DeletedPillSheetValue? get deletedPillSheet => throw _privateConstructorUsedError; TakenPillValue? get takenPill => throw _privateConstructorUsedError; - RevertTakenPillValue? get revertTakenPill => - throw _privateConstructorUsedError; - ChangedPillNumberValue? get changedPillNumber => - throw _privateConstructorUsedError; + RevertTakenPillValue? get revertTakenPill => throw _privateConstructorUsedError; + ChangedPillNumberValue? get changedPillNumber => throw _privateConstructorUsedError; EndedPillSheetValue? get endedPillSheet => throw _privateConstructorUsedError; - BeganRestDurationValue? get beganRestDurationValue => - throw _privateConstructorUsedError; - EndedRestDurationValue? get endedRestDurationValue => - throw _privateConstructorUsedError; - ChangedRestDurationBeginDateValue? get changedRestDurationBeginDateValue => - throw _privateConstructorUsedError; - ChangedRestDurationValue? get changedRestDurationValue => - throw _privateConstructorUsedError; - ChangedBeginDisplayNumberValue? get changedBeginDisplayNumber => - throw _privateConstructorUsedError; - ChangedEndDisplayNumberValue? get changedEndDisplayNumber => - throw _privateConstructorUsedError; + BeganRestDurationValue? get beganRestDurationValue => throw _privateConstructorUsedError; + EndedRestDurationValue? get endedRestDurationValue => throw _privateConstructorUsedError; + ChangedRestDurationBeginDateValue? get changedRestDurationBeginDateValue => throw _privateConstructorUsedError; + ChangedRestDurationValue? get changedRestDurationValue => throw _privateConstructorUsedError; + ChangedBeginDisplayNumberValue? get changedBeginDisplayNumber => throw _privateConstructorUsedError; + ChangedEndDisplayNumberValue? get changedEndDisplayNumber => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $PillSheetModifiedHistoryValueCopyWith - get copyWith => throw _privateConstructorUsedError; + $PillSheetModifiedHistoryValueCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $PillSheetModifiedHistoryValueCopyWith<$Res> { - factory $PillSheetModifiedHistoryValueCopyWith( - PillSheetModifiedHistoryValue value, - $Res Function(PillSheetModifiedHistoryValue) then) = - _$PillSheetModifiedHistoryValueCopyWithImpl<$Res, - PillSheetModifiedHistoryValue>; + factory $PillSheetModifiedHistoryValueCopyWith(PillSheetModifiedHistoryValue value, $Res Function(PillSheetModifiedHistoryValue) then) = + _$PillSheetModifiedHistoryValueCopyWithImpl<$Res, PillSheetModifiedHistoryValue>; @useResult $Res call( {CreatedPillSheetValue? createdPillSheet, - AutomaticallyRecordedLastTakenDateValue? - automaticallyRecordedLastTakenDate, + AutomaticallyRecordedLastTakenDateValue? automaticallyRecordedLastTakenDate, DeletedPillSheetValue? deletedPillSheet, TakenPillValue? takenPill, RevertTakenPillValue? revertTakenPill, @@ -78,8 +60,7 @@ abstract class $PillSheetModifiedHistoryValueCopyWith<$Res> { ChangedEndDisplayNumberValue? changedEndDisplayNumber}); $CreatedPillSheetValueCopyWith<$Res>? get createdPillSheet; - $AutomaticallyRecordedLastTakenDateValueCopyWith<$Res>? - get automaticallyRecordedLastTakenDate; + $AutomaticallyRecordedLastTakenDateValueCopyWith<$Res>? get automaticallyRecordedLastTakenDate; $DeletedPillSheetValueCopyWith<$Res>? get deletedPillSheet; $TakenPillValueCopyWith<$Res>? get takenPill; $RevertTakenPillValueCopyWith<$Res>? get revertTakenPill; @@ -87,17 +68,14 @@ abstract class $PillSheetModifiedHistoryValueCopyWith<$Res> { $EndedPillSheetValueCopyWith<$Res>? get endedPillSheet; $BeganRestDurationValueCopyWith<$Res>? get beganRestDurationValue; $EndedRestDurationValueCopyWith<$Res>? get endedRestDurationValue; - $ChangedRestDurationBeginDateValueCopyWith<$Res>? - get changedRestDurationBeginDateValue; + $ChangedRestDurationBeginDateValueCopyWith<$Res>? get changedRestDurationBeginDateValue; $ChangedRestDurationValueCopyWith<$Res>? get changedRestDurationValue; $ChangedBeginDisplayNumberValueCopyWith<$Res>? get changedBeginDisplayNumber; $ChangedEndDisplayNumberValueCopyWith<$Res>? get changedEndDisplayNumber; } /// @nodoc -class _$PillSheetModifiedHistoryValueCopyWithImpl<$Res, - $Val extends PillSheetModifiedHistoryValue> - implements $PillSheetModifiedHistoryValueCopyWith<$Res> { +class _$PillSheetModifiedHistoryValueCopyWithImpl<$Res, $Val extends PillSheetModifiedHistoryValue> implements $PillSheetModifiedHistoryValueCopyWith<$Res> { _$PillSheetModifiedHistoryValueCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -127,8 +105,7 @@ class _$PillSheetModifiedHistoryValueCopyWithImpl<$Res, ? _value.createdPillSheet : createdPillSheet // ignore: cast_nullable_to_non_nullable as CreatedPillSheetValue?, - automaticallyRecordedLastTakenDate: freezed == - automaticallyRecordedLastTakenDate + automaticallyRecordedLastTakenDate: freezed == automaticallyRecordedLastTakenDate ? _value.automaticallyRecordedLastTakenDate : automaticallyRecordedLastTakenDate // ignore: cast_nullable_to_non_nullable as AutomaticallyRecordedLastTakenDateValue?, @@ -160,8 +137,7 @@ class _$PillSheetModifiedHistoryValueCopyWithImpl<$Res, ? _value.endedRestDurationValue : endedRestDurationValue // ignore: cast_nullable_to_non_nullable as EndedRestDurationValue?, - changedRestDurationBeginDateValue: freezed == - changedRestDurationBeginDateValue + changedRestDurationBeginDateValue: freezed == changedRestDurationBeginDateValue ? _value.changedRestDurationBeginDateValue : changedRestDurationBeginDateValue // ignore: cast_nullable_to_non_nullable as ChangedRestDurationBeginDateValue?, @@ -187,24 +163,20 @@ class _$PillSheetModifiedHistoryValueCopyWithImpl<$Res, return null; } - return $CreatedPillSheetValueCopyWith<$Res>(_value.createdPillSheet!, - (value) { + return $CreatedPillSheetValueCopyWith<$Res>(_value.createdPillSheet!, (value) { return _then(_value.copyWith(createdPillSheet: value) as $Val); }); } @override @pragma('vm:prefer-inline') - $AutomaticallyRecordedLastTakenDateValueCopyWith<$Res>? - get automaticallyRecordedLastTakenDate { + $AutomaticallyRecordedLastTakenDateValueCopyWith<$Res>? get automaticallyRecordedLastTakenDate { if (_value.automaticallyRecordedLastTakenDate == null) { return null; } - return $AutomaticallyRecordedLastTakenDateValueCopyWith<$Res>( - _value.automaticallyRecordedLastTakenDate!, (value) { - return _then( - _value.copyWith(automaticallyRecordedLastTakenDate: value) as $Val); + return $AutomaticallyRecordedLastTakenDateValueCopyWith<$Res>(_value.automaticallyRecordedLastTakenDate!, (value) { + return _then(_value.copyWith(automaticallyRecordedLastTakenDate: value) as $Val); }); } @@ -215,8 +187,7 @@ class _$PillSheetModifiedHistoryValueCopyWithImpl<$Res, return null; } - return $DeletedPillSheetValueCopyWith<$Res>(_value.deletedPillSheet!, - (value) { + return $DeletedPillSheetValueCopyWith<$Res>(_value.deletedPillSheet!, (value) { return _then(_value.copyWith(deletedPillSheet: value) as $Val); }); } @@ -240,8 +211,7 @@ class _$PillSheetModifiedHistoryValueCopyWithImpl<$Res, return null; } - return $RevertTakenPillValueCopyWith<$Res>(_value.revertTakenPill!, - (value) { + return $RevertTakenPillValueCopyWith<$Res>(_value.revertTakenPill!, (value) { return _then(_value.copyWith(revertTakenPill: value) as $Val); }); } @@ -253,8 +223,7 @@ class _$PillSheetModifiedHistoryValueCopyWithImpl<$Res, return null; } - return $ChangedPillNumberValueCopyWith<$Res>(_value.changedPillNumber!, - (value) { + return $ChangedPillNumberValueCopyWith<$Res>(_value.changedPillNumber!, (value) { return _then(_value.copyWith(changedPillNumber: value) as $Val); }); } @@ -278,8 +247,7 @@ class _$PillSheetModifiedHistoryValueCopyWithImpl<$Res, return null; } - return $BeganRestDurationValueCopyWith<$Res>(_value.beganRestDurationValue!, - (value) { + return $BeganRestDurationValueCopyWith<$Res>(_value.beganRestDurationValue!, (value) { return _then(_value.copyWith(beganRestDurationValue: value) as $Val); }); } @@ -291,24 +259,20 @@ class _$PillSheetModifiedHistoryValueCopyWithImpl<$Res, return null; } - return $EndedRestDurationValueCopyWith<$Res>(_value.endedRestDurationValue!, - (value) { + return $EndedRestDurationValueCopyWith<$Res>(_value.endedRestDurationValue!, (value) { return _then(_value.copyWith(endedRestDurationValue: value) as $Val); }); } @override @pragma('vm:prefer-inline') - $ChangedRestDurationBeginDateValueCopyWith<$Res>? - get changedRestDurationBeginDateValue { + $ChangedRestDurationBeginDateValueCopyWith<$Res>? get changedRestDurationBeginDateValue { if (_value.changedRestDurationBeginDateValue == null) { return null; } - return $ChangedRestDurationBeginDateValueCopyWith<$Res>( - _value.changedRestDurationBeginDateValue!, (value) { - return _then( - _value.copyWith(changedRestDurationBeginDateValue: value) as $Val); + return $ChangedRestDurationBeginDateValueCopyWith<$Res>(_value.changedRestDurationBeginDateValue!, (value) { + return _then(_value.copyWith(changedRestDurationBeginDateValue: value) as $Val); }); } @@ -319,8 +283,7 @@ class _$PillSheetModifiedHistoryValueCopyWithImpl<$Res, return null; } - return $ChangedRestDurationValueCopyWith<$Res>( - _value.changedRestDurationValue!, (value) { + return $ChangedRestDurationValueCopyWith<$Res>(_value.changedRestDurationValue!, (value) { return _then(_value.copyWith(changedRestDurationValue: value) as $Val); }); } @@ -332,8 +295,7 @@ class _$PillSheetModifiedHistoryValueCopyWithImpl<$Res, return null; } - return $ChangedBeginDisplayNumberValueCopyWith<$Res>( - _value.changedBeginDisplayNumber!, (value) { + return $ChangedBeginDisplayNumberValueCopyWith<$Res>(_value.changedBeginDisplayNumber!, (value) { return _then(_value.copyWith(changedBeginDisplayNumber: value) as $Val); }); } @@ -345,26 +307,21 @@ class _$PillSheetModifiedHistoryValueCopyWithImpl<$Res, return null; } - return $ChangedEndDisplayNumberValueCopyWith<$Res>( - _value.changedEndDisplayNumber!, (value) { + return $ChangedEndDisplayNumberValueCopyWith<$Res>(_value.changedEndDisplayNumber!, (value) { return _then(_value.copyWith(changedEndDisplayNumber: value) as $Val); }); } } /// @nodoc -abstract class _$$PillSheetModifiedHistoryValueImplCopyWith<$Res> - implements $PillSheetModifiedHistoryValueCopyWith<$Res> { - factory _$$PillSheetModifiedHistoryValueImplCopyWith( - _$PillSheetModifiedHistoryValueImpl value, - $Res Function(_$PillSheetModifiedHistoryValueImpl) then) = +abstract class _$$PillSheetModifiedHistoryValueImplCopyWith<$Res> implements $PillSheetModifiedHistoryValueCopyWith<$Res> { + factory _$$PillSheetModifiedHistoryValueImplCopyWith(_$PillSheetModifiedHistoryValueImpl value, $Res Function(_$PillSheetModifiedHistoryValueImpl) then) = __$$PillSheetModifiedHistoryValueImplCopyWithImpl<$Res>; @override @useResult $Res call( {CreatedPillSheetValue? createdPillSheet, - AutomaticallyRecordedLastTakenDateValue? - automaticallyRecordedLastTakenDate, + AutomaticallyRecordedLastTakenDateValue? automaticallyRecordedLastTakenDate, DeletedPillSheetValue? deletedPillSheet, TakenPillValue? takenPill, RevertTakenPillValue? revertTakenPill, @@ -380,8 +337,7 @@ abstract class _$$PillSheetModifiedHistoryValueImplCopyWith<$Res> @override $CreatedPillSheetValueCopyWith<$Res>? get createdPillSheet; @override - $AutomaticallyRecordedLastTakenDateValueCopyWith<$Res>? - get automaticallyRecordedLastTakenDate; + $AutomaticallyRecordedLastTakenDateValueCopyWith<$Res>? get automaticallyRecordedLastTakenDate; @override $DeletedPillSheetValueCopyWith<$Res>? get deletedPillSheet; @override @@ -397,8 +353,7 @@ abstract class _$$PillSheetModifiedHistoryValueImplCopyWith<$Res> @override $EndedRestDurationValueCopyWith<$Res>? get endedRestDurationValue; @override - $ChangedRestDurationBeginDateValueCopyWith<$Res>? - get changedRestDurationBeginDateValue; + $ChangedRestDurationBeginDateValueCopyWith<$Res>? get changedRestDurationBeginDateValue; @override $ChangedRestDurationValueCopyWith<$Res>? get changedRestDurationValue; @override @@ -408,14 +363,9 @@ abstract class _$$PillSheetModifiedHistoryValueImplCopyWith<$Res> } /// @nodoc -class __$$PillSheetModifiedHistoryValueImplCopyWithImpl<$Res> - extends _$PillSheetModifiedHistoryValueCopyWithImpl<$Res, - _$PillSheetModifiedHistoryValueImpl> +class __$$PillSheetModifiedHistoryValueImplCopyWithImpl<$Res> extends _$PillSheetModifiedHistoryValueCopyWithImpl<$Res, _$PillSheetModifiedHistoryValueImpl> implements _$$PillSheetModifiedHistoryValueImplCopyWith<$Res> { - __$$PillSheetModifiedHistoryValueImplCopyWithImpl( - _$PillSheetModifiedHistoryValueImpl _value, - $Res Function(_$PillSheetModifiedHistoryValueImpl) _then) - : super(_value, _then); + __$$PillSheetModifiedHistoryValueImplCopyWithImpl(_$PillSheetModifiedHistoryValueImpl _value, $Res Function(_$PillSheetModifiedHistoryValueImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -439,8 +389,7 @@ class __$$PillSheetModifiedHistoryValueImplCopyWithImpl<$Res> ? _value.createdPillSheet : createdPillSheet // ignore: cast_nullable_to_non_nullable as CreatedPillSheetValue?, - automaticallyRecordedLastTakenDate: freezed == - automaticallyRecordedLastTakenDate + automaticallyRecordedLastTakenDate: freezed == automaticallyRecordedLastTakenDate ? _value.automaticallyRecordedLastTakenDate : automaticallyRecordedLastTakenDate // ignore: cast_nullable_to_non_nullable as AutomaticallyRecordedLastTakenDateValue?, @@ -472,8 +421,7 @@ class __$$PillSheetModifiedHistoryValueImplCopyWithImpl<$Res> ? _value.endedRestDurationValue : endedRestDurationValue // ignore: cast_nullable_to_non_nullable as EndedRestDurationValue?, - changedRestDurationBeginDateValue: freezed == - changedRestDurationBeginDateValue + changedRestDurationBeginDateValue: freezed == changedRestDurationBeginDateValue ? _value.changedRestDurationBeginDateValue : changedRestDurationBeginDateValue // ignore: cast_nullable_to_non_nullable as ChangedRestDurationBeginDateValue?, @@ -496,8 +444,7 @@ class __$$PillSheetModifiedHistoryValueImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PillSheetModifiedHistoryValueImpl - extends _PillSheetModifiedHistoryValue { +class _$PillSheetModifiedHistoryValueImpl extends _PillSheetModifiedHistoryValue { const _$PillSheetModifiedHistoryValueImpl( {this.createdPillSheet = null, this.automaticallyRecordedLastTakenDate = null, @@ -514,17 +461,14 @@ class _$PillSheetModifiedHistoryValueImpl this.changedEndDisplayNumber = null}) : super._(); - factory _$PillSheetModifiedHistoryValueImpl.fromJson( - Map json) => - _$$PillSheetModifiedHistoryValueImplFromJson(json); + factory _$PillSheetModifiedHistoryValueImpl.fromJson(Map json) => _$$PillSheetModifiedHistoryValueImplFromJson(json); @override @JsonKey() final CreatedPillSheetValue? createdPillSheet; @override @JsonKey() - final AutomaticallyRecordedLastTakenDateValue? - automaticallyRecordedLastTakenDate; + final AutomaticallyRecordedLastTakenDateValue? automaticallyRecordedLastTakenDate; @override @JsonKey() final DeletedPillSheetValue? deletedPillSheet; @@ -569,66 +513,31 @@ class _$PillSheetModifiedHistoryValueImpl return identical(this, other) || (other.runtimeType == runtimeType && other is _$PillSheetModifiedHistoryValueImpl && - (identical(other.createdPillSheet, createdPillSheet) || - other.createdPillSheet == createdPillSheet) && - (identical(other.automaticallyRecordedLastTakenDate, - automaticallyRecordedLastTakenDate) || - other.automaticallyRecordedLastTakenDate == - automaticallyRecordedLastTakenDate) && - (identical(other.deletedPillSheet, deletedPillSheet) || - other.deletedPillSheet == deletedPillSheet) && - (identical(other.takenPill, takenPill) || - other.takenPill == takenPill) && - (identical(other.revertTakenPill, revertTakenPill) || - other.revertTakenPill == revertTakenPill) && - (identical(other.changedPillNumber, changedPillNumber) || - other.changedPillNumber == changedPillNumber) && - (identical(other.endedPillSheet, endedPillSheet) || - other.endedPillSheet == endedPillSheet) && - (identical(other.beganRestDurationValue, beganRestDurationValue) || - other.beganRestDurationValue == beganRestDurationValue) && - (identical(other.endedRestDurationValue, endedRestDurationValue) || - other.endedRestDurationValue == endedRestDurationValue) && - (identical(other.changedRestDurationBeginDateValue, - changedRestDurationBeginDateValue) || - other.changedRestDurationBeginDateValue == - changedRestDurationBeginDateValue) && - (identical( - other.changedRestDurationValue, changedRestDurationValue) || - other.changedRestDurationValue == changedRestDurationValue) && - (identical(other.changedBeginDisplayNumber, - changedBeginDisplayNumber) || - other.changedBeginDisplayNumber == changedBeginDisplayNumber) && - (identical( - other.changedEndDisplayNumber, changedEndDisplayNumber) || - other.changedEndDisplayNumber == changedEndDisplayNumber)); + (identical(other.createdPillSheet, createdPillSheet) || other.createdPillSheet == createdPillSheet) && + (identical(other.automaticallyRecordedLastTakenDate, automaticallyRecordedLastTakenDate) || other.automaticallyRecordedLastTakenDate == automaticallyRecordedLastTakenDate) && + (identical(other.deletedPillSheet, deletedPillSheet) || other.deletedPillSheet == deletedPillSheet) && + (identical(other.takenPill, takenPill) || other.takenPill == takenPill) && + (identical(other.revertTakenPill, revertTakenPill) || other.revertTakenPill == revertTakenPill) && + (identical(other.changedPillNumber, changedPillNumber) || other.changedPillNumber == changedPillNumber) && + (identical(other.endedPillSheet, endedPillSheet) || other.endedPillSheet == endedPillSheet) && + (identical(other.beganRestDurationValue, beganRestDurationValue) || other.beganRestDurationValue == beganRestDurationValue) && + (identical(other.endedRestDurationValue, endedRestDurationValue) || other.endedRestDurationValue == endedRestDurationValue) && + (identical(other.changedRestDurationBeginDateValue, changedRestDurationBeginDateValue) || other.changedRestDurationBeginDateValue == changedRestDurationBeginDateValue) && + (identical(other.changedRestDurationValue, changedRestDurationValue) || other.changedRestDurationValue == changedRestDurationValue) && + (identical(other.changedBeginDisplayNumber, changedBeginDisplayNumber) || other.changedBeginDisplayNumber == changedBeginDisplayNumber) && + (identical(other.changedEndDisplayNumber, changedEndDisplayNumber) || other.changedEndDisplayNumber == changedEndDisplayNumber)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, - createdPillSheet, - automaticallyRecordedLastTakenDate, - deletedPillSheet, - takenPill, - revertTakenPill, - changedPillNumber, - endedPillSheet, - beganRestDurationValue, - endedRestDurationValue, - changedRestDurationBeginDateValue, - changedRestDurationValue, - changedBeginDisplayNumber, - changedEndDisplayNumber); + int get hashCode => Object.hash(runtimeType, createdPillSheet, automaticallyRecordedLastTakenDate, deletedPillSheet, takenPill, revertTakenPill, changedPillNumber, endedPillSheet, + beganRestDurationValue, endedRestDurationValue, changedRestDurationBeginDateValue, changedRestDurationValue, changedBeginDisplayNumber, changedEndDisplayNumber); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PillSheetModifiedHistoryValueImplCopyWith< - _$PillSheetModifiedHistoryValueImpl> - get copyWith => __$$PillSheetModifiedHistoryValueImplCopyWithImpl< - _$PillSheetModifiedHistoryValueImpl>(this, _$identity); + _$$PillSheetModifiedHistoryValueImplCopyWith<_$PillSheetModifiedHistoryValueImpl> get copyWith => + __$$PillSheetModifiedHistoryValueImplCopyWithImpl<_$PillSheetModifiedHistoryValueImpl>(this, _$identity); @override Map toJson() { @@ -638,35 +547,29 @@ class _$PillSheetModifiedHistoryValueImpl } } -abstract class _PillSheetModifiedHistoryValue - extends PillSheetModifiedHistoryValue { +abstract class _PillSheetModifiedHistoryValue extends PillSheetModifiedHistoryValue { const factory _PillSheetModifiedHistoryValue( - {final CreatedPillSheetValue? createdPillSheet, - final AutomaticallyRecordedLastTakenDateValue? - automaticallyRecordedLastTakenDate, - final DeletedPillSheetValue? deletedPillSheet, - final TakenPillValue? takenPill, - final RevertTakenPillValue? revertTakenPill, - final ChangedPillNumberValue? changedPillNumber, - final EndedPillSheetValue? endedPillSheet, - final BeganRestDurationValue? beganRestDurationValue, - final EndedRestDurationValue? endedRestDurationValue, - final ChangedRestDurationBeginDateValue? - changedRestDurationBeginDateValue, - final ChangedRestDurationValue? changedRestDurationValue, - final ChangedBeginDisplayNumberValue? changedBeginDisplayNumber, - final ChangedEndDisplayNumberValue? changedEndDisplayNumber}) = - _$PillSheetModifiedHistoryValueImpl; + {final CreatedPillSheetValue? createdPillSheet, + final AutomaticallyRecordedLastTakenDateValue? automaticallyRecordedLastTakenDate, + final DeletedPillSheetValue? deletedPillSheet, + final TakenPillValue? takenPill, + final RevertTakenPillValue? revertTakenPill, + final ChangedPillNumberValue? changedPillNumber, + final EndedPillSheetValue? endedPillSheet, + final BeganRestDurationValue? beganRestDurationValue, + final EndedRestDurationValue? endedRestDurationValue, + final ChangedRestDurationBeginDateValue? changedRestDurationBeginDateValue, + final ChangedRestDurationValue? changedRestDurationValue, + final ChangedBeginDisplayNumberValue? changedBeginDisplayNumber, + final ChangedEndDisplayNumberValue? changedEndDisplayNumber}) = _$PillSheetModifiedHistoryValueImpl; const _PillSheetModifiedHistoryValue._() : super._(); - factory _PillSheetModifiedHistoryValue.fromJson(Map json) = - _$PillSheetModifiedHistoryValueImpl.fromJson; + factory _PillSheetModifiedHistoryValue.fromJson(Map json) = _$PillSheetModifiedHistoryValueImpl.fromJson; @override CreatedPillSheetValue? get createdPillSheet; @override - AutomaticallyRecordedLastTakenDateValue? - get automaticallyRecordedLastTakenDate; + AutomaticallyRecordedLastTakenDateValue? get automaticallyRecordedLastTakenDate; @override DeletedPillSheetValue? get deletedPillSheet; @override @@ -691,13 +594,10 @@ abstract class _PillSheetModifiedHistoryValue ChangedEndDisplayNumberValue? get changedEndDisplayNumber; @override @JsonKey(ignore: true) - _$$PillSheetModifiedHistoryValueImplCopyWith< - _$PillSheetModifiedHistoryValueImpl> - get copyWith => throw _privateConstructorUsedError; + _$$PillSheetModifiedHistoryValueImplCopyWith<_$PillSheetModifiedHistoryValueImpl> get copyWith => throw _privateConstructorUsedError; } -CreatedPillSheetValue _$CreatedPillSheetValueFromJson( - Map json) { +CreatedPillSheetValue _$CreatedPillSheetValueFromJson(Map json) { return _CreatedPillSheetValue.fromJson(json); } @@ -705,36 +605,24 @@ CreatedPillSheetValue _$CreatedPillSheetValueFromJson( mixin _$CreatedPillSheetValue { // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get pillSheetCreatedAt => throw _privateConstructorUsedError; List get pillSheetIDs => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $CreatedPillSheetValueCopyWith get copyWith => - throw _privateConstructorUsedError; + $CreatedPillSheetValueCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $CreatedPillSheetValueCopyWith<$Res> { - factory $CreatedPillSheetValueCopyWith(CreatedPillSheetValue value, - $Res Function(CreatedPillSheetValue) then) = - _$CreatedPillSheetValueCopyWithImpl<$Res, CreatedPillSheetValue>; + factory $CreatedPillSheetValueCopyWith(CreatedPillSheetValue value, $Res Function(CreatedPillSheetValue) then) = _$CreatedPillSheetValueCopyWithImpl<$Res, CreatedPillSheetValue>; @useResult - $Res call( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime pillSheetCreatedAt, - List pillSheetIDs}); + $Res call({@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime pillSheetCreatedAt, List pillSheetIDs}); } /// @nodoc -class _$CreatedPillSheetValueCopyWithImpl<$Res, - $Val extends CreatedPillSheetValue> - implements $CreatedPillSheetValueCopyWith<$Res> { +class _$CreatedPillSheetValueCopyWithImpl<$Res, $Val extends CreatedPillSheetValue> implements $CreatedPillSheetValueCopyWith<$Res> { _$CreatedPillSheetValueCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -762,30 +650,16 @@ class _$CreatedPillSheetValueCopyWithImpl<$Res, } /// @nodoc -abstract class _$$CreatedPillSheetValueImplCopyWith<$Res> - implements $CreatedPillSheetValueCopyWith<$Res> { - factory _$$CreatedPillSheetValueImplCopyWith( - _$CreatedPillSheetValueImpl value, - $Res Function(_$CreatedPillSheetValueImpl) then) = - __$$CreatedPillSheetValueImplCopyWithImpl<$Res>; +abstract class _$$CreatedPillSheetValueImplCopyWith<$Res> implements $CreatedPillSheetValueCopyWith<$Res> { + factory _$$CreatedPillSheetValueImplCopyWith(_$CreatedPillSheetValueImpl value, $Res Function(_$CreatedPillSheetValueImpl) then) = __$$CreatedPillSheetValueImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime pillSheetCreatedAt, - List pillSheetIDs}); + $Res call({@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime pillSheetCreatedAt, List pillSheetIDs}); } /// @nodoc -class __$$CreatedPillSheetValueImplCopyWithImpl<$Res> - extends _$CreatedPillSheetValueCopyWithImpl<$Res, - _$CreatedPillSheetValueImpl> - implements _$$CreatedPillSheetValueImplCopyWith<$Res> { - __$$CreatedPillSheetValueImplCopyWithImpl(_$CreatedPillSheetValueImpl _value, - $Res Function(_$CreatedPillSheetValueImpl) _then) - : super(_value, _then); +class __$$CreatedPillSheetValueImplCopyWithImpl<$Res> extends _$CreatedPillSheetValueCopyWithImpl<$Res, _$CreatedPillSheetValueImpl> implements _$$CreatedPillSheetValueImplCopyWith<$Res> { + __$$CreatedPillSheetValueImplCopyWithImpl(_$CreatedPillSheetValueImpl _value, $Res Function(_$CreatedPillSheetValueImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -811,23 +685,17 @@ class __$$CreatedPillSheetValueImplCopyWithImpl<$Res> @JsonSerializable(explicitToJson: true) class _$CreatedPillSheetValueImpl extends _CreatedPillSheetValue { const _$CreatedPillSheetValueImpl( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.pillSheetCreatedAt, + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.pillSheetCreatedAt, final List pillSheetIDs = const []}) : _pillSheetIDs = pillSheetIDs, super._(); - factory _$CreatedPillSheetValueImpl.fromJson(Map json) => - _$$CreatedPillSheetValueImplFromJson(json); + factory _$CreatedPillSheetValueImpl.fromJson(Map json) => _$$CreatedPillSheetValueImplFromJson(json); // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime pillSheetCreatedAt; final List _pillSheetIDs; @override @@ -848,23 +716,18 @@ class _$CreatedPillSheetValueImpl extends _CreatedPillSheetValue { return identical(this, other) || (other.runtimeType == runtimeType && other is _$CreatedPillSheetValueImpl && - (identical(other.pillSheetCreatedAt, pillSheetCreatedAt) || - other.pillSheetCreatedAt == pillSheetCreatedAt) && - const DeepCollectionEquality() - .equals(other._pillSheetIDs, _pillSheetIDs)); + (identical(other.pillSheetCreatedAt, pillSheetCreatedAt) || other.pillSheetCreatedAt == pillSheetCreatedAt) && + const DeepCollectionEquality().equals(other._pillSheetIDs, _pillSheetIDs)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, pillSheetCreatedAt, - const DeepCollectionEquality().hash(_pillSheetIDs)); + int get hashCode => Object.hash(runtimeType, pillSheetCreatedAt, const DeepCollectionEquality().hash(_pillSheetIDs)); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$CreatedPillSheetValueImplCopyWith<_$CreatedPillSheetValueImpl> - get copyWith => __$$CreatedPillSheetValueImplCopyWithImpl< - _$CreatedPillSheetValueImpl>(this, _$identity); + _$$CreatedPillSheetValueImplCopyWith<_$CreatedPillSheetValueImpl> get copyWith => __$$CreatedPillSheetValueImplCopyWithImpl<_$CreatedPillSheetValueImpl>(this, _$identity); @override Map toJson() { @@ -876,33 +739,24 @@ class _$CreatedPillSheetValueImpl extends _CreatedPillSheetValue { abstract class _CreatedPillSheetValue extends CreatedPillSheetValue { const factory _CreatedPillSheetValue( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime pillSheetCreatedAt, + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime pillSheetCreatedAt, final List pillSheetIDs}) = _$CreatedPillSheetValueImpl; const _CreatedPillSheetValue._() : super._(); - factory _CreatedPillSheetValue.fromJson(Map json) = - _$CreatedPillSheetValueImpl.fromJson; + factory _CreatedPillSheetValue.fromJson(Map json) = _$CreatedPillSheetValueImpl.fromJson; @override // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get pillSheetCreatedAt; @override List get pillSheetIDs; @override @JsonKey(ignore: true) - _$$CreatedPillSheetValueImplCopyWith<_$CreatedPillSheetValueImpl> - get copyWith => throw _privateConstructorUsedError; + _$$CreatedPillSheetValueImplCopyWith<_$CreatedPillSheetValueImpl> get copyWith => throw _privateConstructorUsedError; } -AutomaticallyRecordedLastTakenDateValue - _$AutomaticallyRecordedLastTakenDateValueFromJson( - Map json) { +AutomaticallyRecordedLastTakenDateValue _$AutomaticallyRecordedLastTakenDateValueFromJson(Map json) { return _AutomaticallyRecordedLastTakenDateValue.fromJson(json); } @@ -910,51 +764,33 @@ AutomaticallyRecordedLastTakenDateValue mixin _$AutomaticallyRecordedLastTakenDateValue { // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get beforeLastTakenDate => throw _privateConstructorUsedError; - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get afterLastTakenDate => throw _privateConstructorUsedError; int get beforeLastTakenPillNumber => throw _privateConstructorUsedError; int get afterLastTakenPillNumber => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $AutomaticallyRecordedLastTakenDateValueCopyWith< - AutomaticallyRecordedLastTakenDateValue> - get copyWith => throw _privateConstructorUsedError; + $AutomaticallyRecordedLastTakenDateValueCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $AutomaticallyRecordedLastTakenDateValueCopyWith<$Res> { - factory $AutomaticallyRecordedLastTakenDateValueCopyWith( - AutomaticallyRecordedLastTakenDateValue value, - $Res Function(AutomaticallyRecordedLastTakenDateValue) then) = - _$AutomaticallyRecordedLastTakenDateValueCopyWithImpl<$Res, - AutomaticallyRecordedLastTakenDateValue>; + factory $AutomaticallyRecordedLastTakenDateValueCopyWith(AutomaticallyRecordedLastTakenDateValue value, $Res Function(AutomaticallyRecordedLastTakenDateValue) then) = + _$AutomaticallyRecordedLastTakenDateValueCopyWithImpl<$Res, AutomaticallyRecordedLastTakenDateValue>; @useResult $Res call( - {@JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? beforeLastTakenDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime afterLastTakenDate, + {@JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? beforeLastTakenDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime afterLastTakenDate, int beforeLastTakenPillNumber, int afterLastTakenPillNumber}); } /// @nodoc -class _$AutomaticallyRecordedLastTakenDateValueCopyWithImpl<$Res, - $Val extends AutomaticallyRecordedLastTakenDateValue> - implements $AutomaticallyRecordedLastTakenDateValueCopyWith<$Res> { - _$AutomaticallyRecordedLastTakenDateValueCopyWithImpl( - this._value, this._then); +class _$AutomaticallyRecordedLastTakenDateValueCopyWithImpl<$Res, $Val extends AutomaticallyRecordedLastTakenDateValue> implements $AutomaticallyRecordedLastTakenDateValueCopyWith<$Res> { + _$AutomaticallyRecordedLastTakenDateValueCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -991,35 +827,22 @@ class _$AutomaticallyRecordedLastTakenDateValueCopyWithImpl<$Res, } /// @nodoc -abstract class _$$AutomaticallyRecordedLastTakenDateValueImplCopyWith<$Res> - implements $AutomaticallyRecordedLastTakenDateValueCopyWith<$Res> { - factory _$$AutomaticallyRecordedLastTakenDateValueImplCopyWith( - _$AutomaticallyRecordedLastTakenDateValueImpl value, - $Res Function(_$AutomaticallyRecordedLastTakenDateValueImpl) then) = +abstract class _$$AutomaticallyRecordedLastTakenDateValueImplCopyWith<$Res> implements $AutomaticallyRecordedLastTakenDateValueCopyWith<$Res> { + factory _$$AutomaticallyRecordedLastTakenDateValueImplCopyWith(_$AutomaticallyRecordedLastTakenDateValueImpl value, $Res Function(_$AutomaticallyRecordedLastTakenDateValueImpl) then) = __$$AutomaticallyRecordedLastTakenDateValueImplCopyWithImpl<$Res>; @override @useResult $Res call( - {@JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? beforeLastTakenDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime afterLastTakenDate, + {@JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? beforeLastTakenDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime afterLastTakenDate, int beforeLastTakenPillNumber, int afterLastTakenPillNumber}); } /// @nodoc -class __$$AutomaticallyRecordedLastTakenDateValueImplCopyWithImpl<$Res> - extends _$AutomaticallyRecordedLastTakenDateValueCopyWithImpl<$Res, - _$AutomaticallyRecordedLastTakenDateValueImpl> +class __$$AutomaticallyRecordedLastTakenDateValueImplCopyWithImpl<$Res> extends _$AutomaticallyRecordedLastTakenDateValueCopyWithImpl<$Res, _$AutomaticallyRecordedLastTakenDateValueImpl> implements _$$AutomaticallyRecordedLastTakenDateValueImplCopyWith<$Res> { - __$$AutomaticallyRecordedLastTakenDateValueImplCopyWithImpl( - _$AutomaticallyRecordedLastTakenDateValueImpl _value, - $Res Function(_$AutomaticallyRecordedLastTakenDateValueImpl) _then) + __$$AutomaticallyRecordedLastTakenDateValueImplCopyWithImpl(_$AutomaticallyRecordedLastTakenDateValueImpl _value, $Res Function(_$AutomaticallyRecordedLastTakenDateValueImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1054,36 +877,23 @@ class __$$AutomaticallyRecordedLastTakenDateValueImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable(explicitToJson: true) -class _$AutomaticallyRecordedLastTakenDateValueImpl - extends _AutomaticallyRecordedLastTakenDateValue { +class _$AutomaticallyRecordedLastTakenDateValueImpl extends _AutomaticallyRecordedLastTakenDateValue { const _$AutomaticallyRecordedLastTakenDateValueImpl( - {@JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - this.beforeLastTakenDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.afterLastTakenDate, + {@JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) this.beforeLastTakenDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.afterLastTakenDate, required this.beforeLastTakenPillNumber, required this.afterLastTakenPillNumber}) : super._(); - factory _$AutomaticallyRecordedLastTakenDateValueImpl.fromJson( - Map json) => - _$$AutomaticallyRecordedLastTakenDateValueImplFromJson(json); + factory _$AutomaticallyRecordedLastTakenDateValueImpl.fromJson(Map json) => _$$AutomaticallyRecordedLastTakenDateValueImplFromJson(json); // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? beforeLastTakenDate; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime afterLastTakenDate; @override final int beforeLastTakenPillNumber; @@ -1100,31 +910,21 @@ class _$AutomaticallyRecordedLastTakenDateValueImpl return identical(this, other) || (other.runtimeType == runtimeType && other is _$AutomaticallyRecordedLastTakenDateValueImpl && - (identical(other.beforeLastTakenDate, beforeLastTakenDate) || - other.beforeLastTakenDate == beforeLastTakenDate) && - (identical(other.afterLastTakenDate, afterLastTakenDate) || - other.afterLastTakenDate == afterLastTakenDate) && - (identical(other.beforeLastTakenPillNumber, - beforeLastTakenPillNumber) || - other.beforeLastTakenPillNumber == beforeLastTakenPillNumber) && - (identical( - other.afterLastTakenPillNumber, afterLastTakenPillNumber) || - other.afterLastTakenPillNumber == afterLastTakenPillNumber)); + (identical(other.beforeLastTakenDate, beforeLastTakenDate) || other.beforeLastTakenDate == beforeLastTakenDate) && + (identical(other.afterLastTakenDate, afterLastTakenDate) || other.afterLastTakenDate == afterLastTakenDate) && + (identical(other.beforeLastTakenPillNumber, beforeLastTakenPillNumber) || other.beforeLastTakenPillNumber == beforeLastTakenPillNumber) && + (identical(other.afterLastTakenPillNumber, afterLastTakenPillNumber) || other.afterLastTakenPillNumber == afterLastTakenPillNumber)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, beforeLastTakenDate, - afterLastTakenDate, beforeLastTakenPillNumber, afterLastTakenPillNumber); + int get hashCode => Object.hash(runtimeType, beforeLastTakenDate, afterLastTakenDate, beforeLastTakenPillNumber, afterLastTakenPillNumber); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$AutomaticallyRecordedLastTakenDateValueImplCopyWith< - _$AutomaticallyRecordedLastTakenDateValueImpl> - get copyWith => - __$$AutomaticallyRecordedLastTakenDateValueImplCopyWithImpl< - _$AutomaticallyRecordedLastTakenDateValueImpl>(this, _$identity); + _$$AutomaticallyRecordedLastTakenDateValueImplCopyWith<_$AutomaticallyRecordedLastTakenDateValueImpl> get copyWith => + __$$AutomaticallyRecordedLastTakenDateValueImplCopyWithImpl<_$AutomaticallyRecordedLastTakenDateValueImpl>(this, _$identity); @override Map toJson() { @@ -1134,36 +934,22 @@ class _$AutomaticallyRecordedLastTakenDateValueImpl } } -abstract class _AutomaticallyRecordedLastTakenDateValue - extends AutomaticallyRecordedLastTakenDateValue { +abstract class _AutomaticallyRecordedLastTakenDateValue extends AutomaticallyRecordedLastTakenDateValue { const factory _AutomaticallyRecordedLastTakenDateValue( - {@JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - final DateTime? beforeLastTakenDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime afterLastTakenDate, - required final int beforeLastTakenPillNumber, - required final int afterLastTakenPillNumber}) = - _$AutomaticallyRecordedLastTakenDateValueImpl; + {@JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? beforeLastTakenDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime afterLastTakenDate, + required final int beforeLastTakenPillNumber, + required final int afterLastTakenPillNumber}) = _$AutomaticallyRecordedLastTakenDateValueImpl; const _AutomaticallyRecordedLastTakenDateValue._() : super._(); - factory _AutomaticallyRecordedLastTakenDateValue.fromJson( - Map json) = - _$AutomaticallyRecordedLastTakenDateValueImpl.fromJson; + factory _AutomaticallyRecordedLastTakenDateValue.fromJson(Map json) = _$AutomaticallyRecordedLastTakenDateValueImpl.fromJson; @override // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get beforeLastTakenDate; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get afterLastTakenDate; @override int get beforeLastTakenPillNumber; @@ -1171,13 +957,10 @@ abstract class _AutomaticallyRecordedLastTakenDateValue int get afterLastTakenPillNumber; @override @JsonKey(ignore: true) - _$$AutomaticallyRecordedLastTakenDateValueImplCopyWith< - _$AutomaticallyRecordedLastTakenDateValueImpl> - get copyWith => throw _privateConstructorUsedError; + _$$AutomaticallyRecordedLastTakenDateValueImplCopyWith<_$AutomaticallyRecordedLastTakenDateValueImpl> get copyWith => throw _privateConstructorUsedError; } -DeletedPillSheetValue _$DeletedPillSheetValueFromJson( - Map json) { +DeletedPillSheetValue _$DeletedPillSheetValueFromJson(Map json) { return _DeletedPillSheetValue.fromJson(json); } @@ -1185,36 +968,24 @@ DeletedPillSheetValue _$DeletedPillSheetValueFromJson( mixin _$DeletedPillSheetValue { // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get pillSheetDeletedAt => throw _privateConstructorUsedError; List get pillSheetIDs => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $DeletedPillSheetValueCopyWith get copyWith => - throw _privateConstructorUsedError; + $DeletedPillSheetValueCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $DeletedPillSheetValueCopyWith<$Res> { - factory $DeletedPillSheetValueCopyWith(DeletedPillSheetValue value, - $Res Function(DeletedPillSheetValue) then) = - _$DeletedPillSheetValueCopyWithImpl<$Res, DeletedPillSheetValue>; + factory $DeletedPillSheetValueCopyWith(DeletedPillSheetValue value, $Res Function(DeletedPillSheetValue) then) = _$DeletedPillSheetValueCopyWithImpl<$Res, DeletedPillSheetValue>; @useResult - $Res call( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime pillSheetDeletedAt, - List pillSheetIDs}); + $Res call({@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime pillSheetDeletedAt, List pillSheetIDs}); } /// @nodoc -class _$DeletedPillSheetValueCopyWithImpl<$Res, - $Val extends DeletedPillSheetValue> - implements $DeletedPillSheetValueCopyWith<$Res> { +class _$DeletedPillSheetValueCopyWithImpl<$Res, $Val extends DeletedPillSheetValue> implements $DeletedPillSheetValueCopyWith<$Res> { _$DeletedPillSheetValueCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -1242,30 +1013,16 @@ class _$DeletedPillSheetValueCopyWithImpl<$Res, } /// @nodoc -abstract class _$$DeletedPillSheetValueImplCopyWith<$Res> - implements $DeletedPillSheetValueCopyWith<$Res> { - factory _$$DeletedPillSheetValueImplCopyWith( - _$DeletedPillSheetValueImpl value, - $Res Function(_$DeletedPillSheetValueImpl) then) = - __$$DeletedPillSheetValueImplCopyWithImpl<$Res>; +abstract class _$$DeletedPillSheetValueImplCopyWith<$Res> implements $DeletedPillSheetValueCopyWith<$Res> { + factory _$$DeletedPillSheetValueImplCopyWith(_$DeletedPillSheetValueImpl value, $Res Function(_$DeletedPillSheetValueImpl) then) = __$$DeletedPillSheetValueImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime pillSheetDeletedAt, - List pillSheetIDs}); + $Res call({@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime pillSheetDeletedAt, List pillSheetIDs}); } /// @nodoc -class __$$DeletedPillSheetValueImplCopyWithImpl<$Res> - extends _$DeletedPillSheetValueCopyWithImpl<$Res, - _$DeletedPillSheetValueImpl> - implements _$$DeletedPillSheetValueImplCopyWith<$Res> { - __$$DeletedPillSheetValueImplCopyWithImpl(_$DeletedPillSheetValueImpl _value, - $Res Function(_$DeletedPillSheetValueImpl) _then) - : super(_value, _then); +class __$$DeletedPillSheetValueImplCopyWithImpl<$Res> extends _$DeletedPillSheetValueCopyWithImpl<$Res, _$DeletedPillSheetValueImpl> implements _$$DeletedPillSheetValueImplCopyWith<$Res> { + __$$DeletedPillSheetValueImplCopyWithImpl(_$DeletedPillSheetValueImpl _value, $Res Function(_$DeletedPillSheetValueImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -1291,23 +1048,17 @@ class __$$DeletedPillSheetValueImplCopyWithImpl<$Res> @JsonSerializable(explicitToJson: true) class _$DeletedPillSheetValueImpl extends _DeletedPillSheetValue { const _$DeletedPillSheetValueImpl( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.pillSheetDeletedAt, + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.pillSheetDeletedAt, final List pillSheetIDs = const []}) : _pillSheetIDs = pillSheetIDs, super._(); - factory _$DeletedPillSheetValueImpl.fromJson(Map json) => - _$$DeletedPillSheetValueImplFromJson(json); + factory _$DeletedPillSheetValueImpl.fromJson(Map json) => _$$DeletedPillSheetValueImplFromJson(json); // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime pillSheetDeletedAt; final List _pillSheetIDs; @override @@ -1328,23 +1079,18 @@ class _$DeletedPillSheetValueImpl extends _DeletedPillSheetValue { return identical(this, other) || (other.runtimeType == runtimeType && other is _$DeletedPillSheetValueImpl && - (identical(other.pillSheetDeletedAt, pillSheetDeletedAt) || - other.pillSheetDeletedAt == pillSheetDeletedAt) && - const DeepCollectionEquality() - .equals(other._pillSheetIDs, _pillSheetIDs)); + (identical(other.pillSheetDeletedAt, pillSheetDeletedAt) || other.pillSheetDeletedAt == pillSheetDeletedAt) && + const DeepCollectionEquality().equals(other._pillSheetIDs, _pillSheetIDs)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, pillSheetDeletedAt, - const DeepCollectionEquality().hash(_pillSheetIDs)); + int get hashCode => Object.hash(runtimeType, pillSheetDeletedAt, const DeepCollectionEquality().hash(_pillSheetIDs)); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$DeletedPillSheetValueImplCopyWith<_$DeletedPillSheetValueImpl> - get copyWith => __$$DeletedPillSheetValueImplCopyWithImpl< - _$DeletedPillSheetValueImpl>(this, _$identity); + _$$DeletedPillSheetValueImplCopyWith<_$DeletedPillSheetValueImpl> get copyWith => __$$DeletedPillSheetValueImplCopyWithImpl<_$DeletedPillSheetValueImpl>(this, _$identity); @override Map toJson() { @@ -1356,28 +1102,21 @@ class _$DeletedPillSheetValueImpl extends _DeletedPillSheetValue { abstract class _DeletedPillSheetValue extends DeletedPillSheetValue { const factory _DeletedPillSheetValue( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime pillSheetDeletedAt, + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime pillSheetDeletedAt, final List pillSheetIDs}) = _$DeletedPillSheetValueImpl; const _DeletedPillSheetValue._() : super._(); - factory _DeletedPillSheetValue.fromJson(Map json) = - _$DeletedPillSheetValueImpl.fromJson; + factory _DeletedPillSheetValue.fromJson(Map json) = _$DeletedPillSheetValueImpl.fromJson; @override // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get pillSheetDeletedAt; @override List get pillSheetIDs; @override @JsonKey(ignore: true) - _$$DeletedPillSheetValueImplCopyWith<_$DeletedPillSheetValueImpl> - get copyWith => throw _privateConstructorUsedError; + _$$DeletedPillSheetValueImplCopyWith<_$DeletedPillSheetValueImpl> get copyWith => throw _privateConstructorUsedError; } TakenPillValue _$TakenPillValueFromJson(Map json) { @@ -1389,44 +1128,30 @@ mixin _$TakenPillValue { // ============ BEGIN: Added since v1 ============ // null => 途中から追加したプロパティなので、どちらか不明 bool? get isQuickRecord => throw _privateConstructorUsedError; - TakenPillEditedValue? get edited => - throw _privateConstructorUsedError; // ============ END: Added since v1 ============ + TakenPillEditedValue? get edited => throw _privateConstructorUsedError; // ============ END: Added since v1 ============ // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get beforeLastTakenDate => throw _privateConstructorUsedError; - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get afterLastTakenDate => throw _privateConstructorUsedError; int get beforeLastTakenPillNumber => throw _privateConstructorUsedError; int get afterLastTakenPillNumber => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $TakenPillValueCopyWith get copyWith => - throw _privateConstructorUsedError; + $TakenPillValueCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $TakenPillValueCopyWith<$Res> { - factory $TakenPillValueCopyWith( - TakenPillValue value, $Res Function(TakenPillValue) then) = - _$TakenPillValueCopyWithImpl<$Res, TakenPillValue>; + factory $TakenPillValueCopyWith(TakenPillValue value, $Res Function(TakenPillValue) then) = _$TakenPillValueCopyWithImpl<$Res, TakenPillValue>; @useResult $Res call( {bool? isQuickRecord, TakenPillEditedValue? edited, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? beforeLastTakenDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime afterLastTakenDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? beforeLastTakenDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime afterLastTakenDate, int beforeLastTakenPillNumber, int afterLastTakenPillNumber}); @@ -1434,8 +1159,7 @@ abstract class $TakenPillValueCopyWith<$Res> { } /// @nodoc -class _$TakenPillValueCopyWithImpl<$Res, $Val extends TakenPillValue> - implements $TakenPillValueCopyWith<$Res> { +class _$TakenPillValueCopyWithImpl<$Res, $Val extends TakenPillValue> implements $TakenPillValueCopyWith<$Res> { _$TakenPillValueCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -1495,24 +1219,15 @@ class _$TakenPillValueCopyWithImpl<$Res, $Val extends TakenPillValue> } /// @nodoc -abstract class _$$TakenPillValueImplCopyWith<$Res> - implements $TakenPillValueCopyWith<$Res> { - factory _$$TakenPillValueImplCopyWith(_$TakenPillValueImpl value, - $Res Function(_$TakenPillValueImpl) then) = - __$$TakenPillValueImplCopyWithImpl<$Res>; +abstract class _$$TakenPillValueImplCopyWith<$Res> implements $TakenPillValueCopyWith<$Res> { + factory _$$TakenPillValueImplCopyWith(_$TakenPillValueImpl value, $Res Function(_$TakenPillValueImpl) then) = __$$TakenPillValueImplCopyWithImpl<$Res>; @override @useResult $Res call( {bool? isQuickRecord, TakenPillEditedValue? edited, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? beforeLastTakenDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime afterLastTakenDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? beforeLastTakenDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime afterLastTakenDate, int beforeLastTakenPillNumber, int afterLastTakenPillNumber}); @@ -1521,12 +1236,8 @@ abstract class _$$TakenPillValueImplCopyWith<$Res> } /// @nodoc -class __$$TakenPillValueImplCopyWithImpl<$Res> - extends _$TakenPillValueCopyWithImpl<$Res, _$TakenPillValueImpl> - implements _$$TakenPillValueImplCopyWith<$Res> { - __$$TakenPillValueImplCopyWithImpl( - _$TakenPillValueImpl _value, $Res Function(_$TakenPillValueImpl) _then) - : super(_value, _then); +class __$$TakenPillValueImplCopyWithImpl<$Res> extends _$TakenPillValueCopyWithImpl<$Res, _$TakenPillValueImpl> implements _$$TakenPillValueImplCopyWith<$Res> { + __$$TakenPillValueImplCopyWithImpl(_$TakenPillValueImpl _value, $Res Function(_$TakenPillValueImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -1574,20 +1285,13 @@ class _$TakenPillValueImpl extends _TakenPillValue { const _$TakenPillValueImpl( {this.isQuickRecord, this.edited, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - this.beforeLastTakenDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.afterLastTakenDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) this.beforeLastTakenDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.afterLastTakenDate, required this.beforeLastTakenPillNumber, required this.afterLastTakenPillNumber}) : super._(); - factory _$TakenPillValueImpl.fromJson(Map json) => - _$$TakenPillValueImplFromJson(json); + factory _$TakenPillValueImpl.fromJson(Map json) => _$$TakenPillValueImplFromJson(json); // ============ BEGIN: Added since v1 ============ // null => 途中から追加したプロパティなので、どちらか不明 @@ -1599,14 +1303,10 @@ class _$TakenPillValueImpl extends _TakenPillValue { // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? beforeLastTakenDate; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime afterLastTakenDate; @override final int beforeLastTakenPillNumber; @@ -1623,38 +1323,22 @@ class _$TakenPillValueImpl extends _TakenPillValue { return identical(this, other) || (other.runtimeType == runtimeType && other is _$TakenPillValueImpl && - (identical(other.isQuickRecord, isQuickRecord) || - other.isQuickRecord == isQuickRecord) && + (identical(other.isQuickRecord, isQuickRecord) || other.isQuickRecord == isQuickRecord) && (identical(other.edited, edited) || other.edited == edited) && - (identical(other.beforeLastTakenDate, beforeLastTakenDate) || - other.beforeLastTakenDate == beforeLastTakenDate) && - (identical(other.afterLastTakenDate, afterLastTakenDate) || - other.afterLastTakenDate == afterLastTakenDate) && - (identical(other.beforeLastTakenPillNumber, - beforeLastTakenPillNumber) || - other.beforeLastTakenPillNumber == beforeLastTakenPillNumber) && - (identical( - other.afterLastTakenPillNumber, afterLastTakenPillNumber) || - other.afterLastTakenPillNumber == afterLastTakenPillNumber)); + (identical(other.beforeLastTakenDate, beforeLastTakenDate) || other.beforeLastTakenDate == beforeLastTakenDate) && + (identical(other.afterLastTakenDate, afterLastTakenDate) || other.afterLastTakenDate == afterLastTakenDate) && + (identical(other.beforeLastTakenPillNumber, beforeLastTakenPillNumber) || other.beforeLastTakenPillNumber == beforeLastTakenPillNumber) && + (identical(other.afterLastTakenPillNumber, afterLastTakenPillNumber) || other.afterLastTakenPillNumber == afterLastTakenPillNumber)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, - isQuickRecord, - edited, - beforeLastTakenDate, - afterLastTakenDate, - beforeLastTakenPillNumber, - afterLastTakenPillNumber); + int get hashCode => Object.hash(runtimeType, isQuickRecord, edited, beforeLastTakenDate, afterLastTakenDate, beforeLastTakenPillNumber, afterLastTakenPillNumber); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$TakenPillValueImplCopyWith<_$TakenPillValueImpl> get copyWith => - __$$TakenPillValueImplCopyWithImpl<_$TakenPillValueImpl>( - this, _$identity); + _$$TakenPillValueImplCopyWith<_$TakenPillValueImpl> get copyWith => __$$TakenPillValueImplCopyWithImpl<_$TakenPillValueImpl>(this, _$identity); @override Map toJson() { @@ -1668,20 +1352,13 @@ abstract class _TakenPillValue extends TakenPillValue { const factory _TakenPillValue( {final bool? isQuickRecord, final TakenPillEditedValue? edited, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - final DateTime? beforeLastTakenDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime afterLastTakenDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? beforeLastTakenDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime afterLastTakenDate, required final int beforeLastTakenPillNumber, required final int afterLastTakenPillNumber}) = _$TakenPillValueImpl; const _TakenPillValue._() : super._(); - factory _TakenPillValue.fromJson(Map json) = - _$TakenPillValueImpl.fromJson; + factory _TakenPillValue.fromJson(Map json) = _$TakenPillValueImpl.fromJson; @override // ============ BEGIN: Added since v1 ============ // null => 途中から追加したプロパティなので、どちらか不明 @@ -1691,14 +1368,10 @@ abstract class _TakenPillValue extends TakenPillValue { @override // ============ END: Added since v1 ============ // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get beforeLastTakenDate; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get afterLastTakenDate; @override int get beforeLastTakenPillNumber; @@ -1706,8 +1379,7 @@ abstract class _TakenPillValue extends TakenPillValue { int get afterLastTakenPillNumber; @override @JsonKey(ignore: true) - _$$TakenPillValueImplCopyWith<_$TakenPillValueImpl> get copyWith => - throw _privateConstructorUsedError; + _$$TakenPillValueImplCopyWith<_$TakenPillValueImpl> get copyWith => throw _privateConstructorUsedError; } TakenPillEditedValue _$TakenPillEditedValueFromJson(Map json) { @@ -1718,51 +1390,30 @@ TakenPillEditedValue _$TakenPillEditedValueFromJson(Map json) { mixin _$TakenPillEditedValue { // ============ BEGIN: Added since v1 ============ // 実際の服用時刻。ユーザーが編集した後の服用時刻 - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime get actualTakenDate => - throw _privateConstructorUsedError; // 元々の履歴がDBに書き込まれた時刻。通常はユーザーが編集する前の服用時刻 - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) + DateTime get actualTakenDate => throw _privateConstructorUsedError; // 元々の履歴がDBに書き込まれた時刻。通常はユーザーが編集する前の服用時刻 + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get historyRecordedDate => throw _privateConstructorUsedError; - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get createdDate => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $TakenPillEditedValueCopyWith get copyWith => - throw _privateConstructorUsedError; + $TakenPillEditedValueCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $TakenPillEditedValueCopyWith<$Res> { - factory $TakenPillEditedValueCopyWith(TakenPillEditedValue value, - $Res Function(TakenPillEditedValue) then) = - _$TakenPillEditedValueCopyWithImpl<$Res, TakenPillEditedValue>; + factory $TakenPillEditedValueCopyWith(TakenPillEditedValue value, $Res Function(TakenPillEditedValue) then) = _$TakenPillEditedValueCopyWithImpl<$Res, TakenPillEditedValue>; @useResult $Res call( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime actualTakenDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime historyRecordedDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime createdDate}); -} - -/// @nodoc -class _$TakenPillEditedValueCopyWithImpl<$Res, - $Val extends TakenPillEditedValue> - implements $TakenPillEditedValueCopyWith<$Res> { + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime actualTakenDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime historyRecordedDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime createdDate}); +} + +/// @nodoc +class _$TakenPillEditedValueCopyWithImpl<$Res, $Val extends TakenPillEditedValue> implements $TakenPillEditedValueCopyWith<$Res> { _$TakenPillEditedValueCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -1795,35 +1446,19 @@ class _$TakenPillEditedValueCopyWithImpl<$Res, } /// @nodoc -abstract class _$$TakenPillEditedValueImplCopyWith<$Res> - implements $TakenPillEditedValueCopyWith<$Res> { - factory _$$TakenPillEditedValueImplCopyWith(_$TakenPillEditedValueImpl value, - $Res Function(_$TakenPillEditedValueImpl) then) = - __$$TakenPillEditedValueImplCopyWithImpl<$Res>; +abstract class _$$TakenPillEditedValueImplCopyWith<$Res> implements $TakenPillEditedValueCopyWith<$Res> { + factory _$$TakenPillEditedValueImplCopyWith(_$TakenPillEditedValueImpl value, $Res Function(_$TakenPillEditedValueImpl) then) = __$$TakenPillEditedValueImplCopyWithImpl<$Res>; @override @useResult $Res call( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime actualTakenDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime historyRecordedDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime createdDate}); -} - -/// @nodoc -class __$$TakenPillEditedValueImplCopyWithImpl<$Res> - extends _$TakenPillEditedValueCopyWithImpl<$Res, _$TakenPillEditedValueImpl> - implements _$$TakenPillEditedValueImplCopyWith<$Res> { - __$$TakenPillEditedValueImplCopyWithImpl(_$TakenPillEditedValueImpl _value, - $Res Function(_$TakenPillEditedValueImpl) _then) - : super(_value, _then); + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime actualTakenDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime historyRecordedDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime createdDate}); +} + +/// @nodoc +class __$$TakenPillEditedValueImplCopyWithImpl<$Res> extends _$TakenPillEditedValueCopyWithImpl<$Res, _$TakenPillEditedValueImpl> implements _$$TakenPillEditedValueImplCopyWith<$Res> { + __$$TakenPillEditedValueImplCopyWithImpl(_$TakenPillEditedValueImpl _value, $Res Function(_$TakenPillEditedValueImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -1854,40 +1489,24 @@ class __$$TakenPillEditedValueImplCopyWithImpl<$Res> @JsonSerializable(explicitToJson: true) class _$TakenPillEditedValueImpl extends _TakenPillEditedValue { const _$TakenPillEditedValueImpl( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.actualTakenDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.historyRecordedDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.createdDate}) + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.actualTakenDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.historyRecordedDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.createdDate}) : super._(); - factory _$TakenPillEditedValueImpl.fromJson(Map json) => - _$$TakenPillEditedValueImplFromJson(json); + factory _$TakenPillEditedValueImpl.fromJson(Map json) => _$$TakenPillEditedValueImplFromJson(json); // ============ BEGIN: Added since v1 ============ // 実際の服用時刻。ユーザーが編集した後の服用時刻 @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime actualTakenDate; // 元々の履歴がDBに書き込まれた時刻。通常はユーザーが編集する前の服用時刻 @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime historyRecordedDate; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime createdDate; @override @@ -1900,26 +1519,19 @@ class _$TakenPillEditedValueImpl extends _TakenPillEditedValue { return identical(this, other) || (other.runtimeType == runtimeType && other is _$TakenPillEditedValueImpl && - (identical(other.actualTakenDate, actualTakenDate) || - other.actualTakenDate == actualTakenDate) && - (identical(other.historyRecordedDate, historyRecordedDate) || - other.historyRecordedDate == historyRecordedDate) && - (identical(other.createdDate, createdDate) || - other.createdDate == createdDate)); + (identical(other.actualTakenDate, actualTakenDate) || other.actualTakenDate == actualTakenDate) && + (identical(other.historyRecordedDate, historyRecordedDate) || other.historyRecordedDate == historyRecordedDate) && + (identical(other.createdDate, createdDate) || other.createdDate == createdDate)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, actualTakenDate, historyRecordedDate, createdDate); + int get hashCode => Object.hash(runtimeType, actualTakenDate, historyRecordedDate, createdDate); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$TakenPillEditedValueImplCopyWith<_$TakenPillEditedValueImpl> - get copyWith => - __$$TakenPillEditedValueImplCopyWithImpl<_$TakenPillEditedValueImpl>( - this, _$identity); + _$$TakenPillEditedValueImplCopyWith<_$TakenPillEditedValueImpl> get copyWith => __$$TakenPillEditedValueImplCopyWithImpl<_$TakenPillEditedValueImpl>(this, _$identity); @override Map toJson() { @@ -1931,43 +1543,26 @@ class _$TakenPillEditedValueImpl extends _TakenPillEditedValue { abstract class _TakenPillEditedValue extends TakenPillEditedValue { const factory _TakenPillEditedValue( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime actualTakenDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime historyRecordedDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime createdDate}) = _$TakenPillEditedValueImpl; + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime actualTakenDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime historyRecordedDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime createdDate}) = _$TakenPillEditedValueImpl; const _TakenPillEditedValue._() : super._(); - factory _TakenPillEditedValue.fromJson(Map json) = - _$TakenPillEditedValueImpl.fromJson; + factory _TakenPillEditedValue.fromJson(Map json) = _$TakenPillEditedValueImpl.fromJson; @override // ============ BEGIN: Added since v1 ============ // 実際の服用時刻。ユーザーが編集した後の服用時刻 - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get actualTakenDate; @override // 元々の履歴がDBに書き込まれた時刻。通常はユーザーが編集する前の服用時刻 - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get historyRecordedDate; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get createdDate; @override @JsonKey(ignore: true) - _$$TakenPillEditedValueImplCopyWith<_$TakenPillEditedValueImpl> - get copyWith => throw _privateConstructorUsedError; + _$$TakenPillEditedValueImplCopyWith<_$TakenPillEditedValueImpl> get copyWith => throw _privateConstructorUsedError; } RevertTakenPillValue _$RevertTakenPillValueFromJson(Map json) { @@ -1978,46 +1573,31 @@ RevertTakenPillValue _$RevertTakenPillValueFromJson(Map json) { mixin _$RevertTakenPillValue { // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get beforeLastTakenDate => throw _privateConstructorUsedError; - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get afterLastTakenDate => throw _privateConstructorUsedError; int get beforeLastTakenPillNumber => throw _privateConstructorUsedError; int get afterLastTakenPillNumber => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $RevertTakenPillValueCopyWith get copyWith => - throw _privateConstructorUsedError; + $RevertTakenPillValueCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $RevertTakenPillValueCopyWith<$Res> { - factory $RevertTakenPillValueCopyWith(RevertTakenPillValue value, - $Res Function(RevertTakenPillValue) then) = - _$RevertTakenPillValueCopyWithImpl<$Res, RevertTakenPillValue>; + factory $RevertTakenPillValueCopyWith(RevertTakenPillValue value, $Res Function(RevertTakenPillValue) then) = _$RevertTakenPillValueCopyWithImpl<$Res, RevertTakenPillValue>; @useResult $Res call( - {@JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? beforeLastTakenDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime afterLastTakenDate, + {@JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? beforeLastTakenDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime afterLastTakenDate, int beforeLastTakenPillNumber, int afterLastTakenPillNumber}); } /// @nodoc -class _$RevertTakenPillValueCopyWithImpl<$Res, - $Val extends RevertTakenPillValue> - implements $RevertTakenPillValueCopyWith<$Res> { +class _$RevertTakenPillValueCopyWithImpl<$Res, $Val extends RevertTakenPillValue> implements $RevertTakenPillValueCopyWith<$Res> { _$RevertTakenPillValueCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -2055,33 +1635,20 @@ class _$RevertTakenPillValueCopyWithImpl<$Res, } /// @nodoc -abstract class _$$RevertTakenPillValueImplCopyWith<$Res> - implements $RevertTakenPillValueCopyWith<$Res> { - factory _$$RevertTakenPillValueImplCopyWith(_$RevertTakenPillValueImpl value, - $Res Function(_$RevertTakenPillValueImpl) then) = - __$$RevertTakenPillValueImplCopyWithImpl<$Res>; +abstract class _$$RevertTakenPillValueImplCopyWith<$Res> implements $RevertTakenPillValueCopyWith<$Res> { + factory _$$RevertTakenPillValueImplCopyWith(_$RevertTakenPillValueImpl value, $Res Function(_$RevertTakenPillValueImpl) then) = __$$RevertTakenPillValueImplCopyWithImpl<$Res>; @override @useResult $Res call( - {@JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? beforeLastTakenDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime afterLastTakenDate, + {@JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? beforeLastTakenDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime afterLastTakenDate, int beforeLastTakenPillNumber, int afterLastTakenPillNumber}); } /// @nodoc -class __$$RevertTakenPillValueImplCopyWithImpl<$Res> - extends _$RevertTakenPillValueCopyWithImpl<$Res, _$RevertTakenPillValueImpl> - implements _$$RevertTakenPillValueImplCopyWith<$Res> { - __$$RevertTakenPillValueImplCopyWithImpl(_$RevertTakenPillValueImpl _value, - $Res Function(_$RevertTakenPillValueImpl) _then) - : super(_value, _then); +class __$$RevertTakenPillValueImplCopyWithImpl<$Res> extends _$RevertTakenPillValueCopyWithImpl<$Res, _$RevertTakenPillValueImpl> implements _$$RevertTakenPillValueImplCopyWith<$Res> { + __$$RevertTakenPillValueImplCopyWithImpl(_$RevertTakenPillValueImpl _value, $Res Function(_$RevertTakenPillValueImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -2117,32 +1684,21 @@ class __$$RevertTakenPillValueImplCopyWithImpl<$Res> @JsonSerializable(explicitToJson: true) class _$RevertTakenPillValueImpl extends _RevertTakenPillValue { const _$RevertTakenPillValueImpl( - {@JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - this.beforeLastTakenDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.afterLastTakenDate, + {@JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) this.beforeLastTakenDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.afterLastTakenDate, required this.beforeLastTakenPillNumber, required this.afterLastTakenPillNumber}) : super._(); - factory _$RevertTakenPillValueImpl.fromJson(Map json) => - _$$RevertTakenPillValueImplFromJson(json); + factory _$RevertTakenPillValueImpl.fromJson(Map json) => _$$RevertTakenPillValueImplFromJson(json); // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? beforeLastTakenDate; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime afterLastTakenDate; @override final int beforeLastTakenPillNumber; @@ -2159,30 +1715,20 @@ class _$RevertTakenPillValueImpl extends _RevertTakenPillValue { return identical(this, other) || (other.runtimeType == runtimeType && other is _$RevertTakenPillValueImpl && - (identical(other.beforeLastTakenDate, beforeLastTakenDate) || - other.beforeLastTakenDate == beforeLastTakenDate) && - (identical(other.afterLastTakenDate, afterLastTakenDate) || - other.afterLastTakenDate == afterLastTakenDate) && - (identical(other.beforeLastTakenPillNumber, - beforeLastTakenPillNumber) || - other.beforeLastTakenPillNumber == beforeLastTakenPillNumber) && - (identical( - other.afterLastTakenPillNumber, afterLastTakenPillNumber) || - other.afterLastTakenPillNumber == afterLastTakenPillNumber)); + (identical(other.beforeLastTakenDate, beforeLastTakenDate) || other.beforeLastTakenDate == beforeLastTakenDate) && + (identical(other.afterLastTakenDate, afterLastTakenDate) || other.afterLastTakenDate == afterLastTakenDate) && + (identical(other.beforeLastTakenPillNumber, beforeLastTakenPillNumber) || other.beforeLastTakenPillNumber == beforeLastTakenPillNumber) && + (identical(other.afterLastTakenPillNumber, afterLastTakenPillNumber) || other.afterLastTakenPillNumber == afterLastTakenPillNumber)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, beforeLastTakenDate, - afterLastTakenDate, beforeLastTakenPillNumber, afterLastTakenPillNumber); + int get hashCode => Object.hash(runtimeType, beforeLastTakenDate, afterLastTakenDate, beforeLastTakenPillNumber, afterLastTakenPillNumber); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RevertTakenPillValueImplCopyWith<_$RevertTakenPillValueImpl> - get copyWith => - __$$RevertTakenPillValueImplCopyWithImpl<_$RevertTakenPillValueImpl>( - this, _$identity); + _$$RevertTakenPillValueImplCopyWith<_$RevertTakenPillValueImpl> get copyWith => __$$RevertTakenPillValueImplCopyWithImpl<_$RevertTakenPillValueImpl>(this, _$identity); @override Map toJson() { @@ -2194,32 +1740,20 @@ class _$RevertTakenPillValueImpl extends _RevertTakenPillValue { abstract class _RevertTakenPillValue extends RevertTakenPillValue { const factory _RevertTakenPillValue( - {@JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - final DateTime? beforeLastTakenDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime afterLastTakenDate, - required final int beforeLastTakenPillNumber, - required final int afterLastTakenPillNumber}) = - _$RevertTakenPillValueImpl; + {@JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? beforeLastTakenDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime afterLastTakenDate, + required final int beforeLastTakenPillNumber, + required final int afterLastTakenPillNumber}) = _$RevertTakenPillValueImpl; const _RevertTakenPillValue._() : super._(); - factory _RevertTakenPillValue.fromJson(Map json) = - _$RevertTakenPillValueImpl.fromJson; + factory _RevertTakenPillValue.fromJson(Map json) = _$RevertTakenPillValueImpl.fromJson; @override // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get beforeLastTakenDate; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get afterLastTakenDate; @override int get beforeLastTakenPillNumber; @@ -2227,12 +1761,10 @@ abstract class _RevertTakenPillValue extends RevertTakenPillValue { int get afterLastTakenPillNumber; @override @JsonKey(ignore: true) - _$$RevertTakenPillValueImplCopyWith<_$RevertTakenPillValueImpl> - get copyWith => throw _privateConstructorUsedError; + _$$RevertTakenPillValueImplCopyWith<_$RevertTakenPillValueImpl> get copyWith => throw _privateConstructorUsedError; } -ChangedPillNumberValue _$ChangedPillNumberValueFromJson( - Map json) { +ChangedPillNumberValue _$ChangedPillNumberValueFromJson(Map json) { return _ChangedPillNumberValue.fromJson(json); } @@ -2240,13 +1772,9 @@ ChangedPillNumberValue _$ChangedPillNumberValueFromJson( mixin _$ChangedPillNumberValue { // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get beforeBeginingDate => throw _privateConstructorUsedError; - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get afterBeginingDate => throw _privateConstructorUsedError; int get beforeTodayPillNumber => throw _privateConstructorUsedError; int get afterTodayPillNumber => throw _privateConstructorUsedError; @@ -2255,25 +1783,16 @@ mixin _$ChangedPillNumberValue { Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $ChangedPillNumberValueCopyWith get copyWith => - throw _privateConstructorUsedError; + $ChangedPillNumberValueCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChangedPillNumberValueCopyWith<$Res> { - factory $ChangedPillNumberValueCopyWith(ChangedPillNumberValue value, - $Res Function(ChangedPillNumberValue) then) = - _$ChangedPillNumberValueCopyWithImpl<$Res, ChangedPillNumberValue>; + factory $ChangedPillNumberValueCopyWith(ChangedPillNumberValue value, $Res Function(ChangedPillNumberValue) then) = _$ChangedPillNumberValueCopyWithImpl<$Res, ChangedPillNumberValue>; @useResult $Res call( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime beforeBeginingDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime afterBeginingDate, + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime beforeBeginingDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime afterBeginingDate, int beforeTodayPillNumber, int afterTodayPillNumber, int beforeGroupIndex, @@ -2281,9 +1800,7 @@ abstract class $ChangedPillNumberValueCopyWith<$Res> { } /// @nodoc -class _$ChangedPillNumberValueCopyWithImpl<$Res, - $Val extends ChangedPillNumberValue> - implements $ChangedPillNumberValueCopyWith<$Res> { +class _$ChangedPillNumberValueCopyWithImpl<$Res, $Val extends ChangedPillNumberValue> implements $ChangedPillNumberValueCopyWith<$Res> { _$ChangedPillNumberValueCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -2331,23 +1848,13 @@ class _$ChangedPillNumberValueCopyWithImpl<$Res, } /// @nodoc -abstract class _$$ChangedPillNumberValueImplCopyWith<$Res> - implements $ChangedPillNumberValueCopyWith<$Res> { - factory _$$ChangedPillNumberValueImplCopyWith( - _$ChangedPillNumberValueImpl value, - $Res Function(_$ChangedPillNumberValueImpl) then) = - __$$ChangedPillNumberValueImplCopyWithImpl<$Res>; +abstract class _$$ChangedPillNumberValueImplCopyWith<$Res> implements $ChangedPillNumberValueCopyWith<$Res> { + factory _$$ChangedPillNumberValueImplCopyWith(_$ChangedPillNumberValueImpl value, $Res Function(_$ChangedPillNumberValueImpl) then) = __$$ChangedPillNumberValueImplCopyWithImpl<$Res>; @override @useResult $Res call( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime beforeBeginingDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime afterBeginingDate, + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime beforeBeginingDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime afterBeginingDate, int beforeTodayPillNumber, int afterTodayPillNumber, int beforeGroupIndex, @@ -2355,14 +1862,8 @@ abstract class _$$ChangedPillNumberValueImplCopyWith<$Res> } /// @nodoc -class __$$ChangedPillNumberValueImplCopyWithImpl<$Res> - extends _$ChangedPillNumberValueCopyWithImpl<$Res, - _$ChangedPillNumberValueImpl> - implements _$$ChangedPillNumberValueImplCopyWith<$Res> { - __$$ChangedPillNumberValueImplCopyWithImpl( - _$ChangedPillNumberValueImpl _value, - $Res Function(_$ChangedPillNumberValueImpl) _then) - : super(_value, _then); +class __$$ChangedPillNumberValueImplCopyWithImpl<$Res> extends _$ChangedPillNumberValueCopyWithImpl<$Res, _$ChangedPillNumberValueImpl> implements _$$ChangedPillNumberValueImplCopyWith<$Res> { + __$$ChangedPillNumberValueImplCopyWithImpl(_$ChangedPillNumberValueImpl _value, $Res Function(_$ChangedPillNumberValueImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -2408,34 +1909,23 @@ class __$$ChangedPillNumberValueImplCopyWithImpl<$Res> @JsonSerializable(explicitToJson: true) class _$ChangedPillNumberValueImpl extends _ChangedPillNumberValue { const _$ChangedPillNumberValueImpl( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.beforeBeginingDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.afterBeginingDate, + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.beforeBeginingDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.afterBeginingDate, required this.beforeTodayPillNumber, required this.afterTodayPillNumber, this.beforeGroupIndex = 1, this.afterGroupIndex = 1}) : super._(); - factory _$ChangedPillNumberValueImpl.fromJson(Map json) => - _$$ChangedPillNumberValueImplFromJson(json); + factory _$ChangedPillNumberValueImpl.fromJson(Map json) => _$$ChangedPillNumberValueImplFromJson(json); // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime beforeBeginingDate; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime afterBeginingDate; @override final int beforeTodayPillNumber; @@ -2458,37 +1948,22 @@ class _$ChangedPillNumberValueImpl extends _ChangedPillNumberValue { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChangedPillNumberValueImpl && - (identical(other.beforeBeginingDate, beforeBeginingDate) || - other.beforeBeginingDate == beforeBeginingDate) && - (identical(other.afterBeginingDate, afterBeginingDate) || - other.afterBeginingDate == afterBeginingDate) && - (identical(other.beforeTodayPillNumber, beforeTodayPillNumber) || - other.beforeTodayPillNumber == beforeTodayPillNumber) && - (identical(other.afterTodayPillNumber, afterTodayPillNumber) || - other.afterTodayPillNumber == afterTodayPillNumber) && - (identical(other.beforeGroupIndex, beforeGroupIndex) || - other.beforeGroupIndex == beforeGroupIndex) && - (identical(other.afterGroupIndex, afterGroupIndex) || - other.afterGroupIndex == afterGroupIndex)); + (identical(other.beforeBeginingDate, beforeBeginingDate) || other.beforeBeginingDate == beforeBeginingDate) && + (identical(other.afterBeginingDate, afterBeginingDate) || other.afterBeginingDate == afterBeginingDate) && + (identical(other.beforeTodayPillNumber, beforeTodayPillNumber) || other.beforeTodayPillNumber == beforeTodayPillNumber) && + (identical(other.afterTodayPillNumber, afterTodayPillNumber) || other.afterTodayPillNumber == afterTodayPillNumber) && + (identical(other.beforeGroupIndex, beforeGroupIndex) || other.beforeGroupIndex == beforeGroupIndex) && + (identical(other.afterGroupIndex, afterGroupIndex) || other.afterGroupIndex == afterGroupIndex)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, - beforeBeginingDate, - afterBeginingDate, - beforeTodayPillNumber, - afterTodayPillNumber, - beforeGroupIndex, - afterGroupIndex); + int get hashCode => Object.hash(runtimeType, beforeBeginingDate, afterBeginingDate, beforeTodayPillNumber, afterTodayPillNumber, beforeGroupIndex, afterGroupIndex); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ChangedPillNumberValueImplCopyWith<_$ChangedPillNumberValueImpl> - get copyWith => __$$ChangedPillNumberValueImplCopyWithImpl< - _$ChangedPillNumberValueImpl>(this, _$identity); + _$$ChangedPillNumberValueImplCopyWith<_$ChangedPillNumberValueImpl> get copyWith => __$$ChangedPillNumberValueImplCopyWithImpl<_$ChangedPillNumberValueImpl>(this, _$identity); @override Map toJson() { @@ -2500,33 +1975,22 @@ class _$ChangedPillNumberValueImpl extends _ChangedPillNumberValue { abstract class _ChangedPillNumberValue extends ChangedPillNumberValue { const factory _ChangedPillNumberValue( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime beforeBeginingDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime afterBeginingDate, + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime beforeBeginingDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime afterBeginingDate, required final int beforeTodayPillNumber, required final int afterTodayPillNumber, final int beforeGroupIndex, final int afterGroupIndex}) = _$ChangedPillNumberValueImpl; const _ChangedPillNumberValue._() : super._(); - factory _ChangedPillNumberValue.fromJson(Map json) = - _$ChangedPillNumberValueImpl.fromJson; + factory _ChangedPillNumberValue.fromJson(Map json) = _$ChangedPillNumberValueImpl.fromJson; @override // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get beforeBeginingDate; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get afterBeginingDate; @override int get beforeTodayPillNumber; @@ -2538,8 +2002,7 @@ abstract class _ChangedPillNumberValue extends ChangedPillNumberValue { int get afterGroupIndex; @override @JsonKey(ignore: true) - _$$ChangedPillNumberValueImplCopyWith<_$ChangedPillNumberValueImpl> - get copyWith => throw _privateConstructorUsedError; + _$$ChangedPillNumberValueImplCopyWith<_$ChangedPillNumberValueImpl> get copyWith => throw _privateConstructorUsedError; } EndedPillSheetValue _$EndedPillSheetValueFromJson(Map json) { @@ -2549,42 +2012,27 @@ EndedPillSheetValue _$EndedPillSheetValueFromJson(Map json) { /// @nodoc mixin _$EndedPillSheetValue { // 終了した日付。サーバーで書き込まれる - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime get endRecordDate => - throw _privateConstructorUsedError; // 終了した時点での最終服用日 - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) + DateTime get endRecordDate => throw _privateConstructorUsedError; // 終了した時点での最終服用日 + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get lastTakenDate => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $EndedPillSheetValueCopyWith get copyWith => - throw _privateConstructorUsedError; + $EndedPillSheetValueCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $EndedPillSheetValueCopyWith<$Res> { - factory $EndedPillSheetValueCopyWith( - EndedPillSheetValue value, $Res Function(EndedPillSheetValue) then) = - _$EndedPillSheetValueCopyWithImpl<$Res, EndedPillSheetValue>; + factory $EndedPillSheetValueCopyWith(EndedPillSheetValue value, $Res Function(EndedPillSheetValue) then) = _$EndedPillSheetValueCopyWithImpl<$Res, EndedPillSheetValue>; @useResult $Res call( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime endRecordDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime lastTakenDate}); + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime endRecordDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime lastTakenDate}); } /// @nodoc -class _$EndedPillSheetValueCopyWithImpl<$Res, $Val extends EndedPillSheetValue> - implements $EndedPillSheetValueCopyWith<$Res> { +class _$EndedPillSheetValueCopyWithImpl<$Res, $Val extends EndedPillSheetValue> implements $EndedPillSheetValueCopyWith<$Res> { _$EndedPillSheetValueCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -2612,31 +2060,18 @@ class _$EndedPillSheetValueCopyWithImpl<$Res, $Val extends EndedPillSheetValue> } /// @nodoc -abstract class _$$EndedPillSheetValueImplCopyWith<$Res> - implements $EndedPillSheetValueCopyWith<$Res> { - factory _$$EndedPillSheetValueImplCopyWith(_$EndedPillSheetValueImpl value, - $Res Function(_$EndedPillSheetValueImpl) then) = - __$$EndedPillSheetValueImplCopyWithImpl<$Res>; +abstract class _$$EndedPillSheetValueImplCopyWith<$Res> implements $EndedPillSheetValueCopyWith<$Res> { + factory _$$EndedPillSheetValueImplCopyWith(_$EndedPillSheetValueImpl value, $Res Function(_$EndedPillSheetValueImpl) then) = __$$EndedPillSheetValueImplCopyWithImpl<$Res>; @override @useResult $Res call( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime endRecordDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime lastTakenDate}); -} - -/// @nodoc -class __$$EndedPillSheetValueImplCopyWithImpl<$Res> - extends _$EndedPillSheetValueCopyWithImpl<$Res, _$EndedPillSheetValueImpl> - implements _$$EndedPillSheetValueImplCopyWith<$Res> { - __$$EndedPillSheetValueImplCopyWithImpl(_$EndedPillSheetValueImpl _value, - $Res Function(_$EndedPillSheetValueImpl) _then) - : super(_value, _then); + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime endRecordDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime lastTakenDate}); +} + +/// @nodoc +class __$$EndedPillSheetValueImplCopyWithImpl<$Res> extends _$EndedPillSheetValueCopyWithImpl<$Res, _$EndedPillSheetValueImpl> implements _$$EndedPillSheetValueImplCopyWith<$Res> { + __$$EndedPillSheetValueImplCopyWithImpl(_$EndedPillSheetValueImpl _value, $Res Function(_$EndedPillSheetValueImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -2662,30 +2097,19 @@ class __$$EndedPillSheetValueImplCopyWithImpl<$Res> @JsonSerializable(explicitToJson: true) class _$EndedPillSheetValueImpl extends _EndedPillSheetValue { const _$EndedPillSheetValueImpl( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.endRecordDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.lastTakenDate}) + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.endRecordDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.lastTakenDate}) : super._(); - factory _$EndedPillSheetValueImpl.fromJson(Map json) => - _$$EndedPillSheetValueImplFromJson(json); + factory _$EndedPillSheetValueImpl.fromJson(Map json) => _$$EndedPillSheetValueImplFromJson(json); // 終了した日付。サーバーで書き込まれる @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime endRecordDate; // 終了した時点での最終服用日 @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime lastTakenDate; @override @@ -2698,10 +2122,8 @@ class _$EndedPillSheetValueImpl extends _EndedPillSheetValue { return identical(this, other) || (other.runtimeType == runtimeType && other is _$EndedPillSheetValueImpl && - (identical(other.endRecordDate, endRecordDate) || - other.endRecordDate == endRecordDate) && - (identical(other.lastTakenDate, lastTakenDate) || - other.lastTakenDate == lastTakenDate)); + (identical(other.endRecordDate, endRecordDate) || other.endRecordDate == endRecordDate) && + (identical(other.lastTakenDate, lastTakenDate) || other.lastTakenDate == lastTakenDate)); } @JsonKey(ignore: true) @@ -2711,9 +2133,7 @@ class _$EndedPillSheetValueImpl extends _EndedPillSheetValue { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$EndedPillSheetValueImplCopyWith<_$EndedPillSheetValueImpl> get copyWith => - __$$EndedPillSheetValueImplCopyWithImpl<_$EndedPillSheetValueImpl>( - this, _$identity); + _$$EndedPillSheetValueImplCopyWith<_$EndedPillSheetValueImpl> get copyWith => __$$EndedPillSheetValueImplCopyWithImpl<_$EndedPillSheetValueImpl>(this, _$identity); @override Map toJson() { @@ -2725,37 +2145,24 @@ class _$EndedPillSheetValueImpl extends _EndedPillSheetValue { abstract class _EndedPillSheetValue extends EndedPillSheetValue { const factory _EndedPillSheetValue( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime endRecordDate, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime lastTakenDate}) = _$EndedPillSheetValueImpl; + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime endRecordDate, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime lastTakenDate}) = _$EndedPillSheetValueImpl; const _EndedPillSheetValue._() : super._(); - factory _EndedPillSheetValue.fromJson(Map json) = - _$EndedPillSheetValueImpl.fromJson; + factory _EndedPillSheetValue.fromJson(Map json) = _$EndedPillSheetValueImpl.fromJson; @override // 終了した日付。サーバーで書き込まれる - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get endRecordDate; @override // 終了した時点での最終服用日 - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get lastTakenDate; @override @JsonKey(ignore: true) - _$$EndedPillSheetValueImplCopyWith<_$EndedPillSheetValueImpl> get copyWith => - throw _privateConstructorUsedError; + _$$EndedPillSheetValueImplCopyWith<_$EndedPillSheetValueImpl> get copyWith => throw _privateConstructorUsedError; } -BeganRestDurationValue _$BeganRestDurationValueFromJson( - Map json) { +BeganRestDurationValue _$BeganRestDurationValueFromJson(Map json) { return _BeganRestDurationValue.fromJson(json); } @@ -2767,15 +2174,12 @@ mixin _$BeganRestDurationValue { Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $BeganRestDurationValueCopyWith get copyWith => - throw _privateConstructorUsedError; + $BeganRestDurationValueCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $BeganRestDurationValueCopyWith<$Res> { - factory $BeganRestDurationValueCopyWith(BeganRestDurationValue value, - $Res Function(BeganRestDurationValue) then) = - _$BeganRestDurationValueCopyWithImpl<$Res, BeganRestDurationValue>; + factory $BeganRestDurationValueCopyWith(BeganRestDurationValue value, $Res Function(BeganRestDurationValue) then) = _$BeganRestDurationValueCopyWithImpl<$Res, BeganRestDurationValue>; @useResult $Res call({RestDuration restDuration}); @@ -2783,9 +2187,7 @@ abstract class $BeganRestDurationValueCopyWith<$Res> { } /// @nodoc -class _$BeganRestDurationValueCopyWithImpl<$Res, - $Val extends BeganRestDurationValue> - implements $BeganRestDurationValueCopyWith<$Res> { +class _$BeganRestDurationValueCopyWithImpl<$Res, $Val extends BeganRestDurationValue> implements $BeganRestDurationValueCopyWith<$Res> { _$BeganRestDurationValueCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -2816,12 +2218,8 @@ class _$BeganRestDurationValueCopyWithImpl<$Res, } /// @nodoc -abstract class _$$BeganRestDurationValueImplCopyWith<$Res> - implements $BeganRestDurationValueCopyWith<$Res> { - factory _$$BeganRestDurationValueImplCopyWith( - _$BeganRestDurationValueImpl value, - $Res Function(_$BeganRestDurationValueImpl) then) = - __$$BeganRestDurationValueImplCopyWithImpl<$Res>; +abstract class _$$BeganRestDurationValueImplCopyWith<$Res> implements $BeganRestDurationValueCopyWith<$Res> { + factory _$$BeganRestDurationValueImplCopyWith(_$BeganRestDurationValueImpl value, $Res Function(_$BeganRestDurationValueImpl) then) = __$$BeganRestDurationValueImplCopyWithImpl<$Res>; @override @useResult $Res call({RestDuration restDuration}); @@ -2831,14 +2229,8 @@ abstract class _$$BeganRestDurationValueImplCopyWith<$Res> } /// @nodoc -class __$$BeganRestDurationValueImplCopyWithImpl<$Res> - extends _$BeganRestDurationValueCopyWithImpl<$Res, - _$BeganRestDurationValueImpl> - implements _$$BeganRestDurationValueImplCopyWith<$Res> { - __$$BeganRestDurationValueImplCopyWithImpl( - _$BeganRestDurationValueImpl _value, - $Res Function(_$BeganRestDurationValueImpl) _then) - : super(_value, _then); +class __$$BeganRestDurationValueImplCopyWithImpl<$Res> extends _$BeganRestDurationValueCopyWithImpl<$Res, _$BeganRestDurationValueImpl> implements _$$BeganRestDurationValueImplCopyWith<$Res> { + __$$BeganRestDurationValueImplCopyWithImpl(_$BeganRestDurationValueImpl _value, $Res Function(_$BeganRestDurationValueImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -2860,8 +2252,7 @@ class __$$BeganRestDurationValueImplCopyWithImpl<$Res> class _$BeganRestDurationValueImpl extends _BeganRestDurationValue { const _$BeganRestDurationValueImpl({required this.restDuration}) : super._(); - factory _$BeganRestDurationValueImpl.fromJson(Map json) => - _$$BeganRestDurationValueImplFromJson(json); + factory _$BeganRestDurationValueImpl.fromJson(Map json) => _$$BeganRestDurationValueImplFromJson(json); // ============ BEGIN: Added since v1 ============ // どの服用お休み期間か特定するのが大変なので記録したものを使用する @@ -2875,11 +2266,7 @@ class _$BeganRestDurationValueImpl extends _BeganRestDurationValue { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$BeganRestDurationValueImpl && - (identical(other.restDuration, restDuration) || - other.restDuration == restDuration)); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$BeganRestDurationValueImpl && (identical(other.restDuration, restDuration) || other.restDuration == restDuration)); } @JsonKey(ignore: true) @@ -2889,9 +2276,7 @@ class _$BeganRestDurationValueImpl extends _BeganRestDurationValue { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$BeganRestDurationValueImplCopyWith<_$BeganRestDurationValueImpl> - get copyWith => __$$BeganRestDurationValueImplCopyWithImpl< - _$BeganRestDurationValueImpl>(this, _$identity); + _$$BeganRestDurationValueImplCopyWith<_$BeganRestDurationValueImpl> get copyWith => __$$BeganRestDurationValueImplCopyWithImpl<_$BeganRestDurationValueImpl>(this, _$identity); @override Map toJson() { @@ -2902,25 +2287,20 @@ class _$BeganRestDurationValueImpl extends _BeganRestDurationValue { } abstract class _BeganRestDurationValue extends BeganRestDurationValue { - const factory _BeganRestDurationValue( - {required final RestDuration restDuration}) = - _$BeganRestDurationValueImpl; + const factory _BeganRestDurationValue({required final RestDuration restDuration}) = _$BeganRestDurationValueImpl; const _BeganRestDurationValue._() : super._(); - factory _BeganRestDurationValue.fromJson(Map json) = - _$BeganRestDurationValueImpl.fromJson; + factory _BeganRestDurationValue.fromJson(Map json) = _$BeganRestDurationValueImpl.fromJson; @override // ============ BEGIN: Added since v1 ============ // どの服用お休み期間か特定するのが大変なので記録したものを使用する RestDuration get restDuration; @override @JsonKey(ignore: true) - _$$BeganRestDurationValueImplCopyWith<_$BeganRestDurationValueImpl> - get copyWith => throw _privateConstructorUsedError; + _$$BeganRestDurationValueImplCopyWith<_$BeganRestDurationValueImpl> get copyWith => throw _privateConstructorUsedError; } -EndedRestDurationValue _$EndedRestDurationValueFromJson( - Map json) { +EndedRestDurationValue _$EndedRestDurationValueFromJson(Map json) { return _EndedRestDurationValue.fromJson(json); } @@ -2932,15 +2312,12 @@ mixin _$EndedRestDurationValue { Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $EndedRestDurationValueCopyWith get copyWith => - throw _privateConstructorUsedError; + $EndedRestDurationValueCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $EndedRestDurationValueCopyWith<$Res> { - factory $EndedRestDurationValueCopyWith(EndedRestDurationValue value, - $Res Function(EndedRestDurationValue) then) = - _$EndedRestDurationValueCopyWithImpl<$Res, EndedRestDurationValue>; + factory $EndedRestDurationValueCopyWith(EndedRestDurationValue value, $Res Function(EndedRestDurationValue) then) = _$EndedRestDurationValueCopyWithImpl<$Res, EndedRestDurationValue>; @useResult $Res call({RestDuration restDuration}); @@ -2948,9 +2325,7 @@ abstract class $EndedRestDurationValueCopyWith<$Res> { } /// @nodoc -class _$EndedRestDurationValueCopyWithImpl<$Res, - $Val extends EndedRestDurationValue> - implements $EndedRestDurationValueCopyWith<$Res> { +class _$EndedRestDurationValueCopyWithImpl<$Res, $Val extends EndedRestDurationValue> implements $EndedRestDurationValueCopyWith<$Res> { _$EndedRestDurationValueCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -2981,12 +2356,8 @@ class _$EndedRestDurationValueCopyWithImpl<$Res, } /// @nodoc -abstract class _$$EndedRestDurationValueImplCopyWith<$Res> - implements $EndedRestDurationValueCopyWith<$Res> { - factory _$$EndedRestDurationValueImplCopyWith( - _$EndedRestDurationValueImpl value, - $Res Function(_$EndedRestDurationValueImpl) then) = - __$$EndedRestDurationValueImplCopyWithImpl<$Res>; +abstract class _$$EndedRestDurationValueImplCopyWith<$Res> implements $EndedRestDurationValueCopyWith<$Res> { + factory _$$EndedRestDurationValueImplCopyWith(_$EndedRestDurationValueImpl value, $Res Function(_$EndedRestDurationValueImpl) then) = __$$EndedRestDurationValueImplCopyWithImpl<$Res>; @override @useResult $Res call({RestDuration restDuration}); @@ -2996,14 +2367,8 @@ abstract class _$$EndedRestDurationValueImplCopyWith<$Res> } /// @nodoc -class __$$EndedRestDurationValueImplCopyWithImpl<$Res> - extends _$EndedRestDurationValueCopyWithImpl<$Res, - _$EndedRestDurationValueImpl> - implements _$$EndedRestDurationValueImplCopyWith<$Res> { - __$$EndedRestDurationValueImplCopyWithImpl( - _$EndedRestDurationValueImpl _value, - $Res Function(_$EndedRestDurationValueImpl) _then) - : super(_value, _then); +class __$$EndedRestDurationValueImplCopyWithImpl<$Res> extends _$EndedRestDurationValueCopyWithImpl<$Res, _$EndedRestDurationValueImpl> implements _$$EndedRestDurationValueImplCopyWith<$Res> { + __$$EndedRestDurationValueImplCopyWithImpl(_$EndedRestDurationValueImpl _value, $Res Function(_$EndedRestDurationValueImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -3025,8 +2390,7 @@ class __$$EndedRestDurationValueImplCopyWithImpl<$Res> class _$EndedRestDurationValueImpl extends _EndedRestDurationValue { const _$EndedRestDurationValueImpl({required this.restDuration}) : super._(); - factory _$EndedRestDurationValueImpl.fromJson(Map json) => - _$$EndedRestDurationValueImplFromJson(json); + factory _$EndedRestDurationValueImpl.fromJson(Map json) => _$$EndedRestDurationValueImplFromJson(json); // ============ BEGIN: Added since v1 ============ // どの服用お休み期間か特定するのが大変なので記録したものを使用する @@ -3040,11 +2404,7 @@ class _$EndedRestDurationValueImpl extends _EndedRestDurationValue { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$EndedRestDurationValueImpl && - (identical(other.restDuration, restDuration) || - other.restDuration == restDuration)); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$EndedRestDurationValueImpl && (identical(other.restDuration, restDuration) || other.restDuration == restDuration)); } @JsonKey(ignore: true) @@ -3054,9 +2414,7 @@ class _$EndedRestDurationValueImpl extends _EndedRestDurationValue { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$EndedRestDurationValueImplCopyWith<_$EndedRestDurationValueImpl> - get copyWith => __$$EndedRestDurationValueImplCopyWithImpl< - _$EndedRestDurationValueImpl>(this, _$identity); + _$$EndedRestDurationValueImplCopyWith<_$EndedRestDurationValueImpl> get copyWith => __$$EndedRestDurationValueImplCopyWithImpl<_$EndedRestDurationValueImpl>(this, _$identity); @override Map toJson() { @@ -3067,25 +2425,20 @@ class _$EndedRestDurationValueImpl extends _EndedRestDurationValue { } abstract class _EndedRestDurationValue extends EndedRestDurationValue { - const factory _EndedRestDurationValue( - {required final RestDuration restDuration}) = - _$EndedRestDurationValueImpl; + const factory _EndedRestDurationValue({required final RestDuration restDuration}) = _$EndedRestDurationValueImpl; const _EndedRestDurationValue._() : super._(); - factory _EndedRestDurationValue.fromJson(Map json) = - _$EndedRestDurationValueImpl.fromJson; + factory _EndedRestDurationValue.fromJson(Map json) = _$EndedRestDurationValueImpl.fromJson; @override // ============ BEGIN: Added since v1 ============ // どの服用お休み期間か特定するのが大変なので記録したものを使用する RestDuration get restDuration; @override @JsonKey(ignore: true) - _$$EndedRestDurationValueImplCopyWith<_$EndedRestDurationValueImpl> - get copyWith => throw _privateConstructorUsedError; + _$$EndedRestDurationValueImplCopyWith<_$EndedRestDurationValueImpl> get copyWith => throw _privateConstructorUsedError; } -ChangedRestDurationBeginDateValue _$ChangedRestDurationBeginDateValueFromJson( - Map json) { +ChangedRestDurationBeginDateValue _$ChangedRestDurationBeginDateValueFromJson(Map json) { return _ChangedRestDurationBeginDateValue.fromJson(json); } @@ -3096,17 +2449,13 @@ mixin _$ChangedRestDurationBeginDateValue { Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $ChangedRestDurationBeginDateValueCopyWith - get copyWith => throw _privateConstructorUsedError; + $ChangedRestDurationBeginDateValueCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChangedRestDurationBeginDateValueCopyWith<$Res> { - factory $ChangedRestDurationBeginDateValueCopyWith( - ChangedRestDurationBeginDateValue value, - $Res Function(ChangedRestDurationBeginDateValue) then) = - _$ChangedRestDurationBeginDateValueCopyWithImpl<$Res, - ChangedRestDurationBeginDateValue>; + factory $ChangedRestDurationBeginDateValueCopyWith(ChangedRestDurationBeginDateValue value, $Res Function(ChangedRestDurationBeginDateValue) then) = + _$ChangedRestDurationBeginDateValueCopyWithImpl<$Res, ChangedRestDurationBeginDateValue>; @useResult $Res call({RestDuration beforeRestDuration, RestDuration afterRestDuration}); @@ -3115,9 +2464,7 @@ abstract class $ChangedRestDurationBeginDateValueCopyWith<$Res> { } /// @nodoc -class _$ChangedRestDurationBeginDateValueCopyWithImpl<$Res, - $Val extends ChangedRestDurationBeginDateValue> - implements $ChangedRestDurationBeginDateValueCopyWith<$Res> { +class _$ChangedRestDurationBeginDateValueCopyWithImpl<$Res, $Val extends ChangedRestDurationBeginDateValue> implements $ChangedRestDurationBeginDateValueCopyWith<$Res> { _$ChangedRestDurationBeginDateValueCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -3161,11 +2508,8 @@ class _$ChangedRestDurationBeginDateValueCopyWithImpl<$Res, } /// @nodoc -abstract class _$$ChangedRestDurationBeginDateValueImplCopyWith<$Res> - implements $ChangedRestDurationBeginDateValueCopyWith<$Res> { - factory _$$ChangedRestDurationBeginDateValueImplCopyWith( - _$ChangedRestDurationBeginDateValueImpl value, - $Res Function(_$ChangedRestDurationBeginDateValueImpl) then) = +abstract class _$$ChangedRestDurationBeginDateValueImplCopyWith<$Res> implements $ChangedRestDurationBeginDateValueCopyWith<$Res> { + factory _$$ChangedRestDurationBeginDateValueImplCopyWith(_$ChangedRestDurationBeginDateValueImpl value, $Res Function(_$ChangedRestDurationBeginDateValueImpl) then) = __$$ChangedRestDurationBeginDateValueImplCopyWithImpl<$Res>; @override @useResult @@ -3178,14 +2522,9 @@ abstract class _$$ChangedRestDurationBeginDateValueImplCopyWith<$Res> } /// @nodoc -class __$$ChangedRestDurationBeginDateValueImplCopyWithImpl<$Res> - extends _$ChangedRestDurationBeginDateValueCopyWithImpl<$Res, - _$ChangedRestDurationBeginDateValueImpl> +class __$$ChangedRestDurationBeginDateValueImplCopyWithImpl<$Res> extends _$ChangedRestDurationBeginDateValueCopyWithImpl<$Res, _$ChangedRestDurationBeginDateValueImpl> implements _$$ChangedRestDurationBeginDateValueImplCopyWith<$Res> { - __$$ChangedRestDurationBeginDateValueImplCopyWithImpl( - _$ChangedRestDurationBeginDateValueImpl _value, - $Res Function(_$ChangedRestDurationBeginDateValueImpl) _then) - : super(_value, _then); + __$$ChangedRestDurationBeginDateValueImplCopyWithImpl(_$ChangedRestDurationBeginDateValueImpl _value, $Res Function(_$ChangedRestDurationBeginDateValueImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -3209,15 +2548,10 @@ class __$$ChangedRestDurationBeginDateValueImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable(explicitToJson: true) -class _$ChangedRestDurationBeginDateValueImpl - extends _ChangedRestDurationBeginDateValue { - const _$ChangedRestDurationBeginDateValueImpl( - {required this.beforeRestDuration, required this.afterRestDuration}) - : super._(); +class _$ChangedRestDurationBeginDateValueImpl extends _ChangedRestDurationBeginDateValue { + const _$ChangedRestDurationBeginDateValueImpl({required this.beforeRestDuration, required this.afterRestDuration}) : super._(); - factory _$ChangedRestDurationBeginDateValueImpl.fromJson( - Map json) => - _$$ChangedRestDurationBeginDateValueImplFromJson(json); + factory _$ChangedRestDurationBeginDateValueImpl.fromJson(Map json) => _$$ChangedRestDurationBeginDateValueImplFromJson(json); @override final RestDuration beforeRestDuration; @@ -3234,24 +2568,19 @@ class _$ChangedRestDurationBeginDateValueImpl return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChangedRestDurationBeginDateValueImpl && - (identical(other.beforeRestDuration, beforeRestDuration) || - other.beforeRestDuration == beforeRestDuration) && - (identical(other.afterRestDuration, afterRestDuration) || - other.afterRestDuration == afterRestDuration)); + (identical(other.beforeRestDuration, beforeRestDuration) || other.beforeRestDuration == beforeRestDuration) && + (identical(other.afterRestDuration, afterRestDuration) || other.afterRestDuration == afterRestDuration)); } @JsonKey(ignore: true) @override - int get hashCode => - Object.hash(runtimeType, beforeRestDuration, afterRestDuration); + int get hashCode => Object.hash(runtimeType, beforeRestDuration, afterRestDuration); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ChangedRestDurationBeginDateValueImplCopyWith< - _$ChangedRestDurationBeginDateValueImpl> - get copyWith => __$$ChangedRestDurationBeginDateValueImplCopyWithImpl< - _$ChangedRestDurationBeginDateValueImpl>(this, _$identity); + _$$ChangedRestDurationBeginDateValueImplCopyWith<_$ChangedRestDurationBeginDateValueImpl> get copyWith => + __$$ChangedRestDurationBeginDateValueImplCopyWithImpl<_$ChangedRestDurationBeginDateValueImpl>(this, _$identity); @override Map toJson() { @@ -3261,17 +2590,11 @@ class _$ChangedRestDurationBeginDateValueImpl } } -abstract class _ChangedRestDurationBeginDateValue - extends ChangedRestDurationBeginDateValue { - const factory _ChangedRestDurationBeginDateValue( - {required final RestDuration beforeRestDuration, - required final RestDuration afterRestDuration}) = - _$ChangedRestDurationBeginDateValueImpl; +abstract class _ChangedRestDurationBeginDateValue extends ChangedRestDurationBeginDateValue { + const factory _ChangedRestDurationBeginDateValue({required final RestDuration beforeRestDuration, required final RestDuration afterRestDuration}) = _$ChangedRestDurationBeginDateValueImpl; const _ChangedRestDurationBeginDateValue._() : super._(); - factory _ChangedRestDurationBeginDateValue.fromJson( - Map json) = - _$ChangedRestDurationBeginDateValueImpl.fromJson; + factory _ChangedRestDurationBeginDateValue.fromJson(Map json) = _$ChangedRestDurationBeginDateValueImpl.fromJson; @override RestDuration get beforeRestDuration; @@ -3279,13 +2602,10 @@ abstract class _ChangedRestDurationBeginDateValue RestDuration get afterRestDuration; @override @JsonKey(ignore: true) - _$$ChangedRestDurationBeginDateValueImplCopyWith< - _$ChangedRestDurationBeginDateValueImpl> - get copyWith => throw _privateConstructorUsedError; + _$$ChangedRestDurationBeginDateValueImplCopyWith<_$ChangedRestDurationBeginDateValueImpl> get copyWith => throw _privateConstructorUsedError; } -ChangedRestDurationValue _$ChangedRestDurationValueFromJson( - Map json) { +ChangedRestDurationValue _$ChangedRestDurationValueFromJson(Map json) { return _ChangedRestDurationValue.fromJson(json); } @@ -3296,15 +2616,12 @@ mixin _$ChangedRestDurationValue { Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $ChangedRestDurationValueCopyWith get copyWith => - throw _privateConstructorUsedError; + $ChangedRestDurationValueCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChangedRestDurationValueCopyWith<$Res> { - factory $ChangedRestDurationValueCopyWith(ChangedRestDurationValue value, - $Res Function(ChangedRestDurationValue) then) = - _$ChangedRestDurationValueCopyWithImpl<$Res, ChangedRestDurationValue>; + factory $ChangedRestDurationValueCopyWith(ChangedRestDurationValue value, $Res Function(ChangedRestDurationValue) then) = _$ChangedRestDurationValueCopyWithImpl<$Res, ChangedRestDurationValue>; @useResult $Res call({RestDuration beforeRestDuration, RestDuration afterRestDuration}); @@ -3313,9 +2630,7 @@ abstract class $ChangedRestDurationValueCopyWith<$Res> { } /// @nodoc -class _$ChangedRestDurationValueCopyWithImpl<$Res, - $Val extends ChangedRestDurationValue> - implements $ChangedRestDurationValueCopyWith<$Res> { +class _$ChangedRestDurationValueCopyWithImpl<$Res, $Val extends ChangedRestDurationValue> implements $ChangedRestDurationValueCopyWith<$Res> { _$ChangedRestDurationValueCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -3359,12 +2674,8 @@ class _$ChangedRestDurationValueCopyWithImpl<$Res, } /// @nodoc -abstract class _$$ChangedRestDurationValueImplCopyWith<$Res> - implements $ChangedRestDurationValueCopyWith<$Res> { - factory _$$ChangedRestDurationValueImplCopyWith( - _$ChangedRestDurationValueImpl value, - $Res Function(_$ChangedRestDurationValueImpl) then) = - __$$ChangedRestDurationValueImplCopyWithImpl<$Res>; +abstract class _$$ChangedRestDurationValueImplCopyWith<$Res> implements $ChangedRestDurationValueCopyWith<$Res> { + factory _$$ChangedRestDurationValueImplCopyWith(_$ChangedRestDurationValueImpl value, $Res Function(_$ChangedRestDurationValueImpl) then) = __$$ChangedRestDurationValueImplCopyWithImpl<$Res>; @override @useResult $Res call({RestDuration beforeRestDuration, RestDuration afterRestDuration}); @@ -3376,14 +2687,8 @@ abstract class _$$ChangedRestDurationValueImplCopyWith<$Res> } /// @nodoc -class __$$ChangedRestDurationValueImplCopyWithImpl<$Res> - extends _$ChangedRestDurationValueCopyWithImpl<$Res, - _$ChangedRestDurationValueImpl> - implements _$$ChangedRestDurationValueImplCopyWith<$Res> { - __$$ChangedRestDurationValueImplCopyWithImpl( - _$ChangedRestDurationValueImpl _value, - $Res Function(_$ChangedRestDurationValueImpl) _then) - : super(_value, _then); +class __$$ChangedRestDurationValueImplCopyWithImpl<$Res> extends _$ChangedRestDurationValueCopyWithImpl<$Res, _$ChangedRestDurationValueImpl> implements _$$ChangedRestDurationValueImplCopyWith<$Res> { + __$$ChangedRestDurationValueImplCopyWithImpl(_$ChangedRestDurationValueImpl _value, $Res Function(_$ChangedRestDurationValueImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -3408,12 +2713,9 @@ class __$$ChangedRestDurationValueImplCopyWithImpl<$Res> @JsonSerializable(explicitToJson: true) class _$ChangedRestDurationValueImpl extends _ChangedRestDurationValue { - const _$ChangedRestDurationValueImpl( - {required this.beforeRestDuration, required this.afterRestDuration}) - : super._(); + const _$ChangedRestDurationValueImpl({required this.beforeRestDuration, required this.afterRestDuration}) : super._(); - factory _$ChangedRestDurationValueImpl.fromJson(Map json) => - _$$ChangedRestDurationValueImplFromJson(json); + factory _$ChangedRestDurationValueImpl.fromJson(Map json) => _$$ChangedRestDurationValueImplFromJson(json); @override final RestDuration beforeRestDuration; @@ -3430,23 +2732,18 @@ class _$ChangedRestDurationValueImpl extends _ChangedRestDurationValue { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChangedRestDurationValueImpl && - (identical(other.beforeRestDuration, beforeRestDuration) || - other.beforeRestDuration == beforeRestDuration) && - (identical(other.afterRestDuration, afterRestDuration) || - other.afterRestDuration == afterRestDuration)); + (identical(other.beforeRestDuration, beforeRestDuration) || other.beforeRestDuration == beforeRestDuration) && + (identical(other.afterRestDuration, afterRestDuration) || other.afterRestDuration == afterRestDuration)); } @JsonKey(ignore: true) @override - int get hashCode => - Object.hash(runtimeType, beforeRestDuration, afterRestDuration); + int get hashCode => Object.hash(runtimeType, beforeRestDuration, afterRestDuration); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ChangedRestDurationValueImplCopyWith<_$ChangedRestDurationValueImpl> - get copyWith => __$$ChangedRestDurationValueImplCopyWithImpl< - _$ChangedRestDurationValueImpl>(this, _$identity); + _$$ChangedRestDurationValueImplCopyWith<_$ChangedRestDurationValueImpl> get copyWith => __$$ChangedRestDurationValueImplCopyWithImpl<_$ChangedRestDurationValueImpl>(this, _$identity); @override Map toJson() { @@ -3457,14 +2754,10 @@ class _$ChangedRestDurationValueImpl extends _ChangedRestDurationValue { } abstract class _ChangedRestDurationValue extends ChangedRestDurationValue { - const factory _ChangedRestDurationValue( - {required final RestDuration beforeRestDuration, - required final RestDuration afterRestDuration}) = - _$ChangedRestDurationValueImpl; + const factory _ChangedRestDurationValue({required final RestDuration beforeRestDuration, required final RestDuration afterRestDuration}) = _$ChangedRestDurationValueImpl; const _ChangedRestDurationValue._() : super._(); - factory _ChangedRestDurationValue.fromJson(Map json) = - _$ChangedRestDurationValueImpl.fromJson; + factory _ChangedRestDurationValue.fromJson(Map json) = _$ChangedRestDurationValueImpl.fromJson; @override RestDuration get beforeRestDuration; @@ -3472,12 +2765,10 @@ abstract class _ChangedRestDurationValue extends ChangedRestDurationValue { RestDuration get afterRestDuration; @override @JsonKey(ignore: true) - _$$ChangedRestDurationValueImplCopyWith<_$ChangedRestDurationValueImpl> - get copyWith => throw _privateConstructorUsedError; + _$$ChangedRestDurationValueImplCopyWith<_$ChangedRestDurationValueImpl> get copyWith => throw _privateConstructorUsedError; } -ChangedBeginDisplayNumberValue _$ChangedBeginDisplayNumberValueFromJson( - Map json) { +ChangedBeginDisplayNumberValue _$ChangedBeginDisplayNumberValueFromJson(Map json) { return _ChangedBeginDisplayNumberValue.fromJson(json); } @@ -3486,39 +2777,27 @@ mixin _$ChangedBeginDisplayNumberValue { // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 // 番号を変更した事が無い場合もあるのでnullable - PillSheetGroupDisplayNumberSetting? get beforeDisplayNumberSetting => - throw _privateConstructorUsedError; - PillSheetGroupDisplayNumberSetting get afterDisplayNumberSetting => - throw _privateConstructorUsedError; + PillSheetGroupDisplayNumberSetting? get beforeDisplayNumberSetting => throw _privateConstructorUsedError; + PillSheetGroupDisplayNumberSetting get afterDisplayNumberSetting => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $ChangedBeginDisplayNumberValueCopyWith - get copyWith => throw _privateConstructorUsedError; + $ChangedBeginDisplayNumberValueCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChangedBeginDisplayNumberValueCopyWith<$Res> { - factory $ChangedBeginDisplayNumberValueCopyWith( - ChangedBeginDisplayNumberValue value, - $Res Function(ChangedBeginDisplayNumberValue) then) = - _$ChangedBeginDisplayNumberValueCopyWithImpl<$Res, - ChangedBeginDisplayNumberValue>; + factory $ChangedBeginDisplayNumberValueCopyWith(ChangedBeginDisplayNumberValue value, $Res Function(ChangedBeginDisplayNumberValue) then) = + _$ChangedBeginDisplayNumberValueCopyWithImpl<$Res, ChangedBeginDisplayNumberValue>; @useResult - $Res call( - {PillSheetGroupDisplayNumberSetting? beforeDisplayNumberSetting, - PillSheetGroupDisplayNumberSetting afterDisplayNumberSetting}); + $Res call({PillSheetGroupDisplayNumberSetting? beforeDisplayNumberSetting, PillSheetGroupDisplayNumberSetting afterDisplayNumberSetting}); - $PillSheetGroupDisplayNumberSettingCopyWith<$Res>? - get beforeDisplayNumberSetting; - $PillSheetGroupDisplayNumberSettingCopyWith<$Res> - get afterDisplayNumberSetting; + $PillSheetGroupDisplayNumberSettingCopyWith<$Res>? get beforeDisplayNumberSetting; + $PillSheetGroupDisplayNumberSettingCopyWith<$Res> get afterDisplayNumberSetting; } /// @nodoc -class _$ChangedBeginDisplayNumberValueCopyWithImpl<$Res, - $Val extends ChangedBeginDisplayNumberValue> - implements $ChangedBeginDisplayNumberValueCopyWith<$Res> { +class _$ChangedBeginDisplayNumberValueCopyWithImpl<$Res, $Val extends ChangedBeginDisplayNumberValue> implements $ChangedBeginDisplayNumberValueCopyWith<$Res> { _$ChangedBeginDisplayNumberValueCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -3546,59 +2825,43 @@ class _$ChangedBeginDisplayNumberValueCopyWithImpl<$Res, @override @pragma('vm:prefer-inline') - $PillSheetGroupDisplayNumberSettingCopyWith<$Res>? - get beforeDisplayNumberSetting { + $PillSheetGroupDisplayNumberSettingCopyWith<$Res>? get beforeDisplayNumberSetting { if (_value.beforeDisplayNumberSetting == null) { return null; } - return $PillSheetGroupDisplayNumberSettingCopyWith<$Res>( - _value.beforeDisplayNumberSetting!, (value) { + return $PillSheetGroupDisplayNumberSettingCopyWith<$Res>(_value.beforeDisplayNumberSetting!, (value) { return _then(_value.copyWith(beforeDisplayNumberSetting: value) as $Val); }); } @override @pragma('vm:prefer-inline') - $PillSheetGroupDisplayNumberSettingCopyWith<$Res> - get afterDisplayNumberSetting { - return $PillSheetGroupDisplayNumberSettingCopyWith<$Res>( - _value.afterDisplayNumberSetting, (value) { + $PillSheetGroupDisplayNumberSettingCopyWith<$Res> get afterDisplayNumberSetting { + return $PillSheetGroupDisplayNumberSettingCopyWith<$Res>(_value.afterDisplayNumberSetting, (value) { return _then(_value.copyWith(afterDisplayNumberSetting: value) as $Val); }); } } /// @nodoc -abstract class _$$ChangedBeginDisplayNumberValueImplCopyWith<$Res> - implements $ChangedBeginDisplayNumberValueCopyWith<$Res> { - factory _$$ChangedBeginDisplayNumberValueImplCopyWith( - _$ChangedBeginDisplayNumberValueImpl value, - $Res Function(_$ChangedBeginDisplayNumberValueImpl) then) = +abstract class _$$ChangedBeginDisplayNumberValueImplCopyWith<$Res> implements $ChangedBeginDisplayNumberValueCopyWith<$Res> { + factory _$$ChangedBeginDisplayNumberValueImplCopyWith(_$ChangedBeginDisplayNumberValueImpl value, $Res Function(_$ChangedBeginDisplayNumberValueImpl) then) = __$$ChangedBeginDisplayNumberValueImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {PillSheetGroupDisplayNumberSetting? beforeDisplayNumberSetting, - PillSheetGroupDisplayNumberSetting afterDisplayNumberSetting}); + $Res call({PillSheetGroupDisplayNumberSetting? beforeDisplayNumberSetting, PillSheetGroupDisplayNumberSetting afterDisplayNumberSetting}); @override - $PillSheetGroupDisplayNumberSettingCopyWith<$Res>? - get beforeDisplayNumberSetting; + $PillSheetGroupDisplayNumberSettingCopyWith<$Res>? get beforeDisplayNumberSetting; @override - $PillSheetGroupDisplayNumberSettingCopyWith<$Res> - get afterDisplayNumberSetting; + $PillSheetGroupDisplayNumberSettingCopyWith<$Res> get afterDisplayNumberSetting; } /// @nodoc -class __$$ChangedBeginDisplayNumberValueImplCopyWithImpl<$Res> - extends _$ChangedBeginDisplayNumberValueCopyWithImpl<$Res, - _$ChangedBeginDisplayNumberValueImpl> +class __$$ChangedBeginDisplayNumberValueImplCopyWithImpl<$Res> extends _$ChangedBeginDisplayNumberValueCopyWithImpl<$Res, _$ChangedBeginDisplayNumberValueImpl> implements _$$ChangedBeginDisplayNumberValueImplCopyWith<$Res> { - __$$ChangedBeginDisplayNumberValueImplCopyWithImpl( - _$ChangedBeginDisplayNumberValueImpl _value, - $Res Function(_$ChangedBeginDisplayNumberValueImpl) _then) - : super(_value, _then); + __$$ChangedBeginDisplayNumberValueImplCopyWithImpl(_$ChangedBeginDisplayNumberValueImpl _value, $Res Function(_$ChangedBeginDisplayNumberValueImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -3622,16 +2885,10 @@ class __$$ChangedBeginDisplayNumberValueImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable(explicitToJson: true) -class _$ChangedBeginDisplayNumberValueImpl - extends _ChangedBeginDisplayNumberValue { - const _$ChangedBeginDisplayNumberValueImpl( - {required this.beforeDisplayNumberSetting, - required this.afterDisplayNumberSetting}) - : super._(); +class _$ChangedBeginDisplayNumberValueImpl extends _ChangedBeginDisplayNumberValue { + const _$ChangedBeginDisplayNumberValueImpl({required this.beforeDisplayNumberSetting, required this.afterDisplayNumberSetting}) : super._(); - factory _$ChangedBeginDisplayNumberValueImpl.fromJson( - Map json) => - _$$ChangedBeginDisplayNumberValueImplFromJson(json); + factory _$ChangedBeginDisplayNumberValueImpl.fromJson(Map json) => _$$ChangedBeginDisplayNumberValueImplFromJson(json); // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 @@ -3651,27 +2908,19 @@ class _$ChangedBeginDisplayNumberValueImpl return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChangedBeginDisplayNumberValueImpl && - (identical(other.beforeDisplayNumberSetting, - beforeDisplayNumberSetting) || - other.beforeDisplayNumberSetting == - beforeDisplayNumberSetting) && - (identical(other.afterDisplayNumberSetting, - afterDisplayNumberSetting) || - other.afterDisplayNumberSetting == afterDisplayNumberSetting)); + (identical(other.beforeDisplayNumberSetting, beforeDisplayNumberSetting) || other.beforeDisplayNumberSetting == beforeDisplayNumberSetting) && + (identical(other.afterDisplayNumberSetting, afterDisplayNumberSetting) || other.afterDisplayNumberSetting == afterDisplayNumberSetting)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, beforeDisplayNumberSetting, afterDisplayNumberSetting); + int get hashCode => Object.hash(runtimeType, beforeDisplayNumberSetting, afterDisplayNumberSetting); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ChangedBeginDisplayNumberValueImplCopyWith< - _$ChangedBeginDisplayNumberValueImpl> - get copyWith => __$$ChangedBeginDisplayNumberValueImplCopyWithImpl< - _$ChangedBeginDisplayNumberValueImpl>(this, _$identity); + _$$ChangedBeginDisplayNumberValueImplCopyWith<_$ChangedBeginDisplayNumberValueImpl> get copyWith => + __$$ChangedBeginDisplayNumberValueImplCopyWithImpl<_$ChangedBeginDisplayNumberValueImpl>(this, _$identity); @override Map toJson() { @@ -3681,17 +2930,13 @@ class _$ChangedBeginDisplayNumberValueImpl } } -abstract class _ChangedBeginDisplayNumberValue - extends ChangedBeginDisplayNumberValue { +abstract class _ChangedBeginDisplayNumberValue extends ChangedBeginDisplayNumberValue { const factory _ChangedBeginDisplayNumberValue( - {required final PillSheetGroupDisplayNumberSetting? - beforeDisplayNumberSetting, - required final PillSheetGroupDisplayNumberSetting - afterDisplayNumberSetting}) = _$ChangedBeginDisplayNumberValueImpl; + {required final PillSheetGroupDisplayNumberSetting? beforeDisplayNumberSetting, + required final PillSheetGroupDisplayNumberSetting afterDisplayNumberSetting}) = _$ChangedBeginDisplayNumberValueImpl; const _ChangedBeginDisplayNumberValue._() : super._(); - factory _ChangedBeginDisplayNumberValue.fromJson(Map json) = - _$ChangedBeginDisplayNumberValueImpl.fromJson; + factory _ChangedBeginDisplayNumberValue.fromJson(Map json) = _$ChangedBeginDisplayNumberValueImpl.fromJson; @override // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 @@ -3701,13 +2946,10 @@ abstract class _ChangedBeginDisplayNumberValue PillSheetGroupDisplayNumberSetting get afterDisplayNumberSetting; @override @JsonKey(ignore: true) - _$$ChangedBeginDisplayNumberValueImplCopyWith< - _$ChangedBeginDisplayNumberValueImpl> - get copyWith => throw _privateConstructorUsedError; + _$$ChangedBeginDisplayNumberValueImplCopyWith<_$ChangedBeginDisplayNumberValueImpl> get copyWith => throw _privateConstructorUsedError; } -ChangedEndDisplayNumberValue _$ChangedEndDisplayNumberValueFromJson( - Map json) { +ChangedEndDisplayNumberValue _$ChangedEndDisplayNumberValueFromJson(Map json) { return _ChangedEndDisplayNumberValue.fromJson(json); } @@ -3716,39 +2958,27 @@ mixin _$ChangedEndDisplayNumberValue { // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 // 番号を変更した事が無い場合もあるのでnullable - PillSheetGroupDisplayNumberSetting? get beforeDisplayNumberSetting => - throw _privateConstructorUsedError; - PillSheetGroupDisplayNumberSetting get afterDisplayNumberSetting => - throw _privateConstructorUsedError; + PillSheetGroupDisplayNumberSetting? get beforeDisplayNumberSetting => throw _privateConstructorUsedError; + PillSheetGroupDisplayNumberSetting get afterDisplayNumberSetting => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $ChangedEndDisplayNumberValueCopyWith - get copyWith => throw _privateConstructorUsedError; + $ChangedEndDisplayNumberValueCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ChangedEndDisplayNumberValueCopyWith<$Res> { - factory $ChangedEndDisplayNumberValueCopyWith( - ChangedEndDisplayNumberValue value, - $Res Function(ChangedEndDisplayNumberValue) then) = - _$ChangedEndDisplayNumberValueCopyWithImpl<$Res, - ChangedEndDisplayNumberValue>; + factory $ChangedEndDisplayNumberValueCopyWith(ChangedEndDisplayNumberValue value, $Res Function(ChangedEndDisplayNumberValue) then) = + _$ChangedEndDisplayNumberValueCopyWithImpl<$Res, ChangedEndDisplayNumberValue>; @useResult - $Res call( - {PillSheetGroupDisplayNumberSetting? beforeDisplayNumberSetting, - PillSheetGroupDisplayNumberSetting afterDisplayNumberSetting}); + $Res call({PillSheetGroupDisplayNumberSetting? beforeDisplayNumberSetting, PillSheetGroupDisplayNumberSetting afterDisplayNumberSetting}); - $PillSheetGroupDisplayNumberSettingCopyWith<$Res>? - get beforeDisplayNumberSetting; - $PillSheetGroupDisplayNumberSettingCopyWith<$Res> - get afterDisplayNumberSetting; + $PillSheetGroupDisplayNumberSettingCopyWith<$Res>? get beforeDisplayNumberSetting; + $PillSheetGroupDisplayNumberSettingCopyWith<$Res> get afterDisplayNumberSetting; } /// @nodoc -class _$ChangedEndDisplayNumberValueCopyWithImpl<$Res, - $Val extends ChangedEndDisplayNumberValue> - implements $ChangedEndDisplayNumberValueCopyWith<$Res> { +class _$ChangedEndDisplayNumberValueCopyWithImpl<$Res, $Val extends ChangedEndDisplayNumberValue> implements $ChangedEndDisplayNumberValueCopyWith<$Res> { _$ChangedEndDisplayNumberValueCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -3776,59 +3006,43 @@ class _$ChangedEndDisplayNumberValueCopyWithImpl<$Res, @override @pragma('vm:prefer-inline') - $PillSheetGroupDisplayNumberSettingCopyWith<$Res>? - get beforeDisplayNumberSetting { + $PillSheetGroupDisplayNumberSettingCopyWith<$Res>? get beforeDisplayNumberSetting { if (_value.beforeDisplayNumberSetting == null) { return null; } - return $PillSheetGroupDisplayNumberSettingCopyWith<$Res>( - _value.beforeDisplayNumberSetting!, (value) { + return $PillSheetGroupDisplayNumberSettingCopyWith<$Res>(_value.beforeDisplayNumberSetting!, (value) { return _then(_value.copyWith(beforeDisplayNumberSetting: value) as $Val); }); } @override @pragma('vm:prefer-inline') - $PillSheetGroupDisplayNumberSettingCopyWith<$Res> - get afterDisplayNumberSetting { - return $PillSheetGroupDisplayNumberSettingCopyWith<$Res>( - _value.afterDisplayNumberSetting, (value) { + $PillSheetGroupDisplayNumberSettingCopyWith<$Res> get afterDisplayNumberSetting { + return $PillSheetGroupDisplayNumberSettingCopyWith<$Res>(_value.afterDisplayNumberSetting, (value) { return _then(_value.copyWith(afterDisplayNumberSetting: value) as $Val); }); } } /// @nodoc -abstract class _$$ChangedEndDisplayNumberValueImplCopyWith<$Res> - implements $ChangedEndDisplayNumberValueCopyWith<$Res> { - factory _$$ChangedEndDisplayNumberValueImplCopyWith( - _$ChangedEndDisplayNumberValueImpl value, - $Res Function(_$ChangedEndDisplayNumberValueImpl) then) = +abstract class _$$ChangedEndDisplayNumberValueImplCopyWith<$Res> implements $ChangedEndDisplayNumberValueCopyWith<$Res> { + factory _$$ChangedEndDisplayNumberValueImplCopyWith(_$ChangedEndDisplayNumberValueImpl value, $Res Function(_$ChangedEndDisplayNumberValueImpl) then) = __$$ChangedEndDisplayNumberValueImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {PillSheetGroupDisplayNumberSetting? beforeDisplayNumberSetting, - PillSheetGroupDisplayNumberSetting afterDisplayNumberSetting}); + $Res call({PillSheetGroupDisplayNumberSetting? beforeDisplayNumberSetting, PillSheetGroupDisplayNumberSetting afterDisplayNumberSetting}); @override - $PillSheetGroupDisplayNumberSettingCopyWith<$Res>? - get beforeDisplayNumberSetting; + $PillSheetGroupDisplayNumberSettingCopyWith<$Res>? get beforeDisplayNumberSetting; @override - $PillSheetGroupDisplayNumberSettingCopyWith<$Res> - get afterDisplayNumberSetting; + $PillSheetGroupDisplayNumberSettingCopyWith<$Res> get afterDisplayNumberSetting; } /// @nodoc -class __$$ChangedEndDisplayNumberValueImplCopyWithImpl<$Res> - extends _$ChangedEndDisplayNumberValueCopyWithImpl<$Res, - _$ChangedEndDisplayNumberValueImpl> +class __$$ChangedEndDisplayNumberValueImplCopyWithImpl<$Res> extends _$ChangedEndDisplayNumberValueCopyWithImpl<$Res, _$ChangedEndDisplayNumberValueImpl> implements _$$ChangedEndDisplayNumberValueImplCopyWith<$Res> { - __$$ChangedEndDisplayNumberValueImplCopyWithImpl( - _$ChangedEndDisplayNumberValueImpl _value, - $Res Function(_$ChangedEndDisplayNumberValueImpl) _then) - : super(_value, _then); + __$$ChangedEndDisplayNumberValueImplCopyWithImpl(_$ChangedEndDisplayNumberValueImpl _value, $Res Function(_$ChangedEndDisplayNumberValueImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -3853,14 +3067,9 @@ class __$$ChangedEndDisplayNumberValueImplCopyWithImpl<$Res> @JsonSerializable(explicitToJson: true) class _$ChangedEndDisplayNumberValueImpl extends _ChangedEndDisplayNumberValue { - const _$ChangedEndDisplayNumberValueImpl( - {required this.beforeDisplayNumberSetting, - required this.afterDisplayNumberSetting}) - : super._(); + const _$ChangedEndDisplayNumberValueImpl({required this.beforeDisplayNumberSetting, required this.afterDisplayNumberSetting}) : super._(); - factory _$ChangedEndDisplayNumberValueImpl.fromJson( - Map json) => - _$$ChangedEndDisplayNumberValueImplFromJson(json); + factory _$ChangedEndDisplayNumberValueImpl.fromJson(Map json) => _$$ChangedEndDisplayNumberValueImplFromJson(json); // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 @@ -3880,27 +3089,19 @@ class _$ChangedEndDisplayNumberValueImpl extends _ChangedEndDisplayNumberValue { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ChangedEndDisplayNumberValueImpl && - (identical(other.beforeDisplayNumberSetting, - beforeDisplayNumberSetting) || - other.beforeDisplayNumberSetting == - beforeDisplayNumberSetting) && - (identical(other.afterDisplayNumberSetting, - afterDisplayNumberSetting) || - other.afterDisplayNumberSetting == afterDisplayNumberSetting)); + (identical(other.beforeDisplayNumberSetting, beforeDisplayNumberSetting) || other.beforeDisplayNumberSetting == beforeDisplayNumberSetting) && + (identical(other.afterDisplayNumberSetting, afterDisplayNumberSetting) || other.afterDisplayNumberSetting == afterDisplayNumberSetting)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, beforeDisplayNumberSetting, afterDisplayNumberSetting); + int get hashCode => Object.hash(runtimeType, beforeDisplayNumberSetting, afterDisplayNumberSetting); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ChangedEndDisplayNumberValueImplCopyWith< - _$ChangedEndDisplayNumberValueImpl> - get copyWith => __$$ChangedEndDisplayNumberValueImplCopyWithImpl< - _$ChangedEndDisplayNumberValueImpl>(this, _$identity); + _$$ChangedEndDisplayNumberValueImplCopyWith<_$ChangedEndDisplayNumberValueImpl> get copyWith => + __$$ChangedEndDisplayNumberValueImplCopyWithImpl<_$ChangedEndDisplayNumberValueImpl>(this, _$identity); @override Map toJson() { @@ -3910,17 +3111,13 @@ class _$ChangedEndDisplayNumberValueImpl extends _ChangedEndDisplayNumberValue { } } -abstract class _ChangedEndDisplayNumberValue - extends ChangedEndDisplayNumberValue { +abstract class _ChangedEndDisplayNumberValue extends ChangedEndDisplayNumberValue { const factory _ChangedEndDisplayNumberValue( - {required final PillSheetGroupDisplayNumberSetting? - beforeDisplayNumberSetting, - required final PillSheetGroupDisplayNumberSetting - afterDisplayNumberSetting}) = _$ChangedEndDisplayNumberValueImpl; + {required final PillSheetGroupDisplayNumberSetting? beforeDisplayNumberSetting, + required final PillSheetGroupDisplayNumberSetting afterDisplayNumberSetting}) = _$ChangedEndDisplayNumberValueImpl; const _ChangedEndDisplayNumberValue._() : super._(); - factory _ChangedEndDisplayNumberValue.fromJson(Map json) = - _$ChangedEndDisplayNumberValueImpl.fromJson; + factory _ChangedEndDisplayNumberValue.fromJson(Map json) = _$ChangedEndDisplayNumberValueImpl.fromJson; @override // The below properties are deprecated and added since v1. // This is deprecated property. TODO: [PillSheetModifiedHistory-V2] delete after 2024-05-01 @@ -3930,7 +3127,5 @@ abstract class _ChangedEndDisplayNumberValue PillSheetGroupDisplayNumberSetting get afterDisplayNumberSetting; @override @JsonKey(ignore: true) - _$$ChangedEndDisplayNumberValueImplCopyWith< - _$ChangedEndDisplayNumberValueImpl> - get copyWith => throw _privateConstructorUsedError; + _$$ChangedEndDisplayNumberValueImplCopyWith<_$ChangedEndDisplayNumberValueImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/entity/pill_sheet_modified_history_value.codegen.g.dart b/lib/entity/pill_sheet_modified_history_value.codegen.g.dart index 3d0f293624..df673abc72 100644 --- a/lib/entity/pill_sheet_modified_history_value.codegen.g.dart +++ b/lib/entity/pill_sheet_modified_history_value.codegen.g.dart @@ -6,73 +6,27 @@ part of 'pill_sheet_modified_history_value.codegen.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PillSheetModifiedHistoryValueImpl - _$$PillSheetModifiedHistoryValueImplFromJson(Map json) => - _$PillSheetModifiedHistoryValueImpl( - createdPillSheet: json['createdPillSheet'] == null - ? null - : CreatedPillSheetValue.fromJson( - json['createdPillSheet'] as Map), - automaticallyRecordedLastTakenDate: - json['automaticallyRecordedLastTakenDate'] == null - ? null - : AutomaticallyRecordedLastTakenDateValue.fromJson( - json['automaticallyRecordedLastTakenDate'] - as Map), - deletedPillSheet: json['deletedPillSheet'] == null - ? null - : DeletedPillSheetValue.fromJson( - json['deletedPillSheet'] as Map), - takenPill: json['takenPill'] == null - ? null - : TakenPillValue.fromJson( - json['takenPill'] as Map), - revertTakenPill: json['revertTakenPill'] == null - ? null - : RevertTakenPillValue.fromJson( - json['revertTakenPill'] as Map), - changedPillNumber: json['changedPillNumber'] == null - ? null - : ChangedPillNumberValue.fromJson( - json['changedPillNumber'] as Map), - endedPillSheet: json['endedPillSheet'] == null - ? null - : EndedPillSheetValue.fromJson( - json['endedPillSheet'] as Map), - beganRestDurationValue: json['beganRestDurationValue'] == null - ? null - : BeganRestDurationValue.fromJson( - json['beganRestDurationValue'] as Map), - endedRestDurationValue: json['endedRestDurationValue'] == null - ? null - : EndedRestDurationValue.fromJson( - json['endedRestDurationValue'] as Map), - changedRestDurationBeginDateValue: - json['changedRestDurationBeginDateValue'] == null - ? null - : ChangedRestDurationBeginDateValue.fromJson( - json['changedRestDurationBeginDateValue'] - as Map), - changedRestDurationValue: json['changedRestDurationValue'] == null - ? null - : ChangedRestDurationValue.fromJson( - json['changedRestDurationValue'] as Map), - changedBeginDisplayNumber: json['changedBeginDisplayNumber'] == null - ? null - : ChangedBeginDisplayNumberValue.fromJson( - json['changedBeginDisplayNumber'] as Map), - changedEndDisplayNumber: json['changedEndDisplayNumber'] == null - ? null - : ChangedEndDisplayNumberValue.fromJson( - json['changedEndDisplayNumber'] as Map), - ); - -Map _$$PillSheetModifiedHistoryValueImplToJson( - _$PillSheetModifiedHistoryValueImpl instance) => - { +_$PillSheetModifiedHistoryValueImpl _$$PillSheetModifiedHistoryValueImplFromJson(Map json) => _$PillSheetModifiedHistoryValueImpl( + createdPillSheet: json['createdPillSheet'] == null ? null : CreatedPillSheetValue.fromJson(json['createdPillSheet'] as Map), + automaticallyRecordedLastTakenDate: + json['automaticallyRecordedLastTakenDate'] == null ? null : AutomaticallyRecordedLastTakenDateValue.fromJson(json['automaticallyRecordedLastTakenDate'] as Map), + deletedPillSheet: json['deletedPillSheet'] == null ? null : DeletedPillSheetValue.fromJson(json['deletedPillSheet'] as Map), + takenPill: json['takenPill'] == null ? null : TakenPillValue.fromJson(json['takenPill'] as Map), + revertTakenPill: json['revertTakenPill'] == null ? null : RevertTakenPillValue.fromJson(json['revertTakenPill'] as Map), + changedPillNumber: json['changedPillNumber'] == null ? null : ChangedPillNumberValue.fromJson(json['changedPillNumber'] as Map), + endedPillSheet: json['endedPillSheet'] == null ? null : EndedPillSheetValue.fromJson(json['endedPillSheet'] as Map), + beganRestDurationValue: json['beganRestDurationValue'] == null ? null : BeganRestDurationValue.fromJson(json['beganRestDurationValue'] as Map), + endedRestDurationValue: json['endedRestDurationValue'] == null ? null : EndedRestDurationValue.fromJson(json['endedRestDurationValue'] as Map), + changedRestDurationBeginDateValue: + json['changedRestDurationBeginDateValue'] == null ? null : ChangedRestDurationBeginDateValue.fromJson(json['changedRestDurationBeginDateValue'] as Map), + changedRestDurationValue: json['changedRestDurationValue'] == null ? null : ChangedRestDurationValue.fromJson(json['changedRestDurationValue'] as Map), + changedBeginDisplayNumber: json['changedBeginDisplayNumber'] == null ? null : ChangedBeginDisplayNumberValue.fromJson(json['changedBeginDisplayNumber'] as Map), + changedEndDisplayNumber: json['changedEndDisplayNumber'] == null ? null : ChangedEndDisplayNumberValue.fromJson(json['changedEndDisplayNumber'] as Map), + ); + +Map _$$PillSheetModifiedHistoryValueImplToJson(_$PillSheetModifiedHistoryValueImpl instance) => { 'createdPillSheet': instance.createdPillSheet?.toJson(), - 'automaticallyRecordedLastTakenDate': - instance.automaticallyRecordedLastTakenDate?.toJson(), + 'automaticallyRecordedLastTakenDate': instance.automaticallyRecordedLastTakenDate?.toJson(), 'deletedPillSheet': instance.deletedPillSheet?.toJson(), 'takenPill': instance.takenPill?.toJson(), 'revertTakenPill': instance.revertTakenPill?.toJson(), @@ -80,290 +34,170 @@ Map _$$PillSheetModifiedHistoryValueImplToJson( 'endedPillSheet': instance.endedPillSheet?.toJson(), 'beganRestDurationValue': instance.beganRestDurationValue?.toJson(), 'endedRestDurationValue': instance.endedRestDurationValue?.toJson(), - 'changedRestDurationBeginDateValue': - instance.changedRestDurationBeginDateValue?.toJson(), + 'changedRestDurationBeginDateValue': instance.changedRestDurationBeginDateValue?.toJson(), 'changedRestDurationValue': instance.changedRestDurationValue?.toJson(), 'changedBeginDisplayNumber': instance.changedBeginDisplayNumber?.toJson(), 'changedEndDisplayNumber': instance.changedEndDisplayNumber?.toJson(), }; -_$CreatedPillSheetValueImpl _$$CreatedPillSheetValueImplFromJson( - Map json) => - _$CreatedPillSheetValueImpl( - pillSheetCreatedAt: NonNullTimestampConverter.timestampToDateTime( - json['pillSheetCreatedAt'] as Timestamp), - pillSheetIDs: (json['pillSheetIDs'] as List?) - ?.map((e) => e as String) - .toList() ?? - const [], +_$CreatedPillSheetValueImpl _$$CreatedPillSheetValueImplFromJson(Map json) => _$CreatedPillSheetValueImpl( + pillSheetCreatedAt: NonNullTimestampConverter.timestampToDateTime(json['pillSheetCreatedAt'] as Timestamp), + pillSheetIDs: (json['pillSheetIDs'] as List?)?.map((e) => e as String).toList() ?? const [], ); -Map _$$CreatedPillSheetValueImplToJson( - _$CreatedPillSheetValueImpl instance) => - { - 'pillSheetCreatedAt': NonNullTimestampConverter.dateTimeToTimestamp( - instance.pillSheetCreatedAt), +Map _$$CreatedPillSheetValueImplToJson(_$CreatedPillSheetValueImpl instance) => { + 'pillSheetCreatedAt': NonNullTimestampConverter.dateTimeToTimestamp(instance.pillSheetCreatedAt), 'pillSheetIDs': instance.pillSheetIDs, }; -_$AutomaticallyRecordedLastTakenDateValueImpl - _$$AutomaticallyRecordedLastTakenDateValueImplFromJson( - Map json) => - _$AutomaticallyRecordedLastTakenDateValueImpl( - beforeLastTakenDate: TimestampConverter.timestampToDateTime( - json['beforeLastTakenDate'] as Timestamp?), - afterLastTakenDate: NonNullTimestampConverter.timestampToDateTime( - json['afterLastTakenDate'] as Timestamp), - beforeLastTakenPillNumber: - (json['beforeLastTakenPillNumber'] as num).toInt(), - afterLastTakenPillNumber: - (json['afterLastTakenPillNumber'] as num).toInt(), - ); - -Map _$$AutomaticallyRecordedLastTakenDateValueImplToJson( - _$AutomaticallyRecordedLastTakenDateValueImpl instance) => - { - 'beforeLastTakenDate': - TimestampConverter.dateTimeToTimestamp(instance.beforeLastTakenDate), - 'afterLastTakenDate': NonNullTimestampConverter.dateTimeToTimestamp( - instance.afterLastTakenDate), +_$AutomaticallyRecordedLastTakenDateValueImpl _$$AutomaticallyRecordedLastTakenDateValueImplFromJson(Map json) => _$AutomaticallyRecordedLastTakenDateValueImpl( + beforeLastTakenDate: TimestampConverter.timestampToDateTime(json['beforeLastTakenDate'] as Timestamp?), + afterLastTakenDate: NonNullTimestampConverter.timestampToDateTime(json['afterLastTakenDate'] as Timestamp), + beforeLastTakenPillNumber: (json['beforeLastTakenPillNumber'] as num).toInt(), + afterLastTakenPillNumber: (json['afterLastTakenPillNumber'] as num).toInt(), + ); + +Map _$$AutomaticallyRecordedLastTakenDateValueImplToJson(_$AutomaticallyRecordedLastTakenDateValueImpl instance) => { + 'beforeLastTakenDate': TimestampConverter.dateTimeToTimestamp(instance.beforeLastTakenDate), + 'afterLastTakenDate': NonNullTimestampConverter.dateTimeToTimestamp(instance.afterLastTakenDate), 'beforeLastTakenPillNumber': instance.beforeLastTakenPillNumber, 'afterLastTakenPillNumber': instance.afterLastTakenPillNumber, }; -_$DeletedPillSheetValueImpl _$$DeletedPillSheetValueImplFromJson( - Map json) => - _$DeletedPillSheetValueImpl( - pillSheetDeletedAt: NonNullTimestampConverter.timestampToDateTime( - json['pillSheetDeletedAt'] as Timestamp), - pillSheetIDs: (json['pillSheetIDs'] as List?) - ?.map((e) => e as String) - .toList() ?? - const [], +_$DeletedPillSheetValueImpl _$$DeletedPillSheetValueImplFromJson(Map json) => _$DeletedPillSheetValueImpl( + pillSheetDeletedAt: NonNullTimestampConverter.timestampToDateTime(json['pillSheetDeletedAt'] as Timestamp), + pillSheetIDs: (json['pillSheetIDs'] as List?)?.map((e) => e as String).toList() ?? const [], ); -Map _$$DeletedPillSheetValueImplToJson( - _$DeletedPillSheetValueImpl instance) => - { - 'pillSheetDeletedAt': NonNullTimestampConverter.dateTimeToTimestamp( - instance.pillSheetDeletedAt), +Map _$$DeletedPillSheetValueImplToJson(_$DeletedPillSheetValueImpl instance) => { + 'pillSheetDeletedAt': NonNullTimestampConverter.dateTimeToTimestamp(instance.pillSheetDeletedAt), 'pillSheetIDs': instance.pillSheetIDs, }; -_$TakenPillValueImpl _$$TakenPillValueImplFromJson(Map json) => - _$TakenPillValueImpl( +_$TakenPillValueImpl _$$TakenPillValueImplFromJson(Map json) => _$TakenPillValueImpl( isQuickRecord: json['isQuickRecord'] as bool?, - edited: json['edited'] == null - ? null - : TakenPillEditedValue.fromJson( - json['edited'] as Map), - beforeLastTakenDate: TimestampConverter.timestampToDateTime( - json['beforeLastTakenDate'] as Timestamp?), - afterLastTakenDate: NonNullTimestampConverter.timestampToDateTime( - json['afterLastTakenDate'] as Timestamp), - beforeLastTakenPillNumber: - (json['beforeLastTakenPillNumber'] as num).toInt(), - afterLastTakenPillNumber: - (json['afterLastTakenPillNumber'] as num).toInt(), + edited: json['edited'] == null ? null : TakenPillEditedValue.fromJson(json['edited'] as Map), + beforeLastTakenDate: TimestampConverter.timestampToDateTime(json['beforeLastTakenDate'] as Timestamp?), + afterLastTakenDate: NonNullTimestampConverter.timestampToDateTime(json['afterLastTakenDate'] as Timestamp), + beforeLastTakenPillNumber: (json['beforeLastTakenPillNumber'] as num).toInt(), + afterLastTakenPillNumber: (json['afterLastTakenPillNumber'] as num).toInt(), ); -Map _$$TakenPillValueImplToJson( - _$TakenPillValueImpl instance) => - { +Map _$$TakenPillValueImplToJson(_$TakenPillValueImpl instance) => { 'isQuickRecord': instance.isQuickRecord, 'edited': instance.edited?.toJson(), - 'beforeLastTakenDate': - TimestampConverter.dateTimeToTimestamp(instance.beforeLastTakenDate), - 'afterLastTakenDate': NonNullTimestampConverter.dateTimeToTimestamp( - instance.afterLastTakenDate), + 'beforeLastTakenDate': TimestampConverter.dateTimeToTimestamp(instance.beforeLastTakenDate), + 'afterLastTakenDate': NonNullTimestampConverter.dateTimeToTimestamp(instance.afterLastTakenDate), 'beforeLastTakenPillNumber': instance.beforeLastTakenPillNumber, 'afterLastTakenPillNumber': instance.afterLastTakenPillNumber, }; -_$TakenPillEditedValueImpl _$$TakenPillEditedValueImplFromJson( - Map json) => - _$TakenPillEditedValueImpl( - actualTakenDate: NonNullTimestampConverter.timestampToDateTime( - json['actualTakenDate'] as Timestamp), - historyRecordedDate: NonNullTimestampConverter.timestampToDateTime( - json['historyRecordedDate'] as Timestamp), - createdDate: NonNullTimestampConverter.timestampToDateTime( - json['createdDate'] as Timestamp), +_$TakenPillEditedValueImpl _$$TakenPillEditedValueImplFromJson(Map json) => _$TakenPillEditedValueImpl( + actualTakenDate: NonNullTimestampConverter.timestampToDateTime(json['actualTakenDate'] as Timestamp), + historyRecordedDate: NonNullTimestampConverter.timestampToDateTime(json['historyRecordedDate'] as Timestamp), + createdDate: NonNullTimestampConverter.timestampToDateTime(json['createdDate'] as Timestamp), ); -Map _$$TakenPillEditedValueImplToJson( - _$TakenPillEditedValueImpl instance) => - { - 'actualTakenDate': NonNullTimestampConverter.dateTimeToTimestamp( - instance.actualTakenDate), - 'historyRecordedDate': NonNullTimestampConverter.dateTimeToTimestamp( - instance.historyRecordedDate), - 'createdDate': - NonNullTimestampConverter.dateTimeToTimestamp(instance.createdDate), +Map _$$TakenPillEditedValueImplToJson(_$TakenPillEditedValueImpl instance) => { + 'actualTakenDate': NonNullTimestampConverter.dateTimeToTimestamp(instance.actualTakenDate), + 'historyRecordedDate': NonNullTimestampConverter.dateTimeToTimestamp(instance.historyRecordedDate), + 'createdDate': NonNullTimestampConverter.dateTimeToTimestamp(instance.createdDate), }; -_$RevertTakenPillValueImpl _$$RevertTakenPillValueImplFromJson( - Map json) => - _$RevertTakenPillValueImpl( - beforeLastTakenDate: TimestampConverter.timestampToDateTime( - json['beforeLastTakenDate'] as Timestamp?), - afterLastTakenDate: NonNullTimestampConverter.timestampToDateTime( - json['afterLastTakenDate'] as Timestamp), - beforeLastTakenPillNumber: - (json['beforeLastTakenPillNumber'] as num).toInt(), - afterLastTakenPillNumber: - (json['afterLastTakenPillNumber'] as num).toInt(), +_$RevertTakenPillValueImpl _$$RevertTakenPillValueImplFromJson(Map json) => _$RevertTakenPillValueImpl( + beforeLastTakenDate: TimestampConverter.timestampToDateTime(json['beforeLastTakenDate'] as Timestamp?), + afterLastTakenDate: NonNullTimestampConverter.timestampToDateTime(json['afterLastTakenDate'] as Timestamp), + beforeLastTakenPillNumber: (json['beforeLastTakenPillNumber'] as num).toInt(), + afterLastTakenPillNumber: (json['afterLastTakenPillNumber'] as num).toInt(), ); -Map _$$RevertTakenPillValueImplToJson( - _$RevertTakenPillValueImpl instance) => - { - 'beforeLastTakenDate': - TimestampConverter.dateTimeToTimestamp(instance.beforeLastTakenDate), - 'afterLastTakenDate': NonNullTimestampConverter.dateTimeToTimestamp( - instance.afterLastTakenDate), +Map _$$RevertTakenPillValueImplToJson(_$RevertTakenPillValueImpl instance) => { + 'beforeLastTakenDate': TimestampConverter.dateTimeToTimestamp(instance.beforeLastTakenDate), + 'afterLastTakenDate': NonNullTimestampConverter.dateTimeToTimestamp(instance.afterLastTakenDate), 'beforeLastTakenPillNumber': instance.beforeLastTakenPillNumber, 'afterLastTakenPillNumber': instance.afterLastTakenPillNumber, }; -_$ChangedPillNumberValueImpl _$$ChangedPillNumberValueImplFromJson( - Map json) => - _$ChangedPillNumberValueImpl( - beforeBeginingDate: NonNullTimestampConverter.timestampToDateTime( - json['beforeBeginingDate'] as Timestamp), - afterBeginingDate: NonNullTimestampConverter.timestampToDateTime( - json['afterBeginingDate'] as Timestamp), +_$ChangedPillNumberValueImpl _$$ChangedPillNumberValueImplFromJson(Map json) => _$ChangedPillNumberValueImpl( + beforeBeginingDate: NonNullTimestampConverter.timestampToDateTime(json['beforeBeginingDate'] as Timestamp), + afterBeginingDate: NonNullTimestampConverter.timestampToDateTime(json['afterBeginingDate'] as Timestamp), beforeTodayPillNumber: (json['beforeTodayPillNumber'] as num).toInt(), afterTodayPillNumber: (json['afterTodayPillNumber'] as num).toInt(), beforeGroupIndex: (json['beforeGroupIndex'] as num?)?.toInt() ?? 1, afterGroupIndex: (json['afterGroupIndex'] as num?)?.toInt() ?? 1, ); -Map _$$ChangedPillNumberValueImplToJson( - _$ChangedPillNumberValueImpl instance) => - { - 'beforeBeginingDate': NonNullTimestampConverter.dateTimeToTimestamp( - instance.beforeBeginingDate), - 'afterBeginingDate': NonNullTimestampConverter.dateTimeToTimestamp( - instance.afterBeginingDate), +Map _$$ChangedPillNumberValueImplToJson(_$ChangedPillNumberValueImpl instance) => { + 'beforeBeginingDate': NonNullTimestampConverter.dateTimeToTimestamp(instance.beforeBeginingDate), + 'afterBeginingDate': NonNullTimestampConverter.dateTimeToTimestamp(instance.afterBeginingDate), 'beforeTodayPillNumber': instance.beforeTodayPillNumber, 'afterTodayPillNumber': instance.afterTodayPillNumber, 'beforeGroupIndex': instance.beforeGroupIndex, 'afterGroupIndex': instance.afterGroupIndex, }; -_$EndedPillSheetValueImpl _$$EndedPillSheetValueImplFromJson( - Map json) => - _$EndedPillSheetValueImpl( - endRecordDate: NonNullTimestampConverter.timestampToDateTime( - json['endRecordDate'] as Timestamp), - lastTakenDate: NonNullTimestampConverter.timestampToDateTime( - json['lastTakenDate'] as Timestamp), +_$EndedPillSheetValueImpl _$$EndedPillSheetValueImplFromJson(Map json) => _$EndedPillSheetValueImpl( + endRecordDate: NonNullTimestampConverter.timestampToDateTime(json['endRecordDate'] as Timestamp), + lastTakenDate: NonNullTimestampConverter.timestampToDateTime(json['lastTakenDate'] as Timestamp), ); -Map _$$EndedPillSheetValueImplToJson( - _$EndedPillSheetValueImpl instance) => - { - 'endRecordDate': - NonNullTimestampConverter.dateTimeToTimestamp(instance.endRecordDate), - 'lastTakenDate': - NonNullTimestampConverter.dateTimeToTimestamp(instance.lastTakenDate), +Map _$$EndedPillSheetValueImplToJson(_$EndedPillSheetValueImpl instance) => { + 'endRecordDate': NonNullTimestampConverter.dateTimeToTimestamp(instance.endRecordDate), + 'lastTakenDate': NonNullTimestampConverter.dateTimeToTimestamp(instance.lastTakenDate), }; -_$BeganRestDurationValueImpl _$$BeganRestDurationValueImplFromJson( - Map json) => - _$BeganRestDurationValueImpl( - restDuration: - RestDuration.fromJson(json['restDuration'] as Map), +_$BeganRestDurationValueImpl _$$BeganRestDurationValueImplFromJson(Map json) => _$BeganRestDurationValueImpl( + restDuration: RestDuration.fromJson(json['restDuration'] as Map), ); -Map _$$BeganRestDurationValueImplToJson( - _$BeganRestDurationValueImpl instance) => - { +Map _$$BeganRestDurationValueImplToJson(_$BeganRestDurationValueImpl instance) => { 'restDuration': instance.restDuration.toJson(), }; -_$EndedRestDurationValueImpl _$$EndedRestDurationValueImplFromJson( - Map json) => - _$EndedRestDurationValueImpl( - restDuration: - RestDuration.fromJson(json['restDuration'] as Map), +_$EndedRestDurationValueImpl _$$EndedRestDurationValueImplFromJson(Map json) => _$EndedRestDurationValueImpl( + restDuration: RestDuration.fromJson(json['restDuration'] as Map), ); -Map _$$EndedRestDurationValueImplToJson( - _$EndedRestDurationValueImpl instance) => - { +Map _$$EndedRestDurationValueImplToJson(_$EndedRestDurationValueImpl instance) => { 'restDuration': instance.restDuration.toJson(), }; -_$ChangedRestDurationBeginDateValueImpl - _$$ChangedRestDurationBeginDateValueImplFromJson( - Map json) => - _$ChangedRestDurationBeginDateValueImpl( - beforeRestDuration: RestDuration.fromJson( - json['beforeRestDuration'] as Map), - afterRestDuration: RestDuration.fromJson( - json['afterRestDuration'] as Map), - ); - -Map _$$ChangedRestDurationBeginDateValueImplToJson( - _$ChangedRestDurationBeginDateValueImpl instance) => - { +_$ChangedRestDurationBeginDateValueImpl _$$ChangedRestDurationBeginDateValueImplFromJson(Map json) => _$ChangedRestDurationBeginDateValueImpl( + beforeRestDuration: RestDuration.fromJson(json['beforeRestDuration'] as Map), + afterRestDuration: RestDuration.fromJson(json['afterRestDuration'] as Map), + ); + +Map _$$ChangedRestDurationBeginDateValueImplToJson(_$ChangedRestDurationBeginDateValueImpl instance) => { 'beforeRestDuration': instance.beforeRestDuration.toJson(), 'afterRestDuration': instance.afterRestDuration.toJson(), }; -_$ChangedRestDurationValueImpl _$$ChangedRestDurationValueImplFromJson( - Map json) => - _$ChangedRestDurationValueImpl( - beforeRestDuration: RestDuration.fromJson( - json['beforeRestDuration'] as Map), - afterRestDuration: RestDuration.fromJson( - json['afterRestDuration'] as Map), +_$ChangedRestDurationValueImpl _$$ChangedRestDurationValueImplFromJson(Map json) => _$ChangedRestDurationValueImpl( + beforeRestDuration: RestDuration.fromJson(json['beforeRestDuration'] as Map), + afterRestDuration: RestDuration.fromJson(json['afterRestDuration'] as Map), ); -Map _$$ChangedRestDurationValueImplToJson( - _$ChangedRestDurationValueImpl instance) => - { +Map _$$ChangedRestDurationValueImplToJson(_$ChangedRestDurationValueImpl instance) => { 'beforeRestDuration': instance.beforeRestDuration.toJson(), 'afterRestDuration': instance.afterRestDuration.toJson(), }; -_$ChangedBeginDisplayNumberValueImpl - _$$ChangedBeginDisplayNumberValueImplFromJson(Map json) => - _$ChangedBeginDisplayNumberValueImpl( - beforeDisplayNumberSetting: json['beforeDisplayNumberSetting'] == null - ? null - : PillSheetGroupDisplayNumberSetting.fromJson( - json['beforeDisplayNumberSetting'] as Map), - afterDisplayNumberSetting: - PillSheetGroupDisplayNumberSetting.fromJson( - json['afterDisplayNumberSetting'] as Map), - ); - -Map _$$ChangedBeginDisplayNumberValueImplToJson( - _$ChangedBeginDisplayNumberValueImpl instance) => - { - 'beforeDisplayNumberSetting': - instance.beforeDisplayNumberSetting?.toJson(), +_$ChangedBeginDisplayNumberValueImpl _$$ChangedBeginDisplayNumberValueImplFromJson(Map json) => _$ChangedBeginDisplayNumberValueImpl( + beforeDisplayNumberSetting: json['beforeDisplayNumberSetting'] == null ? null : PillSheetGroupDisplayNumberSetting.fromJson(json['beforeDisplayNumberSetting'] as Map), + afterDisplayNumberSetting: PillSheetGroupDisplayNumberSetting.fromJson(json['afterDisplayNumberSetting'] as Map), + ); + +Map _$$ChangedBeginDisplayNumberValueImplToJson(_$ChangedBeginDisplayNumberValueImpl instance) => { + 'beforeDisplayNumberSetting': instance.beforeDisplayNumberSetting?.toJson(), 'afterDisplayNumberSetting': instance.afterDisplayNumberSetting.toJson(), }; -_$ChangedEndDisplayNumberValueImpl _$$ChangedEndDisplayNumberValueImplFromJson( - Map json) => - _$ChangedEndDisplayNumberValueImpl( - beforeDisplayNumberSetting: json['beforeDisplayNumberSetting'] == null - ? null - : PillSheetGroupDisplayNumberSetting.fromJson( - json['beforeDisplayNumberSetting'] as Map), - afterDisplayNumberSetting: PillSheetGroupDisplayNumberSetting.fromJson( - json['afterDisplayNumberSetting'] as Map), +_$ChangedEndDisplayNumberValueImpl _$$ChangedEndDisplayNumberValueImplFromJson(Map json) => _$ChangedEndDisplayNumberValueImpl( + beforeDisplayNumberSetting: json['beforeDisplayNumberSetting'] == null ? null : PillSheetGroupDisplayNumberSetting.fromJson(json['beforeDisplayNumberSetting'] as Map), + afterDisplayNumberSetting: PillSheetGroupDisplayNumberSetting.fromJson(json['afterDisplayNumberSetting'] as Map), ); -Map _$$ChangedEndDisplayNumberValueImplToJson( - _$ChangedEndDisplayNumberValueImpl instance) => - { - 'beforeDisplayNumberSetting': - instance.beforeDisplayNumberSetting?.toJson(), +Map _$$ChangedEndDisplayNumberValueImplToJson(_$ChangedEndDisplayNumberValueImpl instance) => { + 'beforeDisplayNumberSetting': instance.beforeDisplayNumberSetting?.toJson(), 'afterDisplayNumberSetting': instance.afterDisplayNumberSetting.toJson(), }; diff --git a/lib/entity/pill_sheet_type.dart b/lib/entity/pill_sheet_type.dart index 89ff596bf1..6babddeffd 100644 --- a/lib/entity/pill_sheet_type.dart +++ b/lib/entity/pill_sheet_type.dart @@ -138,11 +138,7 @@ extension PillSheetTypeFunctions on PillSheetType { } } - PillSheetTypeInfo get typeInfo => PillSheetTypeInfo( - pillSheetTypeReferencePath: rawPath, - name: fullName, - totalCount: totalCount, - dosingPeriod: dosingPeriod); + PillSheetTypeInfo get typeInfo => PillSheetTypeInfo(pillSheetTypeReferencePath: rawPath, name: fullName, totalCount: totalCount, dosingPeriod: dosingPeriod); bool get isNotExistsNotTakenDuration { return totalCount == dosingPeriod; @@ -167,19 +163,15 @@ extension PillSheetTypeFunctions on PillSheetType { } } - int get numberOfLineInPillSheet => - (totalCount / Weekday.values.length).ceil(); + int get numberOfLineInPillSheet => (totalCount / Weekday.values.length).ceil(); } -int summarizedPillCountWithPillSheetTypesToIndex( - {required List pillSheetTypes, required int toIndex}) { +int summarizedPillCountWithPillSheetTypesToIndex({required List pillSheetTypes, required int toIndex}) { if (toIndex == 0) { return 0; } final passed = pillSheetTypes.sublist(0, toIndex); - final passedTotalCount = passed - .map((e) => e.totalCount) - .reduce((value, element) => value + element); + final passedTotalCount = passed.map((e) => e.totalCount).reduce((value, element) => value + element); return passedTotalCount; } diff --git a/lib/entity/pilll_ads.codegen.dart b/lib/entity/pilll_ads.codegen.dart index f96d835801..6431d6d87a 100644 --- a/lib/entity/pilll_ads.codegen.dart +++ b/lib/entity/pilll_ads.codegen.dart @@ -28,6 +28,5 @@ class PilllAds with _$PilllAds { }) = _PilllAds; PilllAds._(); - factory PilllAds.fromJson(Map json) => - _$PilllAdsFromJson(json); + factory PilllAds.fromJson(Map json) => _$PilllAdsFromJson(json); } diff --git a/lib/entity/pilll_ads.codegen.freezed.dart b/lib/entity/pilll_ads.codegen.freezed.dart index 1a9fb9e970..a94354909e 100644 --- a/lib/entity/pilll_ads.codegen.freezed.dart +++ b/lib/entity/pilll_ads.codegen.freezed.dart @@ -20,13 +20,9 @@ PilllAds _$PilllAdsFromJson(Map json) { /// @nodoc mixin _$PilllAds { - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get startDateTime => throw _privateConstructorUsedError; - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get endDateTime => throw _privateConstructorUsedError; String get description => throw _privateConstructorUsedError; String? get imageURL => throw _privateConstructorUsedError; @@ -37,24 +33,16 @@ mixin _$PilllAds { Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $PilllAdsCopyWith get copyWith => - throw _privateConstructorUsedError; + $PilllAdsCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $PilllAdsCopyWith<$Res> { - factory $PilllAdsCopyWith(PilllAds value, $Res Function(PilllAds) then) = - _$PilllAdsCopyWithImpl<$Res, PilllAds>; + factory $PilllAdsCopyWith(PilllAds value, $Res Function(PilllAds) then) = _$PilllAdsCopyWithImpl<$Res, PilllAds>; @useResult $Res call( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime startDateTime, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime endDateTime, + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime startDateTime, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime endDateTime, String description, String? imageURL, String destinationURL, @@ -64,8 +52,7 @@ abstract class $PilllAdsCopyWith<$Res> { } /// @nodoc -class _$PilllAdsCopyWithImpl<$Res, $Val extends PilllAds> - implements $PilllAdsCopyWith<$Res> { +class _$PilllAdsCopyWithImpl<$Res, $Val extends PilllAds> implements $PilllAdsCopyWith<$Res> { _$PilllAdsCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -123,22 +110,13 @@ class _$PilllAdsCopyWithImpl<$Res, $Val extends PilllAds> } /// @nodoc -abstract class _$$PilllAdsImplCopyWith<$Res> - implements $PilllAdsCopyWith<$Res> { - factory _$$PilllAdsImplCopyWith( - _$PilllAdsImpl value, $Res Function(_$PilllAdsImpl) then) = - __$$PilllAdsImplCopyWithImpl<$Res>; +abstract class _$$PilllAdsImplCopyWith<$Res> implements $PilllAdsCopyWith<$Res> { + factory _$$PilllAdsImplCopyWith(_$PilllAdsImpl value, $Res Function(_$PilllAdsImpl) then) = __$$PilllAdsImplCopyWithImpl<$Res>; @override @useResult $Res call( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime startDateTime, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime endDateTime, + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime startDateTime, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime endDateTime, String description, String? imageURL, String destinationURL, @@ -148,12 +126,8 @@ abstract class _$$PilllAdsImplCopyWith<$Res> } /// @nodoc -class __$$PilllAdsImplCopyWithImpl<$Res> - extends _$PilllAdsCopyWithImpl<$Res, _$PilllAdsImpl> - implements _$$PilllAdsImplCopyWith<$Res> { - __$$PilllAdsImplCopyWithImpl( - _$PilllAdsImpl _value, $Res Function(_$PilllAdsImpl) _then) - : super(_value, _then); +class __$$PilllAdsImplCopyWithImpl<$Res> extends _$PilllAdsCopyWithImpl<$Res, _$PilllAdsImpl> implements _$$PilllAdsImplCopyWith<$Res> { + __$$PilllAdsImplCopyWithImpl(_$PilllAdsImpl _value, $Res Function(_$PilllAdsImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -209,14 +183,8 @@ class __$$PilllAdsImplCopyWithImpl<$Res> @JsonSerializable(explicitToJson: true) class _$PilllAdsImpl extends _PilllAds { _$PilllAdsImpl( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.startDateTime, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.endDateTime, + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.startDateTime, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.endDateTime, required this.description, required this.imageURL, required this.destinationURL, @@ -225,18 +193,13 @@ class _$PilllAdsImpl extends _PilllAds { this.chevronRightColor = "FFFFFF"}) : super._(); - factory _$PilllAdsImpl.fromJson(Map json) => - _$$PilllAdsImplFromJson(json); + factory _$PilllAdsImpl.fromJson(Map json) => _$$PilllAdsImplFromJson(json); @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime startDateTime; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime endDateTime; @override final String description; @@ -263,42 +226,24 @@ class _$PilllAdsImpl extends _PilllAds { return identical(this, other) || (other.runtimeType == runtimeType && other is _$PilllAdsImpl && - (identical(other.startDateTime, startDateTime) || - other.startDateTime == startDateTime) && - (identical(other.endDateTime, endDateTime) || - other.endDateTime == endDateTime) && - (identical(other.description, description) || - other.description == description) && - (identical(other.imageURL, imageURL) || - other.imageURL == imageURL) && - (identical(other.destinationURL, destinationURL) || - other.destinationURL == destinationURL) && - (identical(other.hexColor, hexColor) || - other.hexColor == hexColor) && - (identical(other.closeButtonColor, closeButtonColor) || - other.closeButtonColor == closeButtonColor) && - (identical(other.chevronRightColor, chevronRightColor) || - other.chevronRightColor == chevronRightColor)); + (identical(other.startDateTime, startDateTime) || other.startDateTime == startDateTime) && + (identical(other.endDateTime, endDateTime) || other.endDateTime == endDateTime) && + (identical(other.description, description) || other.description == description) && + (identical(other.imageURL, imageURL) || other.imageURL == imageURL) && + (identical(other.destinationURL, destinationURL) || other.destinationURL == destinationURL) && + (identical(other.hexColor, hexColor) || other.hexColor == hexColor) && + (identical(other.closeButtonColor, closeButtonColor) || other.closeButtonColor == closeButtonColor) && + (identical(other.chevronRightColor, chevronRightColor) || other.chevronRightColor == chevronRightColor)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, - startDateTime, - endDateTime, - description, - imageURL, - destinationURL, - hexColor, - closeButtonColor, - chevronRightColor); + int get hashCode => Object.hash(runtimeType, startDateTime, endDateTime, description, imageURL, destinationURL, hexColor, closeButtonColor, chevronRightColor); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PilllAdsImplCopyWith<_$PilllAdsImpl> get copyWith => - __$$PilllAdsImplCopyWithImpl<_$PilllAdsImpl>(this, _$identity); + _$$PilllAdsImplCopyWith<_$PilllAdsImpl> get copyWith => __$$PilllAdsImplCopyWithImpl<_$PilllAdsImpl>(this, _$identity); @override Map toJson() { @@ -310,14 +255,8 @@ class _$PilllAdsImpl extends _PilllAds { abstract class _PilllAds extends PilllAds { factory _PilllAds( - {@JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime startDateTime, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime endDateTime, + {@JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime startDateTime, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime endDateTime, required final String description, required final String? imageURL, required final String destinationURL, @@ -326,18 +265,13 @@ abstract class _PilllAds extends PilllAds { final String chevronRightColor}) = _$PilllAdsImpl; _PilllAds._() : super._(); - factory _PilllAds.fromJson(Map json) = - _$PilllAdsImpl.fromJson; + factory _PilllAds.fromJson(Map json) = _$PilllAdsImpl.fromJson; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get startDateTime; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get endDateTime; @override String get description; @@ -353,6 +287,5 @@ abstract class _PilllAds extends PilllAds { String get chevronRightColor; @override @JsonKey(ignore: true) - _$$PilllAdsImplCopyWith<_$PilllAdsImpl> get copyWith => - throw _privateConstructorUsedError; + _$$PilllAdsImplCopyWith<_$PilllAdsImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/entity/pilll_ads.codegen.g.dart b/lib/entity/pilll_ads.codegen.g.dart index 7db63b8e5f..3a20308730 100644 --- a/lib/entity/pilll_ads.codegen.g.dart +++ b/lib/entity/pilll_ads.codegen.g.dart @@ -6,12 +6,9 @@ part of 'pilll_ads.codegen.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PilllAdsImpl _$$PilllAdsImplFromJson(Map json) => - _$PilllAdsImpl( - startDateTime: NonNullTimestampConverter.timestampToDateTime( - json['startDateTime'] as Timestamp), - endDateTime: NonNullTimestampConverter.timestampToDateTime( - json['endDateTime'] as Timestamp), +_$PilllAdsImpl _$$PilllAdsImplFromJson(Map json) => _$PilllAdsImpl( + startDateTime: NonNullTimestampConverter.timestampToDateTime(json['startDateTime'] as Timestamp), + endDateTime: NonNullTimestampConverter.timestampToDateTime(json['endDateTime'] as Timestamp), description: json['description'] as String, imageURL: json['imageURL'] as String?, destinationURL: json['destinationURL'] as String, @@ -20,12 +17,9 @@ _$PilllAdsImpl _$$PilllAdsImplFromJson(Map json) => chevronRightColor: json['chevronRightColor'] as String? ?? "FFFFFF", ); -Map _$$PilllAdsImplToJson(_$PilllAdsImpl instance) => - { - 'startDateTime': - NonNullTimestampConverter.dateTimeToTimestamp(instance.startDateTime), - 'endDateTime': - NonNullTimestampConverter.dateTimeToTimestamp(instance.endDateTime), +Map _$$PilllAdsImplToJson(_$PilllAdsImpl instance) => { + 'startDateTime': NonNullTimestampConverter.dateTimeToTimestamp(instance.startDateTime), + 'endDateTime': NonNullTimestampConverter.dateTimeToTimestamp(instance.endDateTime), 'description': instance.description, 'imageURL': instance.imageURL, 'destinationURL': instance.destinationURL, diff --git a/lib/entity/reminder_notification_customization.codegen.dart b/lib/entity/reminder_notification_customization.codegen.dart index 4700929f29..2242fcf3cc 100644 --- a/lib/entity/reminder_notification_customization.codegen.dart +++ b/lib/entity/reminder_notification_customization.codegen.dart @@ -5,8 +5,7 @@ part 'reminder_notification_customization.codegen.g.dart'; part 'reminder_notification_customization.codegen.freezed.dart'; @freezed -class ReminderNotificationCustomization - with _$ReminderNotificationCustomization { +class ReminderNotificationCustomization with _$ReminderNotificationCustomization { @JsonSerializable(explicitToJson: true) const factory ReminderNotificationCustomization({ @Default("v2") String version, @@ -16,13 +15,10 @@ class ReminderNotificationCustomization @Default(false) bool isInVisibleDescription, // BEGIN: From v2 @Default("") String dailyTakenMessage, - @Default("飲み忘れていませんか?\n服用記録がない日が複数あります$thinkingFaceEmoji") - String missedTakenMessage, + @Default("飲み忘れていませんか?\n服用記録がない日が複数あります$thinkingFaceEmoji") String missedTakenMessage, // END: From v2 }) = _ReminderNotificationCustomization; const ReminderNotificationCustomization._(); - factory ReminderNotificationCustomization.fromJson( - Map json) => - _$ReminderNotificationCustomizationFromJson(json); + factory ReminderNotificationCustomization.fromJson(Map json) => _$ReminderNotificationCustomizationFromJson(json); } diff --git a/lib/entity/reminder_notification_customization.codegen.freezed.dart b/lib/entity/reminder_notification_customization.codegen.freezed.dart index 240e37223f..9f70105ba7 100644 --- a/lib/entity/reminder_notification_customization.codegen.freezed.dart +++ b/lib/entity/reminder_notification_customization.codegen.freezed.dart @@ -14,8 +14,7 @@ T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); -ReminderNotificationCustomization _$ReminderNotificationCustomizationFromJson( - Map json) { +ReminderNotificationCustomization _$ReminderNotificationCustomizationFromJson(Map json) { return _ReminderNotificationCustomization.fromJson(json); } @@ -25,39 +24,25 @@ mixin _$ReminderNotificationCustomization { String get word => throw _privateConstructorUsedError; bool get isInVisibleReminderDate => throw _privateConstructorUsedError; bool get isInVisiblePillNumber => throw _privateConstructorUsedError; - bool get isInVisibleDescription => - throw _privateConstructorUsedError; // BEGIN: From v2 + bool get isInVisibleDescription => throw _privateConstructorUsedError; // BEGIN: From v2 String get dailyTakenMessage => throw _privateConstructorUsedError; String get missedTakenMessage => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $ReminderNotificationCustomizationCopyWith - get copyWith => throw _privateConstructorUsedError; + $ReminderNotificationCustomizationCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ReminderNotificationCustomizationCopyWith<$Res> { - factory $ReminderNotificationCustomizationCopyWith( - ReminderNotificationCustomization value, - $Res Function(ReminderNotificationCustomization) then) = - _$ReminderNotificationCustomizationCopyWithImpl<$Res, - ReminderNotificationCustomization>; + factory $ReminderNotificationCustomizationCopyWith(ReminderNotificationCustomization value, $Res Function(ReminderNotificationCustomization) then) = + _$ReminderNotificationCustomizationCopyWithImpl<$Res, ReminderNotificationCustomization>; @useResult - $Res call( - {String version, - String word, - bool isInVisibleReminderDate, - bool isInVisiblePillNumber, - bool isInVisibleDescription, - String dailyTakenMessage, - String missedTakenMessage}); + $Res call({String version, String word, bool isInVisibleReminderDate, bool isInVisiblePillNumber, bool isInVisibleDescription, String dailyTakenMessage, String missedTakenMessage}); } /// @nodoc -class _$ReminderNotificationCustomizationCopyWithImpl<$Res, - $Val extends ReminderNotificationCustomization> - implements $ReminderNotificationCustomizationCopyWith<$Res> { +class _$ReminderNotificationCustomizationCopyWithImpl<$Res, $Val extends ReminderNotificationCustomization> implements $ReminderNotificationCustomizationCopyWith<$Res> { _$ReminderNotificationCustomizationCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -110,33 +95,18 @@ class _$ReminderNotificationCustomizationCopyWithImpl<$Res, } /// @nodoc -abstract class _$$ReminderNotificationCustomizationImplCopyWith<$Res> - implements $ReminderNotificationCustomizationCopyWith<$Res> { - factory _$$ReminderNotificationCustomizationImplCopyWith( - _$ReminderNotificationCustomizationImpl value, - $Res Function(_$ReminderNotificationCustomizationImpl) then) = +abstract class _$$ReminderNotificationCustomizationImplCopyWith<$Res> implements $ReminderNotificationCustomizationCopyWith<$Res> { + factory _$$ReminderNotificationCustomizationImplCopyWith(_$ReminderNotificationCustomizationImpl value, $Res Function(_$ReminderNotificationCustomizationImpl) then) = __$$ReminderNotificationCustomizationImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String version, - String word, - bool isInVisibleReminderDate, - bool isInVisiblePillNumber, - bool isInVisibleDescription, - String dailyTakenMessage, - String missedTakenMessage}); + $Res call({String version, String word, bool isInVisibleReminderDate, bool isInVisiblePillNumber, bool isInVisibleDescription, String dailyTakenMessage, String missedTakenMessage}); } /// @nodoc -class __$$ReminderNotificationCustomizationImplCopyWithImpl<$Res> - extends _$ReminderNotificationCustomizationCopyWithImpl<$Res, - _$ReminderNotificationCustomizationImpl> +class __$$ReminderNotificationCustomizationImplCopyWithImpl<$Res> extends _$ReminderNotificationCustomizationCopyWithImpl<$Res, _$ReminderNotificationCustomizationImpl> implements _$$ReminderNotificationCustomizationImplCopyWith<$Res> { - __$$ReminderNotificationCustomizationImplCopyWithImpl( - _$ReminderNotificationCustomizationImpl _value, - $Res Function(_$ReminderNotificationCustomizationImpl) _then) - : super(_value, _then); + __$$ReminderNotificationCustomizationImplCopyWithImpl(_$ReminderNotificationCustomizationImpl _value, $Res Function(_$ReminderNotificationCustomizationImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -185,8 +155,7 @@ class __$$ReminderNotificationCustomizationImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable(explicitToJson: true) -class _$ReminderNotificationCustomizationImpl - extends _ReminderNotificationCustomization { +class _$ReminderNotificationCustomizationImpl extends _ReminderNotificationCustomization { const _$ReminderNotificationCustomizationImpl( {this.version = "v2", this.word = pillEmoji, @@ -194,13 +163,10 @@ class _$ReminderNotificationCustomizationImpl this.isInVisiblePillNumber = false, this.isInVisibleDescription = false, this.dailyTakenMessage = "", - this.missedTakenMessage = - "飲み忘れていませんか?\n服用記録がない日が複数あります$thinkingFaceEmoji"}) + this.missedTakenMessage = "飲み忘れていませんか?\n服用記録がない日が複数あります$thinkingFaceEmoji"}) : super._(); - factory _$ReminderNotificationCustomizationImpl.fromJson( - Map json) => - _$$ReminderNotificationCustomizationImplFromJson(json); + factory _$ReminderNotificationCustomizationImpl.fromJson(Map json) => _$$ReminderNotificationCustomizationImplFromJson(json); @override @JsonKey() @@ -237,38 +203,22 @@ class _$ReminderNotificationCustomizationImpl other is _$ReminderNotificationCustomizationImpl && (identical(other.version, version) || other.version == version) && (identical(other.word, word) || other.word == word) && - (identical( - other.isInVisibleReminderDate, isInVisibleReminderDate) || - other.isInVisibleReminderDate == isInVisibleReminderDate) && - (identical(other.isInVisiblePillNumber, isInVisiblePillNumber) || - other.isInVisiblePillNumber == isInVisiblePillNumber) && - (identical(other.isInVisibleDescription, isInVisibleDescription) || - other.isInVisibleDescription == isInVisibleDescription) && - (identical(other.dailyTakenMessage, dailyTakenMessage) || - other.dailyTakenMessage == dailyTakenMessage) && - (identical(other.missedTakenMessage, missedTakenMessage) || - other.missedTakenMessage == missedTakenMessage)); + (identical(other.isInVisibleReminderDate, isInVisibleReminderDate) || other.isInVisibleReminderDate == isInVisibleReminderDate) && + (identical(other.isInVisiblePillNumber, isInVisiblePillNumber) || other.isInVisiblePillNumber == isInVisiblePillNumber) && + (identical(other.isInVisibleDescription, isInVisibleDescription) || other.isInVisibleDescription == isInVisibleDescription) && + (identical(other.dailyTakenMessage, dailyTakenMessage) || other.dailyTakenMessage == dailyTakenMessage) && + (identical(other.missedTakenMessage, missedTakenMessage) || other.missedTakenMessage == missedTakenMessage)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, - version, - word, - isInVisibleReminderDate, - isInVisiblePillNumber, - isInVisibleDescription, - dailyTakenMessage, - missedTakenMessage); + int get hashCode => Object.hash(runtimeType, version, word, isInVisibleReminderDate, isInVisiblePillNumber, isInVisibleDescription, dailyTakenMessage, missedTakenMessage); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ReminderNotificationCustomizationImplCopyWith< - _$ReminderNotificationCustomizationImpl> - get copyWith => __$$ReminderNotificationCustomizationImplCopyWithImpl< - _$ReminderNotificationCustomizationImpl>(this, _$identity); + _$$ReminderNotificationCustomizationImplCopyWith<_$ReminderNotificationCustomizationImpl> get copyWith => + __$$ReminderNotificationCustomizationImplCopyWithImpl<_$ReminderNotificationCustomizationImpl>(this, _$identity); @override Map toJson() { @@ -278,22 +228,18 @@ class _$ReminderNotificationCustomizationImpl } } -abstract class _ReminderNotificationCustomization - extends ReminderNotificationCustomization { +abstract class _ReminderNotificationCustomization extends ReminderNotificationCustomization { const factory _ReminderNotificationCustomization( - {final String version, - final String word, - final bool isInVisibleReminderDate, - final bool isInVisiblePillNumber, - final bool isInVisibleDescription, - final String dailyTakenMessage, - final String missedTakenMessage}) = - _$ReminderNotificationCustomizationImpl; + {final String version, + final String word, + final bool isInVisibleReminderDate, + final bool isInVisiblePillNumber, + final bool isInVisibleDescription, + final String dailyTakenMessage, + final String missedTakenMessage}) = _$ReminderNotificationCustomizationImpl; const _ReminderNotificationCustomization._() : super._(); - factory _ReminderNotificationCustomization.fromJson( - Map json) = - _$ReminderNotificationCustomizationImpl.fromJson; + factory _ReminderNotificationCustomization.fromJson(Map json) = _$ReminderNotificationCustomizationImpl.fromJson; @override String get version; @@ -311,7 +257,5 @@ abstract class _ReminderNotificationCustomization String get missedTakenMessage; @override @JsonKey(ignore: true) - _$$ReminderNotificationCustomizationImplCopyWith< - _$ReminderNotificationCustomizationImpl> - get copyWith => throw _privateConstructorUsedError; + _$$ReminderNotificationCustomizationImplCopyWith<_$ReminderNotificationCustomizationImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/entity/reminder_notification_customization.codegen.g.dart b/lib/entity/reminder_notification_customization.codegen.g.dart index c5b4437efd..68b1f92769 100644 --- a/lib/entity/reminder_notification_customization.codegen.g.dart +++ b/lib/entity/reminder_notification_customization.codegen.g.dart @@ -6,26 +6,17 @@ part of 'reminder_notification_customization.codegen.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ReminderNotificationCustomizationImpl - _$$ReminderNotificationCustomizationImplFromJson( - Map json) => - _$ReminderNotificationCustomizationImpl( - version: json['version'] as String? ?? "v2", - word: json['word'] as String? ?? pillEmoji, - isInVisibleReminderDate: - json['isInVisibleReminderDate'] as bool? ?? false, - isInVisiblePillNumber: - json['isInVisiblePillNumber'] as bool? ?? false, - isInVisibleDescription: - json['isInVisibleDescription'] as bool? ?? false, - dailyTakenMessage: json['dailyTakenMessage'] as String? ?? "", - missedTakenMessage: json['missedTakenMessage'] as String? ?? - "飲み忘れていませんか?\n服用記録がない日が複数あります$thinkingFaceEmoji", - ); +_$ReminderNotificationCustomizationImpl _$$ReminderNotificationCustomizationImplFromJson(Map json) => _$ReminderNotificationCustomizationImpl( + version: json['version'] as String? ?? "v2", + word: json['word'] as String? ?? pillEmoji, + isInVisibleReminderDate: json['isInVisibleReminderDate'] as bool? ?? false, + isInVisiblePillNumber: json['isInVisiblePillNumber'] as bool? ?? false, + isInVisibleDescription: json['isInVisibleDescription'] as bool? ?? false, + dailyTakenMessage: json['dailyTakenMessage'] as String? ?? "", + missedTakenMessage: json['missedTakenMessage'] as String? ?? "飲み忘れていませんか?\n服用記録がない日が複数あります$thinkingFaceEmoji", + ); -Map _$$ReminderNotificationCustomizationImplToJson( - _$ReminderNotificationCustomizationImpl instance) => - { +Map _$$ReminderNotificationCustomizationImplToJson(_$ReminderNotificationCustomizationImpl instance) => { 'version': instance.version, 'word': instance.word, 'isInVisibleReminderDate': instance.isInVisibleReminderDate, diff --git a/lib/entity/remote_config_parameter.codegen.dart b/lib/entity/remote_config_parameter.codegen.dart index 9ff46f26fd..b4f9497844 100644 --- a/lib/entity/remote_config_parameter.codegen.dart +++ b/lib/entity/remote_config_parameter.codegen.dart @@ -27,20 +27,13 @@ abstract class RemoteConfigParameterDefaultValues { @freezed class RemoteConfigParameter with _$RemoteConfigParameter { factory RemoteConfigParameter({ - @Default(RemoteConfigParameterDefaultValues.isPaywallFirst) - bool isPaywallFirst, - @Default(RemoteConfigParameterDefaultValues.skipInitialSetting) - bool skipInitialSetting, - @Default(RemoteConfigParameterDefaultValues.trialDeadlineDateOffsetDay) - int trialDeadlineDateOffsetDay, - @Default(RemoteConfigParameterDefaultValues.discountEntitlementOffsetDay) - int discountEntitlementOffsetDay, - @Default(RemoteConfigParameterDefaultValues.discountCountdownBoundaryHour) - int discountCountdownBoundaryHour, - @Default(RemoteConfigParameterDefaultValues.premiumIntroductionPattern) - String premiumIntroductionPattern, + @Default(RemoteConfigParameterDefaultValues.isPaywallFirst) bool isPaywallFirst, + @Default(RemoteConfigParameterDefaultValues.skipInitialSetting) bool skipInitialSetting, + @Default(RemoteConfigParameterDefaultValues.trialDeadlineDateOffsetDay) int trialDeadlineDateOffsetDay, + @Default(RemoteConfigParameterDefaultValues.discountEntitlementOffsetDay) int discountEntitlementOffsetDay, + @Default(RemoteConfigParameterDefaultValues.discountCountdownBoundaryHour) int discountCountdownBoundaryHour, + @Default(RemoteConfigParameterDefaultValues.premiumIntroductionPattern) String premiumIntroductionPattern, }) = _RemoteConfigParameter; RemoteConfigParameter._(); - factory RemoteConfigParameter.fromJson(Map json) => - _$RemoteConfigParameterFromJson(json); + factory RemoteConfigParameter.fromJson(Map json) => _$RemoteConfigParameterFromJson(json); } diff --git a/lib/entity/remote_config_parameter.codegen.freezed.dart b/lib/entity/remote_config_parameter.codegen.freezed.dart index 0a6cbbf784..1d31e7fa31 100644 --- a/lib/entity/remote_config_parameter.codegen.freezed.dart +++ b/lib/entity/remote_config_parameter.codegen.freezed.dart @@ -14,8 +14,7 @@ T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); -RemoteConfigParameter _$RemoteConfigParameterFromJson( - Map json) { +RemoteConfigParameter _$RemoteConfigParameterFromJson(Map json) { return _RemoteConfigParameter.fromJson(json); } @@ -30,29 +29,18 @@ mixin _$RemoteConfigParameter { Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $RemoteConfigParameterCopyWith get copyWith => - throw _privateConstructorUsedError; + $RemoteConfigParameterCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $RemoteConfigParameterCopyWith<$Res> { - factory $RemoteConfigParameterCopyWith(RemoteConfigParameter value, - $Res Function(RemoteConfigParameter) then) = - _$RemoteConfigParameterCopyWithImpl<$Res, RemoteConfigParameter>; + factory $RemoteConfigParameterCopyWith(RemoteConfigParameter value, $Res Function(RemoteConfigParameter) then) = _$RemoteConfigParameterCopyWithImpl<$Res, RemoteConfigParameter>; @useResult - $Res call( - {bool isPaywallFirst, - bool skipInitialSetting, - int trialDeadlineDateOffsetDay, - int discountEntitlementOffsetDay, - int discountCountdownBoundaryHour, - String premiumIntroductionPattern}); + $Res call({bool isPaywallFirst, bool skipInitialSetting, int trialDeadlineDateOffsetDay, int discountEntitlementOffsetDay, int discountCountdownBoundaryHour, String premiumIntroductionPattern}); } /// @nodoc -class _$RemoteConfigParameterCopyWithImpl<$Res, - $Val extends RemoteConfigParameter> - implements $RemoteConfigParameterCopyWith<$Res> { +class _$RemoteConfigParameterCopyWithImpl<$Res, $Val extends RemoteConfigParameter> implements $RemoteConfigParameterCopyWith<$Res> { _$RemoteConfigParameterCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -100,31 +88,16 @@ class _$RemoteConfigParameterCopyWithImpl<$Res, } /// @nodoc -abstract class _$$RemoteConfigParameterImplCopyWith<$Res> - implements $RemoteConfigParameterCopyWith<$Res> { - factory _$$RemoteConfigParameterImplCopyWith( - _$RemoteConfigParameterImpl value, - $Res Function(_$RemoteConfigParameterImpl) then) = - __$$RemoteConfigParameterImplCopyWithImpl<$Res>; +abstract class _$$RemoteConfigParameterImplCopyWith<$Res> implements $RemoteConfigParameterCopyWith<$Res> { + factory _$$RemoteConfigParameterImplCopyWith(_$RemoteConfigParameterImpl value, $Res Function(_$RemoteConfigParameterImpl) then) = __$$RemoteConfigParameterImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {bool isPaywallFirst, - bool skipInitialSetting, - int trialDeadlineDateOffsetDay, - int discountEntitlementOffsetDay, - int discountCountdownBoundaryHour, - String premiumIntroductionPattern}); + $Res call({bool isPaywallFirst, bool skipInitialSetting, int trialDeadlineDateOffsetDay, int discountEntitlementOffsetDay, int discountCountdownBoundaryHour, String premiumIntroductionPattern}); } /// @nodoc -class __$$RemoteConfigParameterImplCopyWithImpl<$Res> - extends _$RemoteConfigParameterCopyWithImpl<$Res, - _$RemoteConfigParameterImpl> - implements _$$RemoteConfigParameterImplCopyWith<$Res> { - __$$RemoteConfigParameterImplCopyWithImpl(_$RemoteConfigParameterImpl _value, - $Res Function(_$RemoteConfigParameterImpl) _then) - : super(_value, _then); +class __$$RemoteConfigParameterImplCopyWithImpl<$Res> extends _$RemoteConfigParameterCopyWithImpl<$Res, _$RemoteConfigParameterImpl> implements _$$RemoteConfigParameterImplCopyWith<$Res> { + __$$RemoteConfigParameterImplCopyWithImpl(_$RemoteConfigParameterImpl _value, $Res Function(_$RemoteConfigParameterImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -170,20 +143,14 @@ class __$$RemoteConfigParameterImplCopyWithImpl<$Res> class _$RemoteConfigParameterImpl extends _RemoteConfigParameter { _$RemoteConfigParameterImpl( {this.isPaywallFirst = RemoteConfigParameterDefaultValues.isPaywallFirst, - this.skipInitialSetting = - RemoteConfigParameterDefaultValues.skipInitialSetting, - this.trialDeadlineDateOffsetDay = - RemoteConfigParameterDefaultValues.trialDeadlineDateOffsetDay, - this.discountEntitlementOffsetDay = - RemoteConfigParameterDefaultValues.discountEntitlementOffsetDay, - this.discountCountdownBoundaryHour = - RemoteConfigParameterDefaultValues.discountCountdownBoundaryHour, - this.premiumIntroductionPattern = - RemoteConfigParameterDefaultValues.premiumIntroductionPattern}) + this.skipInitialSetting = RemoteConfigParameterDefaultValues.skipInitialSetting, + this.trialDeadlineDateOffsetDay = RemoteConfigParameterDefaultValues.trialDeadlineDateOffsetDay, + this.discountEntitlementOffsetDay = RemoteConfigParameterDefaultValues.discountEntitlementOffsetDay, + this.discountCountdownBoundaryHour = RemoteConfigParameterDefaultValues.discountCountdownBoundaryHour, + this.premiumIntroductionPattern = RemoteConfigParameterDefaultValues.premiumIntroductionPattern}) : super._(); - factory _$RemoteConfigParameterImpl.fromJson(Map json) => - _$$RemoteConfigParameterImplFromJson(json); + factory _$RemoteConfigParameterImpl.fromJson(Map json) => _$$RemoteConfigParameterImplFromJson(json); @override @JsonKey() @@ -214,45 +181,22 @@ class _$RemoteConfigParameterImpl extends _RemoteConfigParameter { return identical(this, other) || (other.runtimeType == runtimeType && other is _$RemoteConfigParameterImpl && - (identical(other.isPaywallFirst, isPaywallFirst) || - other.isPaywallFirst == isPaywallFirst) && - (identical(other.skipInitialSetting, skipInitialSetting) || - other.skipInitialSetting == skipInitialSetting) && - (identical(other.trialDeadlineDateOffsetDay, - trialDeadlineDateOffsetDay) || - other.trialDeadlineDateOffsetDay == - trialDeadlineDateOffsetDay) && - (identical(other.discountEntitlementOffsetDay, - discountEntitlementOffsetDay) || - other.discountEntitlementOffsetDay == - discountEntitlementOffsetDay) && - (identical(other.discountCountdownBoundaryHour, - discountCountdownBoundaryHour) || - other.discountCountdownBoundaryHour == - discountCountdownBoundaryHour) && - (identical(other.premiumIntroductionPattern, - premiumIntroductionPattern) || - other.premiumIntroductionPattern == - premiumIntroductionPattern)); + (identical(other.isPaywallFirst, isPaywallFirst) || other.isPaywallFirst == isPaywallFirst) && + (identical(other.skipInitialSetting, skipInitialSetting) || other.skipInitialSetting == skipInitialSetting) && + (identical(other.trialDeadlineDateOffsetDay, trialDeadlineDateOffsetDay) || other.trialDeadlineDateOffsetDay == trialDeadlineDateOffsetDay) && + (identical(other.discountEntitlementOffsetDay, discountEntitlementOffsetDay) || other.discountEntitlementOffsetDay == discountEntitlementOffsetDay) && + (identical(other.discountCountdownBoundaryHour, discountCountdownBoundaryHour) || other.discountCountdownBoundaryHour == discountCountdownBoundaryHour) && + (identical(other.premiumIntroductionPattern, premiumIntroductionPattern) || other.premiumIntroductionPattern == premiumIntroductionPattern)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, - isPaywallFirst, - skipInitialSetting, - trialDeadlineDateOffsetDay, - discountEntitlementOffsetDay, - discountCountdownBoundaryHour, - premiumIntroductionPattern); + int get hashCode => Object.hash(runtimeType, isPaywallFirst, skipInitialSetting, trialDeadlineDateOffsetDay, discountEntitlementOffsetDay, discountCountdownBoundaryHour, premiumIntroductionPattern); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$RemoteConfigParameterImplCopyWith<_$RemoteConfigParameterImpl> - get copyWith => __$$RemoteConfigParameterImplCopyWithImpl< - _$RemoteConfigParameterImpl>(this, _$identity); + _$$RemoteConfigParameterImplCopyWith<_$RemoteConfigParameterImpl> get copyWith => __$$RemoteConfigParameterImplCopyWithImpl<_$RemoteConfigParameterImpl>(this, _$identity); @override Map toJson() { @@ -272,8 +216,7 @@ abstract class _RemoteConfigParameter extends RemoteConfigParameter { final String premiumIntroductionPattern}) = _$RemoteConfigParameterImpl; _RemoteConfigParameter._() : super._(); - factory _RemoteConfigParameter.fromJson(Map json) = - _$RemoteConfigParameterImpl.fromJson; + factory _RemoteConfigParameter.fromJson(Map json) = _$RemoteConfigParameterImpl.fromJson; @override bool get isPaywallFirst; @@ -289,6 +232,5 @@ abstract class _RemoteConfigParameter extends RemoteConfigParameter { String get premiumIntroductionPattern; @override @JsonKey(ignore: true) - _$$RemoteConfigParameterImplCopyWith<_$RemoteConfigParameterImpl> - get copyWith => throw _privateConstructorUsedError; + _$$RemoteConfigParameterImplCopyWith<_$RemoteConfigParameterImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/entity/remote_config_parameter.codegen.g.dart b/lib/entity/remote_config_parameter.codegen.g.dart index 11efcacba8..3478b9f128 100644 --- a/lib/entity/remote_config_parameter.codegen.g.dart +++ b/lib/entity/remote_config_parameter.codegen.g.dart @@ -6,30 +6,16 @@ part of 'remote_config_parameter.codegen.dart'; // JsonSerializableGenerator // ************************************************************************** -_$RemoteConfigParameterImpl _$$RemoteConfigParameterImplFromJson( - Map json) => - _$RemoteConfigParameterImpl( - isPaywallFirst: json['isPaywallFirst'] as bool? ?? - RemoteConfigParameterDefaultValues.isPaywallFirst, - skipInitialSetting: json['skipInitialSetting'] as bool? ?? - RemoteConfigParameterDefaultValues.skipInitialSetting, - trialDeadlineDateOffsetDay: - (json['trialDeadlineDateOffsetDay'] as num?)?.toInt() ?? - RemoteConfigParameterDefaultValues.trialDeadlineDateOffsetDay, - discountEntitlementOffsetDay: - (json['discountEntitlementOffsetDay'] as num?)?.toInt() ?? - RemoteConfigParameterDefaultValues.discountEntitlementOffsetDay, - discountCountdownBoundaryHour: - (json['discountCountdownBoundaryHour'] as num?)?.toInt() ?? - RemoteConfigParameterDefaultValues.discountCountdownBoundaryHour, - premiumIntroductionPattern: - json['premiumIntroductionPattern'] as String? ?? - RemoteConfigParameterDefaultValues.premiumIntroductionPattern, +_$RemoteConfigParameterImpl _$$RemoteConfigParameterImplFromJson(Map json) => _$RemoteConfigParameterImpl( + isPaywallFirst: json['isPaywallFirst'] as bool? ?? RemoteConfigParameterDefaultValues.isPaywallFirst, + skipInitialSetting: json['skipInitialSetting'] as bool? ?? RemoteConfigParameterDefaultValues.skipInitialSetting, + trialDeadlineDateOffsetDay: (json['trialDeadlineDateOffsetDay'] as num?)?.toInt() ?? RemoteConfigParameterDefaultValues.trialDeadlineDateOffsetDay, + discountEntitlementOffsetDay: (json['discountEntitlementOffsetDay'] as num?)?.toInt() ?? RemoteConfigParameterDefaultValues.discountEntitlementOffsetDay, + discountCountdownBoundaryHour: (json['discountCountdownBoundaryHour'] as num?)?.toInt() ?? RemoteConfigParameterDefaultValues.discountCountdownBoundaryHour, + premiumIntroductionPattern: json['premiumIntroductionPattern'] as String? ?? RemoteConfigParameterDefaultValues.premiumIntroductionPattern, ); -Map _$$RemoteConfigParameterImplToJson( - _$RemoteConfigParameterImpl instance) => - { +Map _$$RemoteConfigParameterImplToJson(_$RemoteConfigParameterImpl instance) => { 'isPaywallFirst': instance.isPaywallFirst, 'skipInitialSetting': instance.skipInitialSetting, 'trialDeadlineDateOffsetDay': instance.trialDeadlineDateOffsetDay, diff --git a/lib/entity/schedule.codegen.dart b/lib/entity/schedule.codegen.dart index 03f4e12083..999d79d877 100644 --- a/lib/entity/schedule.codegen.dart +++ b/lib/entity/schedule.codegen.dart @@ -29,8 +29,7 @@ class Schedule with _$Schedule { }) = _Schedule; const Schedule._(); - factory Schedule.fromJson(Map json) => - _$ScheduleFromJson(json); + factory Schedule.fromJson(Map json) => _$ScheduleFromJson(json); } @freezed @@ -46,6 +45,5 @@ class LocalNotification with _$LocalNotification { }) = _LocalNotification; const LocalNotification._(); - factory LocalNotification.fromJson(Map json) => - _$LocalNotificationFromJson(json); + factory LocalNotification.fromJson(Map json) => _$LocalNotificationFromJson(json); } diff --git a/lib/entity/schedule.codegen.freezed.dart b/lib/entity/schedule.codegen.freezed.dart index af0ad13d6d..d90f6c579a 100644 --- a/lib/entity/schedule.codegen.freezed.dart +++ b/lib/entity/schedule.codegen.freezed.dart @@ -23,47 +23,33 @@ mixin _$Schedule { @JsonKey(includeIfNull: false) String? get id => throw _privateConstructorUsedError; String get title => throw _privateConstructorUsedError; - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get date => throw _privateConstructorUsedError; - LocalNotification? get localNotification => - throw _privateConstructorUsedError; - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + LocalNotification? get localNotification => throw _privateConstructorUsedError; + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get createdDateTime => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $ScheduleCopyWith get copyWith => - throw _privateConstructorUsedError; + $ScheduleCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ScheduleCopyWith<$Res> { - factory $ScheduleCopyWith(Schedule value, $Res Function(Schedule) then) = - _$ScheduleCopyWithImpl<$Res, Schedule>; + factory $ScheduleCopyWith(Schedule value, $Res Function(Schedule) then) = _$ScheduleCopyWithImpl<$Res, Schedule>; @useResult $Res call( {@JsonKey(includeIfNull: false) String? id, String title, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime date, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime date, LocalNotification? localNotification, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime createdDateTime}); + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime createdDateTime}); $LocalNotificationCopyWith<$Res>? get localNotification; } /// @nodoc -class _$ScheduleCopyWithImpl<$Res, $Val extends Schedule> - implements $ScheduleCopyWith<$Res> { +class _$ScheduleCopyWithImpl<$Res, $Val extends Schedule> implements $ScheduleCopyWith<$Res> { _$ScheduleCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -118,37 +104,24 @@ class _$ScheduleCopyWithImpl<$Res, $Val extends Schedule> } /// @nodoc -abstract class _$$ScheduleImplCopyWith<$Res> - implements $ScheduleCopyWith<$Res> { - factory _$$ScheduleImplCopyWith( - _$ScheduleImpl value, $Res Function(_$ScheduleImpl) then) = - __$$ScheduleImplCopyWithImpl<$Res>; +abstract class _$$ScheduleImplCopyWith<$Res> implements $ScheduleCopyWith<$Res> { + factory _$$ScheduleImplCopyWith(_$ScheduleImpl value, $Res Function(_$ScheduleImpl) then) = __$$ScheduleImplCopyWithImpl<$Res>; @override @useResult $Res call( {@JsonKey(includeIfNull: false) String? id, String title, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime date, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime date, LocalNotification? localNotification, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime createdDateTime}); + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime createdDateTime}); @override $LocalNotificationCopyWith<$Res>? get localNotification; } /// @nodoc -class __$$ScheduleImplCopyWithImpl<$Res> - extends _$ScheduleCopyWithImpl<$Res, _$ScheduleImpl> - implements _$$ScheduleImplCopyWith<$Res> { - __$$ScheduleImplCopyWithImpl( - _$ScheduleImpl _value, $Res Function(_$ScheduleImpl) _then) - : super(_value, _then); +class __$$ScheduleImplCopyWithImpl<$Res> extends _$ScheduleCopyWithImpl<$Res, _$ScheduleImpl> implements _$$ScheduleImplCopyWith<$Res> { + __$$ScheduleImplCopyWithImpl(_$ScheduleImpl _value, $Res Function(_$ScheduleImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -191,19 +164,12 @@ class _$ScheduleImpl extends _Schedule { const _$ScheduleImpl( {@JsonKey(includeIfNull: false) this.id, required this.title, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.date, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.date, this.localNotification, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.createdDateTime}) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.createdDateTime}) : super._(); - factory _$ScheduleImpl.fromJson(Map json) => - _$$ScheduleImplFromJson(json); + factory _$ScheduleImpl.fromJson(Map json) => _$$ScheduleImplFromJson(json); @override @JsonKey(includeIfNull: false) @@ -211,16 +177,12 @@ class _$ScheduleImpl extends _Schedule { @override final String title; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime date; @override final LocalNotification? localNotification; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime createdDateTime; @override @@ -236,22 +198,18 @@ class _$ScheduleImpl extends _Schedule { (identical(other.id, id) || other.id == id) && (identical(other.title, title) || other.title == title) && (identical(other.date, date) || other.date == date) && - (identical(other.localNotification, localNotification) || - other.localNotification == localNotification) && - (identical(other.createdDateTime, createdDateTime) || - other.createdDateTime == createdDateTime)); + (identical(other.localNotification, localNotification) || other.localNotification == localNotification) && + (identical(other.createdDateTime, createdDateTime) || other.createdDateTime == createdDateTime)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, id, title, date, localNotification, createdDateTime); + int get hashCode => Object.hash(runtimeType, id, title, date, localNotification, createdDateTime); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ScheduleImplCopyWith<_$ScheduleImpl> get copyWith => - __$$ScheduleImplCopyWithImpl<_$ScheduleImpl>(this, _$identity); + _$$ScheduleImplCopyWith<_$ScheduleImpl> get copyWith => __$$ScheduleImplCopyWithImpl<_$ScheduleImpl>(this, _$identity); @override Map toJson() { @@ -265,19 +223,12 @@ abstract class _Schedule extends Schedule { const factory _Schedule( {@JsonKey(includeIfNull: false) final String? id, required final String title, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime date, + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime date, final LocalNotification? localNotification, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime createdDateTime}) = _$ScheduleImpl; + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime createdDateTime}) = _$ScheduleImpl; const _Schedule._() : super._(); - factory _Schedule.fromJson(Map json) = - _$ScheduleImpl.fromJson; + factory _Schedule.fromJson(Map json) = _$ScheduleImpl.fromJson; @override @JsonKey(includeIfNull: false) @@ -285,21 +236,16 @@ abstract class _Schedule extends Schedule { @override String get title; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get date; @override LocalNotification? get localNotification; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get createdDateTime; @override @JsonKey(ignore: true) - _$$ScheduleImplCopyWith<_$ScheduleImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ScheduleImplCopyWith<_$ScheduleImpl> get copyWith => throw _privateConstructorUsedError; } LocalNotification _$LocalNotificationFromJson(Map json) { @@ -309,34 +255,23 @@ LocalNotification _$LocalNotificationFromJson(Map json) { /// @nodoc mixin _$LocalNotification { int get localNotificationID => throw _privateConstructorUsedError; - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get remindDateTime => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $LocalNotificationCopyWith get copyWith => - throw _privateConstructorUsedError; + $LocalNotificationCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $LocalNotificationCopyWith<$Res> { - factory $LocalNotificationCopyWith( - LocalNotification value, $Res Function(LocalNotification) then) = - _$LocalNotificationCopyWithImpl<$Res, LocalNotification>; + factory $LocalNotificationCopyWith(LocalNotification value, $Res Function(LocalNotification) then) = _$LocalNotificationCopyWithImpl<$Res, LocalNotification>; @useResult - $Res call( - {int localNotificationID, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime remindDateTime}); + $Res call({int localNotificationID, @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime remindDateTime}); } /// @nodoc -class _$LocalNotificationCopyWithImpl<$Res, $Val extends LocalNotification> - implements $LocalNotificationCopyWith<$Res> { +class _$LocalNotificationCopyWithImpl<$Res, $Val extends LocalNotification> implements $LocalNotificationCopyWith<$Res> { _$LocalNotificationCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -364,28 +299,16 @@ class _$LocalNotificationCopyWithImpl<$Res, $Val extends LocalNotification> } /// @nodoc -abstract class _$$LocalNotificationImplCopyWith<$Res> - implements $LocalNotificationCopyWith<$Res> { - factory _$$LocalNotificationImplCopyWith(_$LocalNotificationImpl value, - $Res Function(_$LocalNotificationImpl) then) = - __$$LocalNotificationImplCopyWithImpl<$Res>; +abstract class _$$LocalNotificationImplCopyWith<$Res> implements $LocalNotificationCopyWith<$Res> { + factory _$$LocalNotificationImplCopyWith(_$LocalNotificationImpl value, $Res Function(_$LocalNotificationImpl) then) = __$$LocalNotificationImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {int localNotificationID, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - DateTime remindDateTime}); + $Res call({int localNotificationID, @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime remindDateTime}); } /// @nodoc -class __$$LocalNotificationImplCopyWithImpl<$Res> - extends _$LocalNotificationCopyWithImpl<$Res, _$LocalNotificationImpl> - implements _$$LocalNotificationImplCopyWith<$Res> { - __$$LocalNotificationImplCopyWithImpl(_$LocalNotificationImpl _value, - $Res Function(_$LocalNotificationImpl) _then) - : super(_value, _then); +class __$$LocalNotificationImplCopyWithImpl<$Res> extends _$LocalNotificationCopyWithImpl<$Res, _$LocalNotificationImpl> implements _$$LocalNotificationImplCopyWith<$Res> { + __$$LocalNotificationImplCopyWithImpl(_$LocalNotificationImpl _value, $Res Function(_$LocalNotificationImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -411,22 +334,15 @@ class __$$LocalNotificationImplCopyWithImpl<$Res> @JsonSerializable(explicitToJson: true) class _$LocalNotificationImpl extends _LocalNotification { const _$LocalNotificationImpl( - {required this.localNotificationID, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required this.remindDateTime}) + {required this.localNotificationID, @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required this.remindDateTime}) : super._(); - factory _$LocalNotificationImpl.fromJson(Map json) => - _$$LocalNotificationImplFromJson(json); + factory _$LocalNotificationImpl.fromJson(Map json) => _$$LocalNotificationImplFromJson(json); @override final int localNotificationID; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) final DateTime remindDateTime; @override @@ -439,23 +355,18 @@ class _$LocalNotificationImpl extends _LocalNotification { return identical(this, other) || (other.runtimeType == runtimeType && other is _$LocalNotificationImpl && - (identical(other.localNotificationID, localNotificationID) || - other.localNotificationID == localNotificationID) && - (identical(other.remindDateTime, remindDateTime) || - other.remindDateTime == remindDateTime)); + (identical(other.localNotificationID, localNotificationID) || other.localNotificationID == localNotificationID) && + (identical(other.remindDateTime, remindDateTime) || other.remindDateTime == remindDateTime)); } @JsonKey(ignore: true) @override - int get hashCode => - Object.hash(runtimeType, localNotificationID, remindDateTime); + int get hashCode => Object.hash(runtimeType, localNotificationID, remindDateTime); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$LocalNotificationImplCopyWith<_$LocalNotificationImpl> get copyWith => - __$$LocalNotificationImplCopyWithImpl<_$LocalNotificationImpl>( - this, _$identity); + _$$LocalNotificationImplCopyWith<_$LocalNotificationImpl> get copyWith => __$$LocalNotificationImplCopyWithImpl<_$LocalNotificationImpl>(this, _$identity); @override Map toJson() { @@ -468,24 +379,17 @@ class _$LocalNotificationImpl extends _LocalNotification { abstract class _LocalNotification extends LocalNotification { const factory _LocalNotification( {required final int localNotificationID, - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) - required final DateTime remindDateTime}) = _$LocalNotificationImpl; + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) required final DateTime remindDateTime}) = _$LocalNotificationImpl; const _LocalNotification._() : super._(); - factory _LocalNotification.fromJson(Map json) = - _$LocalNotificationImpl.fromJson; + factory _LocalNotification.fromJson(Map json) = _$LocalNotificationImpl.fromJson; @override int get localNotificationID; @override - @JsonKey( - fromJson: NonNullTimestampConverter.timestampToDateTime, - toJson: NonNullTimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: NonNullTimestampConverter.timestampToDateTime, toJson: NonNullTimestampConverter.dateTimeToTimestamp) DateTime get remindDateTime; @override @JsonKey(ignore: true) - _$$LocalNotificationImplCopyWith<_$LocalNotificationImpl> get copyWith => - throw _privateConstructorUsedError; + _$$LocalNotificationImplCopyWith<_$LocalNotificationImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/entity/schedule.codegen.g.dart b/lib/entity/schedule.codegen.g.dart index e22a24a97f..f6c9d6aff5 100644 --- a/lib/entity/schedule.codegen.g.dart +++ b/lib/entity/schedule.codegen.g.dart @@ -6,18 +6,12 @@ part of 'schedule.codegen.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ScheduleImpl _$$ScheduleImplFromJson(Map json) => - _$ScheduleImpl( +_$ScheduleImpl _$$ScheduleImplFromJson(Map json) => _$ScheduleImpl( id: json['id'] as String?, title: json['title'] as String, - date: NonNullTimestampConverter.timestampToDateTime( - json['date'] as Timestamp), - localNotification: json['localNotification'] == null - ? null - : LocalNotification.fromJson( - json['localNotification'] as Map), - createdDateTime: NonNullTimestampConverter.timestampToDateTime( - json['createdDateTime'] as Timestamp), + date: NonNullTimestampConverter.timestampToDateTime(json['date'] as Timestamp), + localNotification: json['localNotification'] == null ? null : LocalNotification.fromJson(json['localNotification'] as Map), + createdDateTime: NonNullTimestampConverter.timestampToDateTime(json['createdDateTime'] as Timestamp), ); Map _$$ScheduleImplToJson(_$ScheduleImpl instance) { @@ -33,23 +27,16 @@ Map _$$ScheduleImplToJson(_$ScheduleImpl instance) { val['title'] = instance.title; val['date'] = NonNullTimestampConverter.dateTimeToTimestamp(instance.date); val['localNotification'] = instance.localNotification?.toJson(); - val['createdDateTime'] = - NonNullTimestampConverter.dateTimeToTimestamp(instance.createdDateTime); + val['createdDateTime'] = NonNullTimestampConverter.dateTimeToTimestamp(instance.createdDateTime); return val; } -_$LocalNotificationImpl _$$LocalNotificationImplFromJson( - Map json) => - _$LocalNotificationImpl( +_$LocalNotificationImpl _$$LocalNotificationImplFromJson(Map json) => _$LocalNotificationImpl( localNotificationID: (json['localNotificationID'] as num).toInt(), - remindDateTime: NonNullTimestampConverter.timestampToDateTime( - json['remindDateTime'] as Timestamp), + remindDateTime: NonNullTimestampConverter.timestampToDateTime(json['remindDateTime'] as Timestamp), ); -Map _$$LocalNotificationImplToJson( - _$LocalNotificationImpl instance) => - { +Map _$$LocalNotificationImplToJson(_$LocalNotificationImpl instance) => { 'localNotificationID': instance.localNotificationID, - 'remindDateTime': NonNullTimestampConverter.dateTimeToTimestamp( - instance.remindDateTime), + 'remindDateTime': NonNullTimestampConverter.dateTimeToTimestamp(instance.remindDateTime), }; diff --git a/lib/entity/setting.codegen.dart b/lib/entity/setting.codegen.dart index 041faad6a4..6263cd846b 100644 --- a/lib/entity/setting.codegen.dart +++ b/lib/entity/setting.codegen.dart @@ -15,13 +15,11 @@ class ReminderTime with _$ReminderTime { required int minute, }) = _ReminderTime; - factory ReminderTime.fromJson(Map json) => - _$ReminderTimeFromJson(json); + factory ReminderTime.fromJson(Map json) => _$ReminderTimeFromJson(json); DateTime dateTime() { var t = DateTime.now().toLocal(); - return DateTime(t.year, t.month, t.day, hour, minute, t.second, - t.millisecond, t.microsecond); + return DateTime(t.year, t.month, t.day, hour, minute, t.second, t.millisecond, t.microsecond); } static const int maximumCount = 3; @@ -69,19 +67,15 @@ class Setting with _$Setting { required bool isOnReminder, @Default(true) bool isOnNotifyInNotTakenDuration, @Default(false) bool isAutomaticallyCreatePillSheet, - @Default(ReminderNotificationCustomization()) - ReminderNotificationCustomization reminderNotificationCustomization, + @Default(ReminderNotificationCustomization()) ReminderNotificationCustomization reminderNotificationCustomization, // Deprecated // NOTE: [Migrate:PillSheetAppearanceMode] 頃合いを見て強制アップデートして浸透してから削除。since: 2024-10-12 // NOTE: [SyncData:Widget] このプロパティはWidgetに同期されてる。[Migrate:PillSheetAppearanceMode] で削除が完了するタイミングで PillSheetGroupの同様のプロパティで同期を測る - @Deprecated("PillSheetGroupのpillSheetAppearanceModeを使用する") - @Default(PillSheetAppearanceMode.number) - PillSheetAppearanceMode pillSheetAppearanceMode, + @Deprecated("PillSheetGroupのpillSheetAppearanceModeを使用する") @Default(PillSheetAppearanceMode.number) PillSheetAppearanceMode pillSheetAppearanceMode, required String? timezoneDatabaseName, }) = _Setting; - factory Setting.fromJson(Map json) => - _$SettingFromJson(json); + factory Setting.fromJson(Map json) => _$SettingFromJson(json); // NOTE: v3.9.6 で PillSheetType.pillsheet_24_rest_4 を含めた状態でのコード生成をしていなかった // 本来初期設定でpillsheet_24_rest_4を選択したユーザーの pillSheetTypes の値が null が入ってしまっている @@ -105,9 +99,6 @@ class Setting with _$Setting { } } -List backportPillSheetTypes( - List pillSheetTypes) { - return pillSheetTypes - .map((e) => e ?? PillSheetType.pillsheet_24_rest_4) - .toList(); +List backportPillSheetTypes(List pillSheetTypes) { + return pillSheetTypes.map((e) => e ?? PillSheetType.pillsheet_24_rest_4).toList(); } diff --git a/lib/entity/setting.codegen.freezed.dart b/lib/entity/setting.codegen.freezed.dart index 5249fd0de0..bef277fbae 100644 --- a/lib/entity/setting.codegen.freezed.dart +++ b/lib/entity/setting.codegen.freezed.dart @@ -25,22 +25,18 @@ mixin _$ReminderTime { Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $ReminderTimeCopyWith get copyWith => - throw _privateConstructorUsedError; + $ReminderTimeCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ReminderTimeCopyWith<$Res> { - factory $ReminderTimeCopyWith( - ReminderTime value, $Res Function(ReminderTime) then) = - _$ReminderTimeCopyWithImpl<$Res, ReminderTime>; + factory $ReminderTimeCopyWith(ReminderTime value, $Res Function(ReminderTime) then) = _$ReminderTimeCopyWithImpl<$Res, ReminderTime>; @useResult $Res call({int hour, int minute}); } /// @nodoc -class _$ReminderTimeCopyWithImpl<$Res, $Val extends ReminderTime> - implements $ReminderTimeCopyWith<$Res> { +class _$ReminderTimeCopyWithImpl<$Res, $Val extends ReminderTime> implements $ReminderTimeCopyWith<$Res> { _$ReminderTimeCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -68,23 +64,16 @@ class _$ReminderTimeCopyWithImpl<$Res, $Val extends ReminderTime> } /// @nodoc -abstract class _$$ReminderTimeImplCopyWith<$Res> - implements $ReminderTimeCopyWith<$Res> { - factory _$$ReminderTimeImplCopyWith( - _$ReminderTimeImpl value, $Res Function(_$ReminderTimeImpl) then) = - __$$ReminderTimeImplCopyWithImpl<$Res>; +abstract class _$$ReminderTimeImplCopyWith<$Res> implements $ReminderTimeCopyWith<$Res> { + factory _$$ReminderTimeImplCopyWith(_$ReminderTimeImpl value, $Res Function(_$ReminderTimeImpl) then) = __$$ReminderTimeImplCopyWithImpl<$Res>; @override @useResult $Res call({int hour, int minute}); } /// @nodoc -class __$$ReminderTimeImplCopyWithImpl<$Res> - extends _$ReminderTimeCopyWithImpl<$Res, _$ReminderTimeImpl> - implements _$$ReminderTimeImplCopyWith<$Res> { - __$$ReminderTimeImplCopyWithImpl( - _$ReminderTimeImpl _value, $Res Function(_$ReminderTimeImpl) _then) - : super(_value, _then); +class __$$ReminderTimeImplCopyWithImpl<$Res> extends _$ReminderTimeCopyWithImpl<$Res, _$ReminderTimeImpl> implements _$$ReminderTimeImplCopyWith<$Res> { + __$$ReminderTimeImplCopyWithImpl(_$ReminderTimeImpl _value, $Res Function(_$ReminderTimeImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -109,11 +98,9 @@ class __$$ReminderTimeImplCopyWithImpl<$Res> @JsonSerializable(explicitToJson: true) class _$ReminderTimeImpl extends _ReminderTime with DiagnosticableTreeMixin { - const _$ReminderTimeImpl({required this.hour, required this.minute}) - : super._(); + const _$ReminderTimeImpl({required this.hour, required this.minute}) : super._(); - factory _$ReminderTimeImpl.fromJson(Map json) => - _$$ReminderTimeImplFromJson(json); + factory _$ReminderTimeImpl.fromJson(Map json) => _$$ReminderTimeImplFromJson(json); @override final int hour; @@ -137,10 +124,7 @@ class _$ReminderTimeImpl extends _ReminderTime with DiagnosticableTreeMixin { @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ReminderTimeImpl && - (identical(other.hour, hour) || other.hour == hour) && - (identical(other.minute, minute) || other.minute == minute)); + (other.runtimeType == runtimeType && other is _$ReminderTimeImpl && (identical(other.hour, hour) || other.hour == hour) && (identical(other.minute, minute) || other.minute == minute)); } @JsonKey(ignore: true) @@ -150,8 +134,7 @@ class _$ReminderTimeImpl extends _ReminderTime with DiagnosticableTreeMixin { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ReminderTimeImplCopyWith<_$ReminderTimeImpl> get copyWith => - __$$ReminderTimeImplCopyWithImpl<_$ReminderTimeImpl>(this, _$identity); + _$$ReminderTimeImplCopyWith<_$ReminderTimeImpl> get copyWith => __$$ReminderTimeImplCopyWithImpl<_$ReminderTimeImpl>(this, _$identity); @override Map toJson() { @@ -162,13 +145,10 @@ class _$ReminderTimeImpl extends _ReminderTime with DiagnosticableTreeMixin { } abstract class _ReminderTime extends ReminderTime { - const factory _ReminderTime( - {required final int hour, - required final int minute}) = _$ReminderTimeImpl; + const factory _ReminderTime({required final int hour, required final int minute}) = _$ReminderTimeImpl; const _ReminderTime._() : super._(); - factory _ReminderTime.fromJson(Map json) = - _$ReminderTimeImpl.fromJson; + factory _ReminderTime.fromJson(Map json) = _$ReminderTimeImpl.fromJson; @override int get hour; @@ -176,8 +156,7 @@ abstract class _ReminderTime extends ReminderTime { int get minute; @override @JsonKey(ignore: true) - _$$ReminderTimeImplCopyWith<_$ReminderTimeImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ReminderTimeImplCopyWith<_$ReminderTimeImpl> get copyWith => throw _privateConstructorUsedError; } Setting _$SettingFromJson(Map json) { @@ -193,13 +172,11 @@ mixin _$Setting { bool get isOnReminder => throw _privateConstructorUsedError; bool get isOnNotifyInNotTakenDuration => throw _privateConstructorUsedError; bool get isAutomaticallyCreatePillSheet => throw _privateConstructorUsedError; - ReminderNotificationCustomization get reminderNotificationCustomization => - throw _privateConstructorUsedError; // Deprecated + ReminderNotificationCustomization get reminderNotificationCustomization => throw _privateConstructorUsedError; // Deprecated // NOTE: [Migrate:PillSheetAppearanceMode] 頃合いを見て強制アップデートして浸透してから削除。since: 2024-10-12 // NOTE: [SyncData:Widget] このプロパティはWidgetに同期されてる。[Migrate:PillSheetAppearanceMode] で削除が完了するタイミングで PillSheetGroupの同様のプロパティで同期を測る @Deprecated("PillSheetGroupのpillSheetAppearanceModeを使用する") - PillSheetAppearanceMode get pillSheetAppearanceMode => - throw _privateConstructorUsedError; + PillSheetAppearanceMode get pillSheetAppearanceMode => throw _privateConstructorUsedError; String? get timezoneDatabaseName => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @@ -209,8 +186,7 @@ mixin _$Setting { /// @nodoc abstract class $SettingCopyWith<$Res> { - factory $SettingCopyWith(Setting value, $Res Function(Setting) then) = - _$SettingCopyWithImpl<$Res, Setting>; + factory $SettingCopyWith(Setting value, $Res Function(Setting) then) = _$SettingCopyWithImpl<$Res, Setting>; @useResult $Res call( {List pillSheetTypes, @@ -221,17 +197,14 @@ abstract class $SettingCopyWith<$Res> { bool isOnNotifyInNotTakenDuration, bool isAutomaticallyCreatePillSheet, ReminderNotificationCustomization reminderNotificationCustomization, - @Deprecated("PillSheetGroupのpillSheetAppearanceModeを使用する") - PillSheetAppearanceMode pillSheetAppearanceMode, + @Deprecated("PillSheetGroupのpillSheetAppearanceModeを使用する") PillSheetAppearanceMode pillSheetAppearanceMode, String? timezoneDatabaseName}); - $ReminderNotificationCustomizationCopyWith<$Res> - get reminderNotificationCustomization; + $ReminderNotificationCustomizationCopyWith<$Res> get reminderNotificationCustomization; } /// @nodoc -class _$SettingCopyWithImpl<$Res, $Val extends Setting> - implements $SettingCopyWith<$Res> { +class _$SettingCopyWithImpl<$Res, $Val extends Setting> implements $SettingCopyWith<$Res> { _$SettingCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -282,8 +255,7 @@ class _$SettingCopyWithImpl<$Res, $Val extends Setting> ? _value.isAutomaticallyCreatePillSheet : isAutomaticallyCreatePillSheet // ignore: cast_nullable_to_non_nullable as bool, - reminderNotificationCustomization: null == - reminderNotificationCustomization + reminderNotificationCustomization: null == reminderNotificationCustomization ? _value.reminderNotificationCustomization : reminderNotificationCustomization // ignore: cast_nullable_to_non_nullable as ReminderNotificationCustomization, @@ -300,21 +272,16 @@ class _$SettingCopyWithImpl<$Res, $Val extends Setting> @override @pragma('vm:prefer-inline') - $ReminderNotificationCustomizationCopyWith<$Res> - get reminderNotificationCustomization { - return $ReminderNotificationCustomizationCopyWith<$Res>( - _value.reminderNotificationCustomization, (value) { - return _then( - _value.copyWith(reminderNotificationCustomization: value) as $Val); + $ReminderNotificationCustomizationCopyWith<$Res> get reminderNotificationCustomization { + return $ReminderNotificationCustomizationCopyWith<$Res>(_value.reminderNotificationCustomization, (value) { + return _then(_value.copyWith(reminderNotificationCustomization: value) as $Val); }); } } /// @nodoc abstract class _$$SettingImplCopyWith<$Res> implements $SettingCopyWith<$Res> { - factory _$$SettingImplCopyWith( - _$SettingImpl value, $Res Function(_$SettingImpl) then) = - __$$SettingImplCopyWithImpl<$Res>; + factory _$$SettingImplCopyWith(_$SettingImpl value, $Res Function(_$SettingImpl) then) = __$$SettingImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -326,22 +293,16 @@ abstract class _$$SettingImplCopyWith<$Res> implements $SettingCopyWith<$Res> { bool isOnNotifyInNotTakenDuration, bool isAutomaticallyCreatePillSheet, ReminderNotificationCustomization reminderNotificationCustomization, - @Deprecated("PillSheetGroupのpillSheetAppearanceModeを使用する") - PillSheetAppearanceMode pillSheetAppearanceMode, + @Deprecated("PillSheetGroupのpillSheetAppearanceModeを使用する") PillSheetAppearanceMode pillSheetAppearanceMode, String? timezoneDatabaseName}); @override - $ReminderNotificationCustomizationCopyWith<$Res> - get reminderNotificationCustomization; + $ReminderNotificationCustomizationCopyWith<$Res> get reminderNotificationCustomization; } /// @nodoc -class __$$SettingImplCopyWithImpl<$Res> - extends _$SettingCopyWithImpl<$Res, _$SettingImpl> - implements _$$SettingImplCopyWith<$Res> { - __$$SettingImplCopyWithImpl( - _$SettingImpl _value, $Res Function(_$SettingImpl) _then) - : super(_value, _then); +class __$$SettingImplCopyWithImpl<$Res> extends _$SettingCopyWithImpl<$Res, _$SettingImpl> implements _$$SettingImplCopyWith<$Res> { + __$$SettingImplCopyWithImpl(_$SettingImpl _value, $Res Function(_$SettingImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -386,8 +347,7 @@ class __$$SettingImplCopyWithImpl<$Res> ? _value.isAutomaticallyCreatePillSheet : isAutomaticallyCreatePillSheet // ignore: cast_nullable_to_non_nullable as bool, - reminderNotificationCustomization: null == - reminderNotificationCustomization + reminderNotificationCustomization: null == reminderNotificationCustomization ? _value.reminderNotificationCustomization : reminderNotificationCustomization // ignore: cast_nullable_to_non_nullable as ReminderNotificationCustomization, @@ -415,17 +375,14 @@ class _$SettingImpl extends _Setting with DiagnosticableTreeMixin { required this.isOnReminder, this.isOnNotifyInNotTakenDuration = true, this.isAutomaticallyCreatePillSheet = false, - this.reminderNotificationCustomization = - const ReminderNotificationCustomization(), - @Deprecated("PillSheetGroupのpillSheetAppearanceModeを使用する") - this.pillSheetAppearanceMode = PillSheetAppearanceMode.number, + this.reminderNotificationCustomization = const ReminderNotificationCustomization(), + @Deprecated("PillSheetGroupのpillSheetAppearanceModeを使用する") this.pillSheetAppearanceMode = PillSheetAppearanceMode.number, required this.timezoneDatabaseName}) : _pillSheetTypes = pillSheetTypes, _reminderTimes = reminderTimes, super._(); - factory _$SettingImpl.fromJson(Map json) => - _$$SettingImplFromJson(json); + factory _$SettingImpl.fromJson(Map json) => _$$SettingImplFromJson(json); final List _pillSheetTypes; @override @@ -481,19 +438,14 @@ class _$SettingImpl extends _Setting with DiagnosticableTreeMixin { properties ..add(DiagnosticsProperty('type', 'Setting')) ..add(DiagnosticsProperty('pillSheetTypes', pillSheetTypes)) - ..add(DiagnosticsProperty( - 'pillNumberForFromMenstruation', pillNumberForFromMenstruation)) + ..add(DiagnosticsProperty('pillNumberForFromMenstruation', pillNumberForFromMenstruation)) ..add(DiagnosticsProperty('durationMenstruation', durationMenstruation)) ..add(DiagnosticsProperty('reminderTimes', reminderTimes)) ..add(DiagnosticsProperty('isOnReminder', isOnReminder)) - ..add(DiagnosticsProperty( - 'isOnNotifyInNotTakenDuration', isOnNotifyInNotTakenDuration)) - ..add(DiagnosticsProperty( - 'isAutomaticallyCreatePillSheet', isAutomaticallyCreatePillSheet)) - ..add(DiagnosticsProperty('reminderNotificationCustomization', - reminderNotificationCustomization)) - ..add(DiagnosticsProperty( - 'pillSheetAppearanceMode', pillSheetAppearanceMode)) + ..add(DiagnosticsProperty('isOnNotifyInNotTakenDuration', isOnNotifyInNotTakenDuration)) + ..add(DiagnosticsProperty('isAutomaticallyCreatePillSheet', isAutomaticallyCreatePillSheet)) + ..add(DiagnosticsProperty('reminderNotificationCustomization', reminderNotificationCustomization)) + ..add(DiagnosticsProperty('pillSheetAppearanceMode', pillSheetAppearanceMode)) ..add(DiagnosticsProperty('timezoneDatabaseName', timezoneDatabaseName)); } @@ -502,35 +454,16 @@ class _$SettingImpl extends _Setting with DiagnosticableTreeMixin { return identical(this, other) || (other.runtimeType == runtimeType && other is _$SettingImpl && - const DeepCollectionEquality() - .equals(other._pillSheetTypes, _pillSheetTypes) && - (identical(other.pillNumberForFromMenstruation, - pillNumberForFromMenstruation) || - other.pillNumberForFromMenstruation == - pillNumberForFromMenstruation) && - (identical(other.durationMenstruation, durationMenstruation) || - other.durationMenstruation == durationMenstruation) && - const DeepCollectionEquality() - .equals(other._reminderTimes, _reminderTimes) && - (identical(other.isOnReminder, isOnReminder) || - other.isOnReminder == isOnReminder) && - (identical(other.isOnNotifyInNotTakenDuration, - isOnNotifyInNotTakenDuration) || - other.isOnNotifyInNotTakenDuration == - isOnNotifyInNotTakenDuration) && - (identical(other.isAutomaticallyCreatePillSheet, - isAutomaticallyCreatePillSheet) || - other.isAutomaticallyCreatePillSheet == - isAutomaticallyCreatePillSheet) && - (identical(other.reminderNotificationCustomization, - reminderNotificationCustomization) || - other.reminderNotificationCustomization == - reminderNotificationCustomization) && - (identical( - other.pillSheetAppearanceMode, pillSheetAppearanceMode) || - other.pillSheetAppearanceMode == pillSheetAppearanceMode) && - (identical(other.timezoneDatabaseName, timezoneDatabaseName) || - other.timezoneDatabaseName == timezoneDatabaseName)); + const DeepCollectionEquality().equals(other._pillSheetTypes, _pillSheetTypes) && + (identical(other.pillNumberForFromMenstruation, pillNumberForFromMenstruation) || other.pillNumberForFromMenstruation == pillNumberForFromMenstruation) && + (identical(other.durationMenstruation, durationMenstruation) || other.durationMenstruation == durationMenstruation) && + const DeepCollectionEquality().equals(other._reminderTimes, _reminderTimes) && + (identical(other.isOnReminder, isOnReminder) || other.isOnReminder == isOnReminder) && + (identical(other.isOnNotifyInNotTakenDuration, isOnNotifyInNotTakenDuration) || other.isOnNotifyInNotTakenDuration == isOnNotifyInNotTakenDuration) && + (identical(other.isAutomaticallyCreatePillSheet, isAutomaticallyCreatePillSheet) || other.isAutomaticallyCreatePillSheet == isAutomaticallyCreatePillSheet) && + (identical(other.reminderNotificationCustomization, reminderNotificationCustomization) || other.reminderNotificationCustomization == reminderNotificationCustomization) && + (identical(other.pillSheetAppearanceMode, pillSheetAppearanceMode) || other.pillSheetAppearanceMode == pillSheetAppearanceMode) && + (identical(other.timezoneDatabaseName, timezoneDatabaseName) || other.timezoneDatabaseName == timezoneDatabaseName)); } @JsonKey(ignore: true) @@ -551,8 +484,7 @@ class _$SettingImpl extends _Setting with DiagnosticableTreeMixin { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$SettingImplCopyWith<_$SettingImpl> get copyWith => - __$$SettingImplCopyWithImpl<_$SettingImpl>(this, _$identity); + _$$SettingImplCopyWith<_$SettingImpl> get copyWith => __$$SettingImplCopyWithImpl<_$SettingImpl>(this, _$identity); @override Map toJson() { @@ -572,8 +504,7 @@ abstract class _Setting extends Setting { final bool isOnNotifyInNotTakenDuration, final bool isAutomaticallyCreatePillSheet, final ReminderNotificationCustomization reminderNotificationCustomization, - @Deprecated("PillSheetGroupのpillSheetAppearanceModeを使用する") - final PillSheetAppearanceMode pillSheetAppearanceMode, + @Deprecated("PillSheetGroupのpillSheetAppearanceModeを使用する") final PillSheetAppearanceMode pillSheetAppearanceMode, required final String? timezoneDatabaseName}) = _$SettingImpl; const _Setting._() : super._(); @@ -604,6 +535,5 @@ abstract class _Setting extends Setting { String? get timezoneDatabaseName; @override @JsonKey(ignore: true) - _$$SettingImplCopyWith<_$SettingImpl> get copyWith => - throw _privateConstructorUsedError; + _$$SettingImplCopyWith<_$SettingImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/entity/setting.codegen.g.dart b/lib/entity/setting.codegen.g.dart index 111f3241fe..407c5b50cf 100644 --- a/lib/entity/setting.codegen.g.dart +++ b/lib/entity/setting.codegen.g.dart @@ -6,64 +6,41 @@ part of 'setting.codegen.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ReminderTimeImpl _$$ReminderTimeImplFromJson(Map json) => - _$ReminderTimeImpl( +_$ReminderTimeImpl _$$ReminderTimeImplFromJson(Map json) => _$ReminderTimeImpl( hour: (json['hour'] as num).toInt(), minute: (json['minute'] as num).toInt(), ); -Map _$$ReminderTimeImplToJson(_$ReminderTimeImpl instance) => - { +Map _$$ReminderTimeImplToJson(_$ReminderTimeImpl instance) => { 'hour': instance.hour, 'minute': instance.minute, }; -_$SettingImpl _$$SettingImplFromJson(Map json) => - _$SettingImpl( - pillSheetTypes: (json['pillSheetTypes'] as List?) - ?.map((e) => $enumDecodeNullable(_$PillSheetTypeEnumMap, e)) - .toList() ?? - const [], - pillNumberForFromMenstruation: - (json['pillNumberForFromMenstruation'] as num).toInt(), +_$SettingImpl _$$SettingImplFromJson(Map json) => _$SettingImpl( + pillSheetTypes: (json['pillSheetTypes'] as List?)?.map((e) => $enumDecodeNullable(_$PillSheetTypeEnumMap, e)).toList() ?? const [], + pillNumberForFromMenstruation: (json['pillNumberForFromMenstruation'] as num).toInt(), durationMenstruation: (json['durationMenstruation'] as num).toInt(), - reminderTimes: (json['reminderTimes'] as List?) - ?.map((e) => ReminderTime.fromJson(e as Map)) - .toList() ?? - const [], + reminderTimes: (json['reminderTimes'] as List?)?.map((e) => ReminderTime.fromJson(e as Map)).toList() ?? const [], isOnReminder: json['isOnReminder'] as bool, - isOnNotifyInNotTakenDuration: - json['isOnNotifyInNotTakenDuration'] as bool? ?? true, - isAutomaticallyCreatePillSheet: - json['isAutomaticallyCreatePillSheet'] as bool? ?? false, - reminderNotificationCustomization: - json['reminderNotificationCustomization'] == null - ? const ReminderNotificationCustomization() - : ReminderNotificationCustomization.fromJson( - json['reminderNotificationCustomization'] - as Map), - pillSheetAppearanceMode: $enumDecodeNullable( - _$PillSheetAppearanceModeEnumMap, - json['pillSheetAppearanceMode']) ?? - PillSheetAppearanceMode.number, + isOnNotifyInNotTakenDuration: json['isOnNotifyInNotTakenDuration'] as bool? ?? true, + isAutomaticallyCreatePillSheet: json['isAutomaticallyCreatePillSheet'] as bool? ?? false, + reminderNotificationCustomization: json['reminderNotificationCustomization'] == null + ? const ReminderNotificationCustomization() + : ReminderNotificationCustomization.fromJson(json['reminderNotificationCustomization'] as Map), + pillSheetAppearanceMode: $enumDecodeNullable(_$PillSheetAppearanceModeEnumMap, json['pillSheetAppearanceMode']) ?? PillSheetAppearanceMode.number, timezoneDatabaseName: json['timezoneDatabaseName'] as String?, ); -Map _$$SettingImplToJson(_$SettingImpl instance) => - { - 'pillSheetTypes': instance.pillSheetTypes - .map((e) => _$PillSheetTypeEnumMap[e]) - .toList(), +Map _$$SettingImplToJson(_$SettingImpl instance) => { + 'pillSheetTypes': instance.pillSheetTypes.map((e) => _$PillSheetTypeEnumMap[e]).toList(), 'pillNumberForFromMenstruation': instance.pillNumberForFromMenstruation, 'durationMenstruation': instance.durationMenstruation, 'reminderTimes': instance.reminderTimes.map((e) => e.toJson()).toList(), 'isOnReminder': instance.isOnReminder, 'isOnNotifyInNotTakenDuration': instance.isOnNotifyInNotTakenDuration, 'isAutomaticallyCreatePillSheet': instance.isAutomaticallyCreatePillSheet, - 'reminderNotificationCustomization': - instance.reminderNotificationCustomization.toJson(), - 'pillSheetAppearanceMode': - _$PillSheetAppearanceModeEnumMap[instance.pillSheetAppearanceMode]!, + 'reminderNotificationCustomization': instance.reminderNotificationCustomization.toJson(), + 'pillSheetAppearanceMode': _$PillSheetAppearanceModeEnumMap[instance.pillSheetAppearanceMode]!, 'timezoneDatabaseName': instance.timezoneDatabaseName, }; diff --git a/lib/entity/user.codegen.dart b/lib/entity/user.codegen.dart index d92b700b5c..b7b2be3828 100644 --- a/lib/entity/user.codegen.dart +++ b/lib/entity/user.codegen.dart @@ -38,11 +38,9 @@ extension UserPrivateFirestoreFieldKeys on String { class UserPrivate with _$UserPrivate { const UserPrivate._(); const factory UserPrivate({String? fcmToken}) = _UserPrivate; - factory UserPrivate.create({required String fcmToken}) => - UserPrivate(fcmToken: fcmToken); + factory UserPrivate.create({required String fcmToken}) => UserPrivate(fcmToken: fcmToken); - factory UserPrivate.fromJson(Map json) => - _$UserPrivateFromJson(json); + factory UserPrivate.fromJson(Map json) => _$UserPrivateFromJson(json); } extension UserFirestoreFieldKeys on String { @@ -58,8 +56,7 @@ extension UserFirestoreFieldKeys on String { static const purchaseAppID = "purchaseAppID"; static const beginTrialDate = "beginTrialDate"; static const trialDeadlineDate = "trialDeadlineDate"; - static const discountEntitlementDeadlineDate = - "discountEntitlementDeadlineDate"; + static const discountEntitlementDeadlineDate = "discountEntitlementDeadlineDate"; static const shouldAskCancelReason = "shouldAskCancelReason"; // バックエンドと状態を同期するためにisTrialをDBにも保存する。trialDeadlineDateから計算する仕様の統一さよりも、ロジックの単純さを優先する。 @@ -67,8 +64,7 @@ extension UserFirestoreFieldKeys on String { static const isTrial = "isTrial"; // TODO: [NewPillSheetNotification] from:2024-04-30. 2024-07-01 でこの処理を削除する。ある程度機関を置いたら削除するくらいで良い。重要な処理でも無い - static const useLocalNotificationForNewPillSheet = - "useLocalNotificationForNewPillSheet"; + static const useLocalNotificationForNewPillSheet = "useLocalNotificationForNewPillSheet"; } @freezed @@ -108,8 +104,7 @@ class User with _$User { factory User.fromJson(Map json) => _$UserFromJson(json); bool get hasDiscountEntitlement { - final discountEntitlementDeadlineDate = - this.discountEntitlementDeadlineDate; + final discountEntitlementDeadlineDate = this.discountEntitlementDeadlineDate; if (discountEntitlementDeadlineDate == null) { return true; } else { diff --git a/lib/entity/user.codegen.freezed.dart b/lib/entity/user.codegen.freezed.dart index c288ca7d64..0d9704bc5d 100644 --- a/lib/entity/user.codegen.freezed.dart +++ b/lib/entity/user.codegen.freezed.dart @@ -24,22 +24,18 @@ mixin _$UserPrivate { Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $UserPrivateCopyWith get copyWith => - throw _privateConstructorUsedError; + $UserPrivateCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $UserPrivateCopyWith<$Res> { - factory $UserPrivateCopyWith( - UserPrivate value, $Res Function(UserPrivate) then) = - _$UserPrivateCopyWithImpl<$Res, UserPrivate>; + factory $UserPrivateCopyWith(UserPrivate value, $Res Function(UserPrivate) then) = _$UserPrivateCopyWithImpl<$Res, UserPrivate>; @useResult $Res call({String? fcmToken}); } /// @nodoc -class _$UserPrivateCopyWithImpl<$Res, $Val extends UserPrivate> - implements $UserPrivateCopyWith<$Res> { +class _$UserPrivateCopyWithImpl<$Res, $Val extends UserPrivate> implements $UserPrivateCopyWith<$Res> { _$UserPrivateCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -62,23 +58,16 @@ class _$UserPrivateCopyWithImpl<$Res, $Val extends UserPrivate> } /// @nodoc -abstract class _$$UserPrivateImplCopyWith<$Res> - implements $UserPrivateCopyWith<$Res> { - factory _$$UserPrivateImplCopyWith( - _$UserPrivateImpl value, $Res Function(_$UserPrivateImpl) then) = - __$$UserPrivateImplCopyWithImpl<$Res>; +abstract class _$$UserPrivateImplCopyWith<$Res> implements $UserPrivateCopyWith<$Res> { + factory _$$UserPrivateImplCopyWith(_$UserPrivateImpl value, $Res Function(_$UserPrivateImpl) then) = __$$UserPrivateImplCopyWithImpl<$Res>; @override @useResult $Res call({String? fcmToken}); } /// @nodoc -class __$$UserPrivateImplCopyWithImpl<$Res> - extends _$UserPrivateCopyWithImpl<$Res, _$UserPrivateImpl> - implements _$$UserPrivateImplCopyWith<$Res> { - __$$UserPrivateImplCopyWithImpl( - _$UserPrivateImpl _value, $Res Function(_$UserPrivateImpl) _then) - : super(_value, _then); +class __$$UserPrivateImplCopyWithImpl<$Res> extends _$UserPrivateCopyWithImpl<$Res, _$UserPrivateImpl> implements _$$UserPrivateImplCopyWith<$Res> { + __$$UserPrivateImplCopyWithImpl(_$UserPrivateImpl _value, $Res Function(_$UserPrivateImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -99,8 +88,7 @@ class __$$UserPrivateImplCopyWithImpl<$Res> class _$UserPrivateImpl extends _UserPrivate { const _$UserPrivateImpl({this.fcmToken}) : super._(); - factory _$UserPrivateImpl.fromJson(Map json) => - _$$UserPrivateImplFromJson(json); + factory _$UserPrivateImpl.fromJson(Map json) => _$$UserPrivateImplFromJson(json); @override final String? fcmToken; @@ -112,11 +100,7 @@ class _$UserPrivateImpl extends _UserPrivate { @override bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$UserPrivateImpl && - (identical(other.fcmToken, fcmToken) || - other.fcmToken == fcmToken)); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$UserPrivateImpl && (identical(other.fcmToken, fcmToken) || other.fcmToken == fcmToken)); } @JsonKey(ignore: true) @@ -126,8 +110,7 @@ class _$UserPrivateImpl extends _UserPrivate { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$UserPrivateImplCopyWith<_$UserPrivateImpl> get copyWith => - __$$UserPrivateImplCopyWithImpl<_$UserPrivateImpl>(this, _$identity); + _$$UserPrivateImplCopyWith<_$UserPrivateImpl> get copyWith => __$$UserPrivateImplCopyWithImpl<_$UserPrivateImpl>(this, _$identity); @override Map toJson() { @@ -141,15 +124,13 @@ abstract class _UserPrivate extends UserPrivate { const factory _UserPrivate({final String? fcmToken}) = _$UserPrivateImpl; const _UserPrivate._() : super._(); - factory _UserPrivate.fromJson(Map json) = - _$UserPrivateImpl.fromJson; + factory _UserPrivate.fromJson(Map json) = _$UserPrivateImpl.fromJson; @override String? get fcmToken; @override @JsonKey(ignore: true) - _$$UserPrivateImplCopyWith<_$UserPrivateImpl> get copyWith => - throw _privateConstructorUsedError; + _$$UserPrivateImplCopyWith<_$UserPrivateImpl> get copyWith => throw _privateConstructorUsedError; } User _$UserFromJson(Map json) { @@ -165,26 +146,17 @@ mixin _$User { String? get anonymousUserID => throw _privateConstructorUsedError; List get userDocumentIDSets => throw _privateConstructorUsedError; List get anonymousUserIDSets => throw _privateConstructorUsedError; - List get firebaseCurrentUserIDSets => - throw _privateConstructorUsedError; + List get firebaseCurrentUserIDSets => throw _privateConstructorUsedError; bool get isPremium => throw _privateConstructorUsedError; bool get shouldAskCancelReason => throw _privateConstructorUsedError; bool get analyticsDebugIsEnabled => throw _privateConstructorUsedError; - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get beginTrialDate => throw _privateConstructorUsedError; - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get trialDeadlineDate => throw _privateConstructorUsedError; - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? get discountEntitlementDeadlineDate => - throw _privateConstructorUsedError; - dynamic get appliedShareRewardPremiumTrialCount => - throw _privateConstructorUsedError; + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) + DateTime? get discountEntitlementDeadlineDate => throw _privateConstructorUsedError; + dynamic get appliedShareRewardPremiumTrialCount => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -193,8 +165,7 @@ mixin _$User { /// @nodoc abstract class $UserCopyWith<$Res> { - factory $UserCopyWith(User value, $Res Function(User) then) = - _$UserCopyWithImpl<$Res, User>; + factory $UserCopyWith(User value, $Res Function(User) then) = _$UserCopyWithImpl<$Res, User>; @useResult $Res call( {String? id, @@ -207,26 +178,16 @@ abstract class $UserCopyWith<$Res> { bool isPremium, bool shouldAskCancelReason, bool analyticsDebugIsEnabled, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? beginTrialDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? trialDeadlineDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? discountEntitlementDeadlineDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? beginTrialDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? trialDeadlineDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? discountEntitlementDeadlineDate, dynamic appliedShareRewardPremiumTrialCount}); $SettingCopyWith<$Res>? get setting; } /// @nodoc -class _$UserCopyWithImpl<$Res, $Val extends User> - implements $UserCopyWith<$Res> { +class _$UserCopyWithImpl<$Res, $Val extends User> implements $UserCopyWith<$Res> { _$UserCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -301,13 +262,11 @@ class _$UserCopyWithImpl<$Res, $Val extends User> ? _value.trialDeadlineDate : trialDeadlineDate // ignore: cast_nullable_to_non_nullable as DateTime?, - discountEntitlementDeadlineDate: freezed == - discountEntitlementDeadlineDate + discountEntitlementDeadlineDate: freezed == discountEntitlementDeadlineDate ? _value.discountEntitlementDeadlineDate : discountEntitlementDeadlineDate // ignore: cast_nullable_to_non_nullable as DateTime?, - appliedShareRewardPremiumTrialCount: freezed == - appliedShareRewardPremiumTrialCount + appliedShareRewardPremiumTrialCount: freezed == appliedShareRewardPremiumTrialCount ? _value.appliedShareRewardPremiumTrialCount : appliedShareRewardPremiumTrialCount // ignore: cast_nullable_to_non_nullable as dynamic, @@ -329,9 +288,7 @@ class _$UserCopyWithImpl<$Res, $Val extends User> /// @nodoc abstract class _$$UserImplCopyWith<$Res> implements $UserCopyWith<$Res> { - factory _$$UserImplCopyWith( - _$UserImpl value, $Res Function(_$UserImpl) then) = - __$$UserImplCopyWithImpl<$Res>; + factory _$$UserImplCopyWith(_$UserImpl value, $Res Function(_$UserImpl) then) = __$$UserImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -345,18 +302,9 @@ abstract class _$$UserImplCopyWith<$Res> implements $UserCopyWith<$Res> { bool isPremium, bool shouldAskCancelReason, bool analyticsDebugIsEnabled, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? beginTrialDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? trialDeadlineDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - DateTime? discountEntitlementDeadlineDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? beginTrialDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? trialDeadlineDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? discountEntitlementDeadlineDate, dynamic appliedShareRewardPremiumTrialCount}); @override @@ -364,11 +312,8 @@ abstract class _$$UserImplCopyWith<$Res> implements $UserCopyWith<$Res> { } /// @nodoc -class __$$UserImplCopyWithImpl<$Res> - extends _$UserCopyWithImpl<$Res, _$UserImpl> - implements _$$UserImplCopyWith<$Res> { - __$$UserImplCopyWithImpl(_$UserImpl _value, $Res Function(_$UserImpl) _then) - : super(_value, _then); +class __$$UserImplCopyWithImpl<$Res> extends _$UserCopyWithImpl<$Res, _$UserImpl> implements _$$UserImplCopyWith<$Res> { + __$$UserImplCopyWithImpl(_$UserImpl _value, $Res Function(_$UserImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -437,15 +382,11 @@ class __$$UserImplCopyWithImpl<$Res> ? _value.trialDeadlineDate : trialDeadlineDate // ignore: cast_nullable_to_non_nullable as DateTime?, - discountEntitlementDeadlineDate: freezed == - discountEntitlementDeadlineDate + discountEntitlementDeadlineDate: freezed == discountEntitlementDeadlineDate ? _value.discountEntitlementDeadlineDate : discountEntitlementDeadlineDate // ignore: cast_nullable_to_non_nullable as DateTime?, - appliedShareRewardPremiumTrialCount: - freezed == appliedShareRewardPremiumTrialCount - ? _value.appliedShareRewardPremiumTrialCount! - : appliedShareRewardPremiumTrialCount, + appliedShareRewardPremiumTrialCount: freezed == appliedShareRewardPremiumTrialCount ? _value.appliedShareRewardPremiumTrialCount! : appliedShareRewardPremiumTrialCount, )); } } @@ -465,26 +406,16 @@ class _$UserImpl extends _User { this.isPremium = false, this.shouldAskCancelReason = false, this.analyticsDebugIsEnabled = false, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - this.beginTrialDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - this.trialDeadlineDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - this.discountEntitlementDeadlineDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) this.beginTrialDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) this.trialDeadlineDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) this.discountEntitlementDeadlineDate, this.appliedShareRewardPremiumTrialCount = 0}) : _userDocumentIDSets = userDocumentIDSets, _anonymousUserIDSets = anonymousUserIDSets, _firebaseCurrentUserIDSets = firebaseCurrentUserIDSets, super._(); - factory _$UserImpl.fromJson(Map json) => - _$$UserImplFromJson(json); + factory _$UserImpl.fromJson(Map json) => _$$UserImplFromJson(json); @override final String? id; @@ -499,8 +430,7 @@ class _$UserImpl extends _User { @override @JsonKey() List get userDocumentIDSets { - if (_userDocumentIDSets is EqualUnmodifiableListView) - return _userDocumentIDSets; + if (_userDocumentIDSets is EqualUnmodifiableListView) return _userDocumentIDSets; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_userDocumentIDSets); } @@ -509,8 +439,7 @@ class _$UserImpl extends _User { @override @JsonKey() List get anonymousUserIDSets { - if (_anonymousUserIDSets is EqualUnmodifiableListView) - return _anonymousUserIDSets; + if (_anonymousUserIDSets is EqualUnmodifiableListView) return _anonymousUserIDSets; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_anonymousUserIDSets); } @@ -519,8 +448,7 @@ class _$UserImpl extends _User { @override @JsonKey() List get firebaseCurrentUserIDSets { - if (_firebaseCurrentUserIDSets is EqualUnmodifiableListView) - return _firebaseCurrentUserIDSets; + if (_firebaseCurrentUserIDSets is EqualUnmodifiableListView) return _firebaseCurrentUserIDSets; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_firebaseCurrentUserIDSets); } @@ -535,19 +463,13 @@ class _$UserImpl extends _User { @JsonKey() final bool analyticsDebugIsEnabled; @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? beginTrialDate; @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? trialDeadlineDate; @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? discountEntitlementDeadlineDate; @override @JsonKey() @@ -565,34 +487,18 @@ class _$UserImpl extends _User { other is _$UserImpl && (identical(other.id, id) || other.id == id) && (identical(other.setting, setting) || other.setting == setting) && - (identical(other.userIDWhenCreateUser, userIDWhenCreateUser) || - other.userIDWhenCreateUser == userIDWhenCreateUser) && - (identical(other.anonymousUserID, anonymousUserID) || - other.anonymousUserID == anonymousUserID) && - const DeepCollectionEquality() - .equals(other._userDocumentIDSets, _userDocumentIDSets) && - const DeepCollectionEquality() - .equals(other._anonymousUserIDSets, _anonymousUserIDSets) && - const DeepCollectionEquality().equals( - other._firebaseCurrentUserIDSets, _firebaseCurrentUserIDSets) && - (identical(other.isPremium, isPremium) || - other.isPremium == isPremium) && - (identical(other.shouldAskCancelReason, shouldAskCancelReason) || - other.shouldAskCancelReason == shouldAskCancelReason) && - (identical( - other.analyticsDebugIsEnabled, analyticsDebugIsEnabled) || - other.analyticsDebugIsEnabled == analyticsDebugIsEnabled) && - (identical(other.beginTrialDate, beginTrialDate) || - other.beginTrialDate == beginTrialDate) && - (identical(other.trialDeadlineDate, trialDeadlineDate) || - other.trialDeadlineDate == trialDeadlineDate) && - (identical(other.discountEntitlementDeadlineDate, - discountEntitlementDeadlineDate) || - other.discountEntitlementDeadlineDate == - discountEntitlementDeadlineDate) && - const DeepCollectionEquality().equals( - other.appliedShareRewardPremiumTrialCount, - appliedShareRewardPremiumTrialCount)); + (identical(other.userIDWhenCreateUser, userIDWhenCreateUser) || other.userIDWhenCreateUser == userIDWhenCreateUser) && + (identical(other.anonymousUserID, anonymousUserID) || other.anonymousUserID == anonymousUserID) && + const DeepCollectionEquality().equals(other._userDocumentIDSets, _userDocumentIDSets) && + const DeepCollectionEquality().equals(other._anonymousUserIDSets, _anonymousUserIDSets) && + const DeepCollectionEquality().equals(other._firebaseCurrentUserIDSets, _firebaseCurrentUserIDSets) && + (identical(other.isPremium, isPremium) || other.isPremium == isPremium) && + (identical(other.shouldAskCancelReason, shouldAskCancelReason) || other.shouldAskCancelReason == shouldAskCancelReason) && + (identical(other.analyticsDebugIsEnabled, analyticsDebugIsEnabled) || other.analyticsDebugIsEnabled == analyticsDebugIsEnabled) && + (identical(other.beginTrialDate, beginTrialDate) || other.beginTrialDate == beginTrialDate) && + (identical(other.trialDeadlineDate, trialDeadlineDate) || other.trialDeadlineDate == trialDeadlineDate) && + (identical(other.discountEntitlementDeadlineDate, discountEntitlementDeadlineDate) || other.discountEntitlementDeadlineDate == discountEntitlementDeadlineDate) && + const DeepCollectionEquality().equals(other.appliedShareRewardPremiumTrialCount, appliedShareRewardPremiumTrialCount)); } @JsonKey(ignore: true) @@ -617,8 +523,7 @@ class _$UserImpl extends _User { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$UserImplCopyWith<_$UserImpl> get copyWith => - __$$UserImplCopyWithImpl<_$UserImpl>(this, _$identity); + _$$UserImplCopyWith<_$UserImpl> get copyWith => __$$UserImplCopyWithImpl<_$UserImpl>(this, _$identity); @override Map toJson() { @@ -640,18 +545,9 @@ abstract class _User extends User { final bool isPremium, final bool shouldAskCancelReason, final bool analyticsDebugIsEnabled, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - final DateTime? beginTrialDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - final DateTime? trialDeadlineDate, - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) - final DateTime? discountEntitlementDeadlineDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? beginTrialDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? trialDeadlineDate, + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) final DateTime? discountEntitlementDeadlineDate, final dynamic appliedShareRewardPremiumTrialCount}) = _$UserImpl; const _User._() : super._(); @@ -679,24 +575,17 @@ abstract class _User extends User { @override bool get analyticsDebugIsEnabled; @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get beginTrialDate; @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get trialDeadlineDate; @override - @JsonKey( - fromJson: TimestampConverter.timestampToDateTime, - toJson: TimestampConverter.dateTimeToTimestamp) + @JsonKey(fromJson: TimestampConverter.timestampToDateTime, toJson: TimestampConverter.dateTimeToTimestamp) DateTime? get discountEntitlementDeadlineDate; @override dynamic get appliedShareRewardPremiumTrialCount; @override @JsonKey(ignore: true) - _$$UserImplCopyWith<_$UserImpl> get copyWith => - throw _privateConstructorUsedError; + _$$UserImplCopyWith<_$UserImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/entity/user.codegen.g.dart b/lib/entity/user.codegen.g.dart index bd03128d0c..0cbac00121 100644 --- a/lib/entity/user.codegen.g.dart +++ b/lib/entity/user.codegen.g.dart @@ -6,52 +6,32 @@ part of 'user.codegen.dart'; // JsonSerializableGenerator // ************************************************************************** -_$UserPrivateImpl _$$UserPrivateImplFromJson(Map json) => - _$UserPrivateImpl( +_$UserPrivateImpl _$$UserPrivateImplFromJson(Map json) => _$UserPrivateImpl( fcmToken: json['fcmToken'] as String?, ); -Map _$$UserPrivateImplToJson(_$UserPrivateImpl instance) => - { +Map _$$UserPrivateImplToJson(_$UserPrivateImpl instance) => { 'fcmToken': instance.fcmToken, }; _$UserImpl _$$UserImplFromJson(Map json) => _$UserImpl( id: json['id'] as String?, - setting: json['settings'] == null - ? null - : Setting.fromJson(json['settings'] as Map), + setting: json['settings'] == null ? null : Setting.fromJson(json['settings'] as Map), userIDWhenCreateUser: json['userIDWhenCreateUser'] as String?, anonymousUserID: json['anonymousUserID'] as String?, - userDocumentIDSets: (json['userDocumentIDSets'] as List?) - ?.map((e) => e as String) - .toList() ?? - const [], - anonymousUserIDSets: (json['anonymousUserIDSets'] as List?) - ?.map((e) => e as String) - .toList() ?? - const [], - firebaseCurrentUserIDSets: - (json['firebaseCurrentUserIDSets'] as List?) - ?.map((e) => e as String) - .toList() ?? - const [], + userDocumentIDSets: (json['userDocumentIDSets'] as List?)?.map((e) => e as String).toList() ?? const [], + anonymousUserIDSets: (json['anonymousUserIDSets'] as List?)?.map((e) => e as String).toList() ?? const [], + firebaseCurrentUserIDSets: (json['firebaseCurrentUserIDSets'] as List?)?.map((e) => e as String).toList() ?? const [], isPremium: json['isPremium'] as bool? ?? false, shouldAskCancelReason: json['shouldAskCancelReason'] as bool? ?? false, - analyticsDebugIsEnabled: - json['analyticsDebugIsEnabled'] as bool? ?? false, - beginTrialDate: TimestampConverter.timestampToDateTime( - json['beginTrialDate'] as Timestamp?), - trialDeadlineDate: TimestampConverter.timestampToDateTime( - json['trialDeadlineDate'] as Timestamp?), - discountEntitlementDeadlineDate: TimestampConverter.timestampToDateTime( - json['discountEntitlementDeadlineDate'] as Timestamp?), - appliedShareRewardPremiumTrialCount: - json['appliedShareRewardPremiumTrialCount'] ?? 0, + analyticsDebugIsEnabled: json['analyticsDebugIsEnabled'] as bool? ?? false, + beginTrialDate: TimestampConverter.timestampToDateTime(json['beginTrialDate'] as Timestamp?), + trialDeadlineDate: TimestampConverter.timestampToDateTime(json['trialDeadlineDate'] as Timestamp?), + discountEntitlementDeadlineDate: TimestampConverter.timestampToDateTime(json['discountEntitlementDeadlineDate'] as Timestamp?), + appliedShareRewardPremiumTrialCount: json['appliedShareRewardPremiumTrialCount'] ?? 0, ); -Map _$$UserImplToJson(_$UserImpl instance) => - { +Map _$$UserImplToJson(_$UserImpl instance) => { 'id': instance.id, 'settings': instance.setting?.toJson(), 'userIDWhenCreateUser': instance.userIDWhenCreateUser, @@ -62,12 +42,8 @@ Map _$$UserImplToJson(_$UserImpl instance) => 'isPremium': instance.isPremium, 'shouldAskCancelReason': instance.shouldAskCancelReason, 'analyticsDebugIsEnabled': instance.analyticsDebugIsEnabled, - 'beginTrialDate': - TimestampConverter.dateTimeToTimestamp(instance.beginTrialDate), - 'trialDeadlineDate': - TimestampConverter.dateTimeToTimestamp(instance.trialDeadlineDate), - 'discountEntitlementDeadlineDate': TimestampConverter.dateTimeToTimestamp( - instance.discountEntitlementDeadlineDate), - 'appliedShareRewardPremiumTrialCount': - instance.appliedShareRewardPremiumTrialCount, + 'beginTrialDate': TimestampConverter.dateTimeToTimestamp(instance.beginTrialDate), + 'trialDeadlineDate': TimestampConverter.dateTimeToTimestamp(instance.trialDeadlineDate), + 'discountEntitlementDeadlineDate': TimestampConverter.dateTimeToTimestamp(instance.discountEntitlementDeadlineDate), + 'appliedShareRewardPremiumTrialCount': instance.appliedShareRewardPremiumTrialCount, }; diff --git a/lib/entity/weekday.dart b/lib/entity/weekday.dart index b8ea8378bd..a9595b553d 100644 --- a/lib/entity/weekday.dart +++ b/lib/entity/weekday.dart @@ -25,8 +25,7 @@ extension WeekdayFunctions on Weekday { } static List weekdaysForFirstWeekday(Weekday firstWeekday) { - return Weekday.values.sublist(firstWeekday.index) - ..addAll(Weekday.values.sublist(0, firstWeekday.index)); + return Weekday.values.sublist(firstWeekday.index)..addAll(Weekday.values.sublist(0, firstWeekday.index)); } String weekdayString() { diff --git a/lib/entrypoint.dart b/lib/entrypoint.dart index 706c3e7832..5dfb589e16 100644 --- a/lib/entrypoint.dart +++ b/lib/entrypoint.dart @@ -33,9 +33,7 @@ Future entrypoint() async { // また、同じくQuickRecordの処理開始までにMethodChannelが確立されていてほしいのでこの処理はなるべく早く実行する definedChannel(); - HomeWidget.setAppGroupId(Environment.isDevelopment - ? 'group.com.mizuki.Ohashi.Pilll.dev' - : 'group.com.mizuki.Ohashi.Pilll'); + HomeWidget.setAppGroupId(Environment.isDevelopment ? 'group.com.mizuki.Ohashi.Pilll.dev' : 'group.com.mizuki.Ohashi.Pilll'); if (kDebugMode) { overrideDebugPrint(); @@ -66,8 +64,7 @@ Future entrypoint() async { // iOSはmethodChannel経由の方が呼ばれる。iOSはネイティブの方のコードで上書きされる模様。現在はAndroidのために定義 @pragma('vm:entry-point') -Future handleNotificationAction( - NotificationResponse notificationResponse) async { +Future handleNotificationAction(NotificationResponse notificationResponse) async { if (notificationResponse.actionId == actionIdentifier) { await LocalNotificationService.setupTimeZone(); @@ -91,16 +88,12 @@ Future handleNotificationAction( final cancelReminderLocalNotification = CancelReminderLocalNotification(); // エンティティの変更があった場合にdatabaseの読み込みで最新の状態を取得するために、Future.microtaskで更新を待ってから処理を始める // hour,minute,番号を基準にIDを決定しているので、時間変更や番号変更時にそれまで登録されていたIDを特定するのが不可能なので全てキャンセルする - await (Future.microtask(() => null), cancelReminderLocalNotification()) - .wait; + await (Future.microtask(() => null), cancelReminderLocalNotification()).wait; final activePillSheet = pillSheetGroup?.activePillSheet; final user = (await database.userReference().get()).data(); final setting = user?.setting; - if (pillSheetGroup != null && - activePillSheet != null && - user != null && - setting != null) { + if (pillSheetGroup != null && activePillSheet != null && user != null && setting != null) { await RegisterReminderLocalNotification.run( pillSheetGroup: pillSheetGroup, activePillSheet: activePillSheet, diff --git a/lib/features/before_pill_sheet_group_history/component/pill_sheet.dart b/lib/features/before_pill_sheet_group_history/component/pill_sheet.dart index 727491f488..7c0682cfdd 100644 --- a/lib/features/before_pill_sheet_group_history/component/pill_sheet.dart +++ b/lib/features/before_pill_sheet_group_history/component/pill_sheet.dart @@ -24,8 +24,7 @@ class HistoricalPillsheetGroupPagePillSheet extends HookConsumerWidget { final PillSheet pillSheet; final Setting setting; - List get pillSheetTypes => - pillSheetGroup.pillSheets.map((e) => e.pillSheetType).toList(); + List get pillSheetTypes => pillSheetGroup.pillSheets.map((e) => e.pillSheetType).toList(); const HistoricalPillsheetGroupPagePillSheet({ super.key, @@ -36,12 +35,10 @@ class HistoricalPillsheetGroupPagePillSheet extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final weekdayDate = pillSheet.beginingDate.addDays(summarizedRestDuration( - restDurations: pillSheet.restDurations, upperDate: today())); + final weekdayDate = pillSheet.beginingDate.addDays(summarizedRestDuration(restDurations: pillSheet.restDurations, upperDate: today())); final takePill = ref.watch(takePillProvider); final revertTakePill = ref.watch(revertTakePillProvider); - final registerReminderLocalNotification = - ref.watch(registerReminderLocalNotificationProvider); + final registerReminderLocalNotification = ref.watch(registerReminderLocalNotificationProvider); return PillSheetViewLayout( weekdayLines: PillSheetViewWeekdayLine( @@ -55,8 +52,7 @@ class HistoricalPillsheetGroupPagePillSheet extends HookConsumerWidget { context, takePill: takePill, revertTakePill: revertTakePill, - registerReminderLocalNotification: - registerReminderLocalNotification, + registerReminderLocalNotification: registerReminderLocalNotification, lineIndex: index, pageIndex: pillSheet.groupIndex, ), @@ -70,17 +66,14 @@ class HistoricalPillsheetGroupPagePillSheet extends HookConsumerWidget { BuildContext context, { required TakePill takePill, required RevertTakePill revertTakePill, - required RegisterReminderLocalNotification - registerReminderLocalNotification, + required RegisterReminderLocalNotification registerReminderLocalNotification, required int lineIndex, required int pageIndex, }) { final lineNumber = lineIndex + 1; int countOfPillMarksInLine = Weekday.values.length; - if (lineNumber * Weekday.values.length > - pillSheet.pillSheetType.totalCount) { - int diff = pillSheet.pillSheetType.totalCount - - lineIndex * Weekday.values.length; + if (lineNumber * Weekday.values.length > pillSheet.pillSheetType.totalCount) { + int diff = pillSheet.pillSheetType.totalCount - lineIndex * Weekday.values.length; countOfPillMarksInLine = diff; } @@ -89,9 +82,7 @@ class HistoricalPillsheetGroupPagePillSheet extends HookConsumerWidget { return Container(width: PillSheetViewLayout.componentWidth); } - final pillNumberInPillSheet = - PillMarkWithNumberLayoutHelper.calcPillNumberIntoPillSheet( - columnIndex, lineIndex); + final pillNumberInPillSheet = PillMarkWithNumberLayoutHelper.calcPillNumberIntoPillSheet(columnIndex, lineIndex); return SizedBox( width: PillSheetViewLayout.componentWidth, child: PillMarkWithNumberLayout( @@ -146,10 +137,7 @@ PillMarkType pillMarkFor({ required PillSheet pillSheet, }) { if (pillNumberInPillSheet > pillSheet.typeInfo.dosingPeriod) { - return (pillSheet.pillSheetType == PillSheetType.pillsheet_21 || - pillSheet.pillSheetType == PillSheetType.pillsheet_24_rest_4) - ? PillMarkType.rest - : PillMarkType.fake; + return (pillSheet.pillSheetType == PillSheetType.pillsheet_21 || pillSheet.pillSheetType == PillSheetType.pillsheet_24_rest_4) ? PillMarkType.rest : PillMarkType.fake; } if (pillNumberInPillSheet <= pillSheet.lastTakenPillNumber) { return PillMarkType.done; @@ -184,8 +172,7 @@ bool shouldPillMarkAnimation({ return false; } - return pillNumberInPillSheet > activePillSheet.lastTakenPillNumber && - pillNumberInPillSheet <= activePillSheet.todayPillNumber; + return pillNumberInPillSheet > activePillSheet.lastTakenPillNumber && pillNumberInPillSheet <= activePillSheet.todayPillNumber; } class PillNumber extends StatelessWidget { @@ -195,23 +182,13 @@ class PillNumber extends StatelessWidget { final int pageIndex; final int pillNumberInPillSheet; - const PillNumber( - {super.key, - required this.pillSheetGroup, - required this.pillSheet, - required this.setting, - required this.pageIndex, - required this.pillNumberInPillSheet}); + const PillNumber({super.key, required this.pillSheetGroup, required this.pillSheet, required this.setting, required this.pageIndex, required this.pillNumberInPillSheet}); @override Widget build(BuildContext context) { - final menstruationDateRanges = - pillSheetGroup.menstruationDateRanges(setting: setting); + final menstruationDateRanges = pillSheetGroup.menstruationDateRanges(setting: setting); - final containedMenstruationDuration = menstruationDateRanges - .where((e) => - e.inRange(pillSheet.displayPillTakeDate(pillNumberInPillSheet))) - .isNotEmpty; + final containedMenstruationDuration = menstruationDateRanges.where((e) => e.inRange(pillSheet.displayPillTakeDate(pillNumberInPillSheet))).isNotEmpty; final text = pillSheetGroup.displayPillNumber( premiumOrTrial: true, diff --git a/lib/features/before_pill_sheet_group_history/component/pill_sheet_modified_history_list.dart b/lib/features/before_pill_sheet_group_history/component/pill_sheet_modified_history_list.dart index d2dd4c47ee..5c4ed32646 100644 --- a/lib/features/before_pill_sheet_group_history/component/pill_sheet_modified_history_list.dart +++ b/lib/features/before_pill_sheet_group_history/component/pill_sheet_modified_history_list.dart @@ -5,8 +5,7 @@ import 'package:pilll/entity/pill_sheet.codegen.dart'; import 'package:pilll/features/calendar/components/pill_sheet_modified_history/pill_sheet_modified_history_list.dart'; import 'package:pilll/provider/pill_sheet_modified_history.dart'; -class BeforePillSheetGroupHistoryPagePillSheetModifiedHistoryList - extends HookConsumerWidget { +class BeforePillSheetGroupHistoryPagePillSheetModifiedHistoryList extends HookConsumerWidget { final PillSheet pillSheet; const BeforePillSheetGroupHistoryPagePillSheetModifiedHistoryList({ @@ -18,10 +17,7 @@ class BeforePillSheetGroupHistoryPagePillSheetModifiedHistoryList final begin = pillSheet.beginingDate; final end = pillSheet.estimatedEndTakenDate; - return ref - .watch( - pillSheetModifiedHistoriesWithRangeProvider(begin: begin, end: end)) - .when( + return ref.watch(pillSheetModifiedHistoriesWithRangeProvider(begin: begin, end: end)).when( data: (pillSheetModifiedHistories) { return PillSheetModifiedHistoryList( pillSheetModifiedHistories: pillSheetModifiedHistories, diff --git a/lib/features/before_pill_sheet_group_history/page.dart b/lib/features/before_pill_sheet_group_history/page.dart index e7de949238..c8f2840e6f 100644 --- a/lib/features/before_pill_sheet_group_history/page.dart +++ b/lib/features/before_pill_sheet_group_history/page.dart @@ -74,10 +74,7 @@ class _Page extends HookConsumerWidget { } final currentPillSheet = useState(pillSheetGroup.pillSheets[0]); - final pageController = usePageController( - initialPage: 0, - viewportFraction: (PillSheetViewLayout.width + 20) / - MediaQuery.of(context).size.width); + final pageController = usePageController(initialPage: 0, viewportFraction: (PillSheetViewLayout.width + 20) / MediaQuery.of(context).size.width); pageController.addListener(() { final page = pageController.page?.toInt(); if (page == null) { @@ -86,10 +83,8 @@ class _Page extends HookConsumerWidget { final pillSheet = pillSheetGroup.pillSheets[page]; currentPillSheet.value = pillSheet; }); - final begin = DateTimeFormatter.slashYearAndMonthAndDay( - currentPillSheet.value.beginingDate); - final end = DateTimeFormatter.slashYearAndMonthAndDay( - currentPillSheet.value.estimatedEndTakenDate); + final begin = DateTimeFormatter.slashYearAndMonthAndDay(currentPillSheet.value.beginingDate); + final end = DateTimeFormatter.slashYearAndMonthAndDay(currentPillSheet.value.estimatedEndTakenDate); return Scaffold( backgroundColor: PilllColors.background, @@ -111,20 +106,12 @@ class _Page extends HookConsumerWidget { Text( "$begin ~ $end", textAlign: TextAlign.center, - style: const TextStyle( - fontFamily: FontFamily.japanese, - fontSize: 17, - fontWeight: FontWeight.w600, - color: TextColor.main), + style: const TextStyle(fontFamily: FontFamily.japanese, fontSize: 17, fontWeight: FontWeight.w600, color: TextColor.main), ), const SizedBox(height: 20), SizedBox( height: PillSheetViewLayout.calcHeight( - PillSheetViewLayout.mostLargePillSheetType(pillSheetGroup - .pillSheets - .map((e) => e.pillSheetType) - .toList()) - .numberOfLineInPillSheet, + PillSheetViewLayout.mostLargePillSheetType(pillSheetGroup.pillSheets.map((e) => e.pillSheetType).toList()).numberOfLineInPillSheet, false, ), child: PageView( @@ -160,8 +147,7 @@ class _Page extends HookConsumerWidget { ], Padding( padding: const EdgeInsets.only(left: 24, right: 24), - child: - BeforePillSheetGroupHistoryPagePillSheetModifiedHistoryList( + child: BeforePillSheetGroupHistoryPagePillSheetModifiedHistoryList( pillSheet: currentPillSheet.value, ), ), @@ -172,8 +158,7 @@ class _Page extends HookConsumerWidget { } } -extension BeforePillSheetGroupHistoryPageRoute - on BeforePillSheetGroupHistoryPage { +extension BeforePillSheetGroupHistoryPageRoute on BeforePillSheetGroupHistoryPage { static Route route() { return MaterialPageRoute( settings: const RouteSettings(name: "BeforePillSheetGroupHistoryPage"), diff --git a/lib/features/calendar/components/diary_or_schedule/diary_or_schedule_sheet.dart b/lib/features/calendar/components/diary_or_schedule/diary_or_schedule_sheet.dart index f7c8a8a69f..23e359eaa8 100644 --- a/lib/features/calendar/components/diary_or_schedule/diary_or_schedule_sheet.dart +++ b/lib/features/calendar/components/diary_or_schedule/diary_or_schedule_sheet.dart @@ -8,8 +8,7 @@ class DiaryOrScheduleSheet extends StatelessWidget { final VoidCallback showDiary; final VoidCallback showSchedule; - const DiaryOrScheduleSheet( - {super.key, required this.showDiary, required this.showSchedule}); + const DiaryOrScheduleSheet({super.key, required this.showDiary, required this.showSchedule}); @override Widget build(BuildContext context) { @@ -26,20 +25,14 @@ class DiaryOrScheduleSheet extends StatelessWidget { onTap: () => showDiary(), leading: const Icon(Icons.note_alt), ), - _tile( - title: "予定を記入", - onTap: () => showSchedule(), - leading: const Icon(Icons.event)), + _tile(title: "予定を記入", onTap: () => showSchedule(), leading: const Icon(Icons.event)), ], ), ), ); } - Widget _tile( - {required String title, - required VoidCallback onTap, - required Widget leading}) { + Widget _tile({required String title, required VoidCallback onTap, required Widget leading}) { return SizedBox( height: _tileHeight, child: ListTile( diff --git a/lib/features/calendar/components/month_calendar/month_calendar.dart b/lib/features/calendar/components/month_calendar/month_calendar.dart index 635e51d532..9fe38645ad 100644 --- a/lib/features/calendar/components/month_calendar/month_calendar.dart +++ b/lib/features/calendar/components/month_calendar/month_calendar.dart @@ -15,8 +15,7 @@ import 'package:pilll/provider/schedule.dart'; class MonthCalendar extends HookConsumerWidget { final DateTime dateForMonth; - final Widget Function(BuildContext, List, List, DateRange) - weekCalendarBuilder; + final Widget Function(BuildContext, List, List, DateRange) weekCalendarBuilder; const MonthCalendar({ super.key, @@ -28,14 +27,10 @@ class MonthCalendar extends HookConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { useEffect(() { // Prefetch - ref.read(diariesForMonthProvider( - DateTime(dateForMonth.year, dateForMonth.month + 1, 1))); - ref.read(diariesForMonthProvider( - DateTime(dateForMonth.year, dateForMonth.month - 1, 1))); - ref.read(schedulesForMonthProvider( - DateTime(dateForMonth.year, dateForMonth.month + 1, 1))); - ref.read(schedulesForMonthProvider( - DateTime(dateForMonth.year, dateForMonth.month - 1, 1))); + ref.read(diariesForMonthProvider(DateTime(dateForMonth.year, dateForMonth.month + 1, 1))); + ref.read(diariesForMonthProvider(DateTime(dateForMonth.year, dateForMonth.month - 1, 1))); + ref.read(schedulesForMonthProvider(DateTime(dateForMonth.year, dateForMonth.month + 1, 1))); + ref.read(schedulesForMonthProvider(DateTime(dateForMonth.year, dateForMonth.month - 1, 1))); return null; }, [dateForMonth]); return AsyncValueGroup.group2( @@ -71,8 +66,7 @@ class MonthCalendar extends HookConsumerWidget { ); } - final weekCalendar = weekCalendarBuilder( - context, diaries, schedules, weeks[offset]); + final weekCalendar = weekCalendarBuilder(context, diaries, schedules, weeks[offset]); return Column( children: [ weekCalendar, @@ -88,10 +82,6 @@ class MonthCalendar extends HookConsumerWidget { ); } - WeekCalendarDateRangeCalculator get _calculator => - WeekCalendarDateRangeCalculator(dateForMonth); - List get _weeks => - List.generate(_calculator.weeklineCount(), (index) => index + 1) - .map((line) => _calculator.dateRangeOfLine(line)) - .toList(); + WeekCalendarDateRangeCalculator get _calculator => WeekCalendarDateRangeCalculator(dateForMonth); + List get _weeks => List.generate(_calculator.weeklineCount(), (index) => index + 1).map((line) => _calculator.dateRangeOfLine(line)).toList(); } diff --git a/lib/features/calendar/components/pill_sheet_modified_history/components/core/day.dart b/lib/features/calendar/components/pill_sheet_modified_history/components/core/day.dart index ed1d83cf0f..eb9b513ec6 100644 --- a/lib/features/calendar/components/pill_sheet_modified_history/components/core/day.dart +++ b/lib/features/calendar/components/pill_sheet_modified_history/components/core/day.dart @@ -9,8 +9,7 @@ class Day extends StatelessWidget { const Day({super.key, required this.estimatedEventCausingDate}); int get _day => estimatedEventCausingDate.day; - Weekday get _weekday => - WeekdayFunctions.weekdayFromDate(estimatedEventCausingDate); + Weekday get _weekday => WeekdayFunctions.weekdayFromDate(estimatedEventCausingDate); @override Widget build(BuildContext context) { diff --git a/lib/features/calendar/components/pill_sheet_modified_history/components/core/pill_number.dart b/lib/features/calendar/components/pill_sheet_modified_history/components/core/pill_number.dart index b1201173c7..f2f7918c51 100644 --- a/lib/features/calendar/components/pill_sheet_modified_history/components/core/pill_number.dart +++ b/lib/features/calendar/components/pill_sheet_modified_history/components/core/pill_number.dart @@ -29,9 +29,7 @@ class PillNumber extends StatelessWidget { abstract class PillSheetModifiedHistoryPillNumberOrDate { static String hyphen() => "-"; - static String taken( - {required int beforeLastTakenPillNumber, - required int afterLastTakenPillNumber}) { + static String taken({required int beforeLastTakenPillNumber, required int afterLastTakenPillNumber}) { // beforePillSheetの最後に飲んだ番号+1から服用記録が始まる final left = beforeLastTakenPillNumber + 1; // 1度飲みの時に本日分を服用した場合は1錠分の服用履歴を表示する @@ -41,9 +39,7 @@ abstract class PillSheetModifiedHistoryPillNumberOrDate { return "$left-$afterLastTakenPillNumber番"; } - static String autoTaken( - {required int beforeLastTakenPillNumber, - required int afterLastTakenPillNumber}) { + static String autoTaken({required int beforeLastTakenPillNumber, required int afterLastTakenPillNumber}) { // beforePillSheetの最後に飲んだ番号+1から服用記録が始まる final left = beforeLastTakenPillNumber + 1; if (left == afterLastTakenPillNumber) { @@ -52,22 +48,16 @@ abstract class PillSheetModifiedHistoryPillNumberOrDate { return "$left-$afterLastTakenPillNumber番"; } - static String revert( - {required int beforeLastTakenPillNumber, - required int afterLastTakenPillNumber}) { + static String revert({required int beforeLastTakenPillNumber, required int afterLastTakenPillNumber}) { if (beforeLastTakenPillNumber == (afterLastTakenPillNumber + 1)) { return "$beforeLastTakenPillNumber番"; } return "$beforeLastTakenPillNumber-${afterLastTakenPillNumber + 1}番"; } - static String changedPillNumber( - {required int beforeTodayPillNumber, - required int afterTodayPillNumber}) => - "$beforeTodayPillNumber→$afterTodayPillNumber番"; + static String changedPillNumber({required int beforeTodayPillNumber, required int afterTodayPillNumber}) => "$beforeTodayPillNumber→$afterTodayPillNumber番"; - static String changedBeginDisplayNumberSetting( - ChangedBeginDisplayNumberValue value) { + static String changedBeginDisplayNumberSetting(ChangedBeginDisplayNumberValue value) { final before = value.beforeDisplayNumberSetting; if (before == null || before.beginPillNumber == null) { return "1→${value.afterDisplayNumberSetting.beginPillNumber}番"; @@ -75,8 +65,7 @@ abstract class PillSheetModifiedHistoryPillNumberOrDate { return "${before.beginPillNumber}→${value.afterDisplayNumberSetting.beginPillNumber}番"; } - static String changedEndDisplayNumberSetting( - ChangedEndDisplayNumberValue value) { + static String changedEndDisplayNumberSetting(ChangedEndDisplayNumberValue value) { final before = value.beforeDisplayNumberSetting; if (before == null || before.endPillNumber == null) { return "1→${value.afterDisplayNumberSetting.endPillNumber}番"; @@ -84,8 +73,7 @@ abstract class PillSheetModifiedHistoryPillNumberOrDate { return "${before.endPillNumber}→${value.afterDisplayNumberSetting.endPillNumber}番"; } - static String pillSheetCount(List pillSheetIDs) => - pillSheetIDs.isNotEmpty ? "${pillSheetIDs.length}枚" : hyphen(); + static String pillSheetCount(List pillSheetIDs) => pillSheetIDs.isNotEmpty ? "${pillSheetIDs.length}枚" : hyphen(); static String changedRestDuration(ChangedRestDurationValue value) { final before = value.beforeRestDuration; @@ -102,8 +90,7 @@ abstract class PillSheetModifiedHistoryPillNumberOrDate { return "${f(before.beginDate)}~${f(beforeEnd)}\n↓\n${f(after.beginDate)}~${f(afterEnd)}"; } - static String changedRestDurationBeginDate( - ChangedRestDurationBeginDateValue value) { + static String changedRestDurationBeginDate(ChangedRestDurationBeginDateValue value) { final before = value.beforeRestDuration; final after = value.afterRestDuration; diff --git a/lib/features/calendar/components/pill_sheet_modified_history/components/core/taken_pill_action_o_list.dart b/lib/features/calendar/components/pill_sheet_modified_history/components/core/taken_pill_action_o_list.dart index b6d2369edc..f4f0917eb7 100644 --- a/lib/features/calendar/components/pill_sheet_modified_history/components/core/taken_pill_action_o_list.dart +++ b/lib/features/calendar/components/pill_sheet_modified_history/components/core/taken_pill_action_o_list.dart @@ -23,27 +23,18 @@ class TakenPillActionOList extends StatelessWidget { if (beforePillSheet.groupIndex != afterPillSheet.groupIndex) { return SvgPicture.asset("images/dots.svg"); } - final count = max( - value.afterLastTakenPillNumber - (value.beforeLastTakenPillNumber), 1); + final count = max(value.afterLastTakenPillNumber - (value.beforeLastTakenPillNumber), 1); return Row( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: List.generate(min(count, 4), (index) { - final inRestDuration = _inRestDuration( - afterPillSheet, value.afterLastTakenPillNumber, index); + final inRestDuration = _inRestDuration(afterPillSheet, value.afterLastTakenPillNumber, index); if (index == 0) { - return inRestDuration - ? SvgPicture.asset("images/dash_o.svg") - : SvgPicture.asset("images/o.svg"); + return inRestDuration ? SvgPicture.asset("images/dash_o.svg") : SvgPicture.asset("images/o.svg"); } else if (index < 3) { - return _halfOWidgetWithTransform( - inRestDuration - ? SvgPicture.asset("images/dash_half_o.svg") - : SvgPicture.asset("images/half_o.svg"), - index); + return _halfOWidgetWithTransform(inRestDuration ? SvgPicture.asset("images/dash_half_o.svg") : SvgPicture.asset("images/half_o.svg"), index); } else { - return _dotsWidgetWithTransform( - SvgPicture.asset("images/dots.svg")); + return _dotsWidgetWithTransform(SvgPicture.asset("images/dots.svg")); } }).toList()); } @@ -66,8 +57,7 @@ class TakenPillActionOList extends StatelessWidget { ); } - bool _inRestDuration( - PillSheet afterPillSheet, int afterLastTakenPillNumber, int index) { + bool _inRestDuration(PillSheet afterPillSheet, int afterLastTakenPillNumber, int index) { final pillNumber = afterLastTakenPillNumber - index; return afterPillSheet.pillSheetType.dosingPeriod < pillNumber; } diff --git a/lib/features/calendar/components/pill_sheet_modified_history/components/pill_sheet_modified_history_monthly_header.dart b/lib/features/calendar/components/pill_sheet_modified_history/components/pill_sheet_modified_history_monthly_header.dart index 0479f66e20..585726e7bb 100644 --- a/lib/features/calendar/components/pill_sheet_modified_history/components/pill_sheet_modified_history_monthly_header.dart +++ b/lib/features/calendar/components/pill_sheet_modified_history/components/pill_sheet_modified_history_monthly_header.dart @@ -6,8 +6,7 @@ import 'package:pilll/utils/formatter/date_time_formatter.dart'; class PillSheetModifiedHistoryMonthlyHeader extends StatelessWidget { final DateTime dateTimeOfMonth; - const PillSheetModifiedHistoryMonthlyHeader( - {super.key, required this.dateTimeOfMonth}); + const PillSheetModifiedHistoryMonthlyHeader({super.key, required this.dateTimeOfMonth}); @override Widget build(BuildContext context) { diff --git a/lib/features/calendar/components/pill_sheet_modified_history/components/pill_sheet_modified_history_more_button.dart b/lib/features/calendar/components/pill_sheet_modified_history/components/pill_sheet_modified_history_more_button.dart index 7809b92ed8..aa7503cede 100644 --- a/lib/features/calendar/components/pill_sheet_modified_history/components/pill_sheet_modified_history_more_button.dart +++ b/lib/features/calendar/components/pill_sheet_modified_history/components/pill_sheet_modified_history_more_button.dart @@ -22,8 +22,7 @@ class PillSheetModifiedHistoryMoreButton extends StatelessWidget { onPressed: () async { analytics.logEvent(name: "pill_sheet_modified_history_more"); if (user.isPremium || user.isTrial) { - Navigator.of(context) - .push(PillSheetModifiedHistoriesPageRoute.route()); + Navigator.of(context).push(PillSheetModifiedHistoriesPageRoute.route()); } else { showPremiumIntroductionSheet(context); } diff --git a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_automatically_recorded_last_taken_date_action.dart b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_automatically_recorded_last_taken_date_action.dart index 7685ae2571..087f12c0ab 100644 --- a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_automatically_recorded_last_taken_date_action.dart +++ b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_automatically_recorded_last_taken_date_action.dart @@ -5,8 +5,7 @@ import 'package:pilll/features/calendar/components/pill_sheet_modified_history/c import 'package:pilll/features/calendar/components/pill_sheet_modified_history/components/core/pill_number.dart'; import 'package:pilll/features/calendar/components/pill_sheet_modified_history/components/core/row_layout.dart'; -class PillSheetModifiedHistoryAutomaticallyRecordedLastTakenDateAction - extends StatelessWidget { +class PillSheetModifiedHistoryAutomaticallyRecordedLastTakenDateAction extends StatelessWidget { final DateTime estimatedEventCausingDate; final int? beforeLastTakenPillNumber; final int? afterLastTakenPillNumber; diff --git a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_began_rest_duration.dart b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_began_rest_duration.dart index cb5354c5d1..9fe4beb4c2 100644 --- a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_began_rest_duration.dart +++ b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_began_rest_duration.dart @@ -24,8 +24,7 @@ class PillSheetModifiedHistoryBeganRestDuration extends StatelessWidget { } return RowLayout( day: Day(estimatedEventCausingDate: estimatedEventCausingDate), - pillNumbersOrHyphenOrDate: PillNumber( - pillNumber: PillSheetModifiedHistoryPillNumberOrDate.hyphen()), + pillNumbersOrHyphenOrDate: PillNumber(pillNumber: PillSheetModifiedHistoryPillNumberOrDate.hyphen()), detail: const Text( "服用お休み", style: TextStyle( diff --git a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_begin_display_number_action.dart b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_begin_display_number_action.dart index 0f163d97a2..3636952a8f 100644 --- a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_begin_display_number_action.dart +++ b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_begin_display_number_action.dart @@ -6,8 +6,7 @@ import 'package:pilll/features/calendar/components/pill_sheet_modified_history/c import 'package:pilll/features/calendar/components/pill_sheet_modified_history/components/core/row_layout.dart'; import 'package:pilll/entity/pill_sheet_modified_history_value.codegen.dart'; -class PillSheetModifiedHistoryChangedBeginDisplayNumberAction - extends StatelessWidget { +class PillSheetModifiedHistoryChangedBeginDisplayNumberAction extends StatelessWidget { final DateTime estimatedEventCausingDate; final ChangedBeginDisplayNumberValue? value; @@ -24,9 +23,7 @@ class PillSheetModifiedHistoryChangedBeginDisplayNumberAction } return RowLayout( day: Day(estimatedEventCausingDate: estimatedEventCausingDate), - pillNumbersOrHyphenOrDate: PillNumber( - pillNumber: PillSheetModifiedHistoryPillNumberOrDate - .changedBeginDisplayNumberSetting(value)), + pillNumbersOrHyphenOrDate: PillNumber(pillNumber: PillSheetModifiedHistoryPillNumberOrDate.changedBeginDisplayNumberSetting(value)), detail: const Text( "服用日数の始まりを変更", style: TextStyle( diff --git a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_changed_pill_number_action.dart b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_changed_pill_number_action.dart index 9d36e4f341..8623f743e5 100644 --- a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_changed_pill_number_action.dart +++ b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_changed_pill_number_action.dart @@ -26,8 +26,7 @@ class PillSheetModifiedHistoryChangedPillNumberAction extends StatelessWidget { return RowLayout( day: Day(estimatedEventCausingDate: estimatedEventCausingDate), pillNumbersOrHyphenOrDate: PillNumber( - pillNumber: - PillSheetModifiedHistoryPillNumberOrDate.changedPillNumber( + pillNumber: PillSheetModifiedHistoryPillNumberOrDate.changedPillNumber( beforeTodayPillNumber: beforeTodayPillNumber, afterTodayPillNumber: afterTodayPillNumber, )), diff --git a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_changed_rest_duration.dart b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_changed_rest_duration.dart index 8ae54573d4..7ec76633b5 100644 --- a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_changed_rest_duration.dart +++ b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_changed_rest_duration.dart @@ -24,10 +24,7 @@ class PillSheetModifiedHistoryChangedRestDuration extends StatelessWidget { } return RowLayout( day: Day(estimatedEventCausingDate: estimatedEventCausingDate), - pillNumbersOrHyphenOrDate: PillNumber( - pillNumber: - PillSheetModifiedHistoryPillNumberOrDate.changedRestDuration( - value)), + pillNumbersOrHyphenOrDate: PillNumber(pillNumber: PillSheetModifiedHistoryPillNumberOrDate.changedRestDuration(value)), detail: const Text( "服用お休み期間変更", style: TextStyle( diff --git a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_created_pill_sheet_action.dart b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_created_pill_sheet_action.dart index 5b19f64ddd..326d3c4e70 100644 --- a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_created_pill_sheet_action.dart +++ b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_created_pill_sheet_action.dart @@ -19,9 +19,7 @@ class PillSheetModifiedHistoryCreatePillSheetAction extends StatelessWidget { Widget build(BuildContext context) { return RowLayout( day: Day(estimatedEventCausingDate: estimatedEventCausingDate), - pillNumbersOrHyphenOrDate: PillNumber( - pillNumber: PillSheetModifiedHistoryPillNumberOrDate.pillSheetCount( - pillSheetIDs)), + pillNumbersOrHyphenOrDate: PillNumber(pillNumber: PillSheetModifiedHistoryPillNumberOrDate.pillSheetCount(pillSheetIDs)), detail: const Text( "ピルシート追加", style: TextStyle( diff --git a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_deleted_pill_sheet_action.dart b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_deleted_pill_sheet_action.dart index 37759be516..612339d4c3 100644 --- a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_deleted_pill_sheet_action.dart +++ b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_deleted_pill_sheet_action.dart @@ -19,9 +19,7 @@ class PillSheetModifiedHistoryDeletedPillSheetAction extends StatelessWidget { Widget build(BuildContext context) { return RowLayout( day: Day(estimatedEventCausingDate: estimatedEventCausingDate), - pillNumbersOrHyphenOrDate: PillNumber( - pillNumber: PillSheetModifiedHistoryPillNumberOrDate.pillSheetCount( - pillSheetIDs ?? [])), + pillNumbersOrHyphenOrDate: PillNumber(pillNumber: PillSheetModifiedHistoryPillNumberOrDate.pillSheetCount(pillSheetIDs ?? [])), detail: const Text( "ピルシート破棄", style: TextStyle( diff --git a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_end_display_number_action.dart b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_end_display_number_action.dart index 900e562af1..0fbc07e917 100644 --- a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_end_display_number_action.dart +++ b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_end_display_number_action.dart @@ -6,8 +6,7 @@ import 'package:pilll/features/calendar/components/pill_sheet_modified_history/c import 'package:pilll/features/calendar/components/pill_sheet_modified_history/components/core/row_layout.dart'; import 'package:pilll/entity/pill_sheet_modified_history_value.codegen.dart'; -class PillSheetModifiedHistoryChangedEndDisplayNumberAction - extends StatelessWidget { +class PillSheetModifiedHistoryChangedEndDisplayNumberAction extends StatelessWidget { final DateTime estimatedEventCausingDate; final ChangedEndDisplayNumberValue? value; @@ -24,9 +23,7 @@ class PillSheetModifiedHistoryChangedEndDisplayNumberAction } return RowLayout( day: Day(estimatedEventCausingDate: estimatedEventCausingDate), - pillNumbersOrHyphenOrDate: PillNumber( - pillNumber: PillSheetModifiedHistoryPillNumberOrDate - .changedEndDisplayNumberSetting(value)), + pillNumbersOrHyphenOrDate: PillNumber(pillNumber: PillSheetModifiedHistoryPillNumberOrDate.changedEndDisplayNumberSetting(value)), detail: const Text( "服用日数の終わりを変更", style: TextStyle( diff --git a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_ended_rest_duration.dart b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_ended_rest_duration.dart index 0b0608e297..a63d632b4d 100644 --- a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_ended_rest_duration.dart +++ b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_ended_rest_duration.dart @@ -24,8 +24,7 @@ class PillSheetModifiedHistoryEndedRestDuration extends StatelessWidget { } return RowLayout( day: Day(estimatedEventCausingDate: estimatedEventCausingDate), - pillNumbersOrHyphenOrDate: PillNumber( - pillNumber: PillSheetModifiedHistoryPillNumberOrDate.hyphen()), + pillNumbersOrHyphenOrDate: PillNumber(pillNumber: PillSheetModifiedHistoryPillNumberOrDate.hyphen()), detail: const Text( "服用再開", style: TextStyle( diff --git a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_rest_duration_begin_date.dart b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_rest_duration_begin_date.dart index c477cd6ead..bc0136c1c5 100644 --- a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_rest_duration_begin_date.dart +++ b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_rest_duration_begin_date.dart @@ -6,8 +6,7 @@ import 'package:pilll/features/calendar/components/pill_sheet_modified_history/c import 'package:pilll/features/calendar/components/pill_sheet_modified_history/components/core/row_layout.dart'; import 'package:pilll/entity/pill_sheet_modified_history_value.codegen.dart'; -class PillSheetModifiedHistoryChangedRestDurationBeginDate - extends StatelessWidget { +class PillSheetModifiedHistoryChangedRestDurationBeginDate extends StatelessWidget { final DateTime estimatedEventCausingDate; final ChangedRestDurationBeginDateValue? value; @@ -25,9 +24,7 @@ class PillSheetModifiedHistoryChangedRestDurationBeginDate } return RowLayout( day: Day(estimatedEventCausingDate: estimatedEventCausingDate), - pillNumbersOrHyphenOrDate: PillNumber( - pillNumber: PillSheetModifiedHistoryPillNumberOrDate - .changedRestDurationBeginDate(value)), + pillNumbersOrHyphenOrDate: PillNumber(pillNumber: PillSheetModifiedHistoryPillNumberOrDate.changedRestDurationBeginDate(value)), detail: const Text( "服用お休み開始日変更", style: TextStyle( diff --git a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_taken_pill_action.dart b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_taken_pill_action.dart index 74eccf2e02..dc75903da4 100644 --- a/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_taken_pill_action.dart +++ b/lib/features/calendar/components/pill_sheet_modified_history/components/rows/pill_sheet_modified_history_taken_pill_action.dart @@ -34,8 +34,7 @@ class PillSheetModifiedHistoryTakenPillAction extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final setPillSheetModifiedHistory = - ref.watch(setPillSheetModifiedHistoryProvider); + final setPillSheetModifiedHistory = ref.watch(setPillSheetModifiedHistoryProvider); final value = this.value; final beforePillSheet = this.beforePillSheet; final afterPillSheet = this.afterPillSheet; @@ -55,12 +54,7 @@ class PillSheetModifiedHistoryTakenPillAction extends HookConsumerWidget { return DateAndTimePicker( initialDateTime: estimatedEventCausingDate, done: (dateTime) async { - analytics.logEvent( - name: "selected_date_taken_history", - parameters: { - "hour": dateTime.hour, - "minute": dateTime.minute - }); + analytics.logEvent(name: "selected_date_taken_history", parameters: {"hour": dateTime.hour, "minute": dateTime.minute}); try { final messenger = ScaffoldMessenger.of(context); @@ -72,9 +66,7 @@ class PillSheetModifiedHistoryTakenPillAction extends HookConsumerWidget { value: history.value, takenPillValue: value, ); - final date = - DateTimeFormatter.slashYearAndMonthAndDayAndTime( - dateTime); + final date = DateTimeFormatter.slashYearAndMonthAndDayAndTime(dateTime); messenger.showSnackBar( SnackBar( duration: const Duration(seconds: 2), @@ -83,9 +75,7 @@ class PillSheetModifiedHistoryTakenPillAction extends HookConsumerWidget { ); navigator.pop(); } catch (error) { - if (context.mounted) - showErrorAlert( - context, '更新に失敗しました。通信環境をお確かめの上、再度変更してください'); + if (context.mounted) showErrorAlert(context, '更新に失敗しました。通信環境をお確かめの上、再度変更してください'); } }, ); diff --git a/lib/features/calendar/components/pill_sheet_modified_history/pill_sheet_modified_history_card.dart b/lib/features/calendar/components/pill_sheet_modified_history/pill_sheet_modified_history_card.dart index 9b7d4da02f..cac57cc775 100644 --- a/lib/features/calendar/components/pill_sheet_modified_history/pill_sheet_modified_history_card.dart +++ b/lib/features/calendar/components/pill_sheet_modified_history/pill_sheet_modified_history_card.dart @@ -29,19 +29,12 @@ class CalendarPillSheetModifiedHistoryCardState { required this.trialDeadlineDate, }); - bool get moreButtonIsShown => - _allPillSheetModifiedHistories.length > - CalendarPillSheetModifiedHistoryCardState - .pillSheetModifiedHistoriesThreshold; + bool get moreButtonIsShown => _allPillSheetModifiedHistories.length > CalendarPillSheetModifiedHistoryCardState.pillSheetModifiedHistoriesThreshold; List get pillSheetModifiedHistories { - if (_allPillSheetModifiedHistories.length > - CalendarPillSheetModifiedHistoryCardState - .pillSheetModifiedHistoriesThreshold) { + if (_allPillSheetModifiedHistories.length > CalendarPillSheetModifiedHistoryCardState.pillSheetModifiedHistoriesThreshold) { final copied = [..._allPillSheetModifiedHistories]; copied.removeRange( - CalendarPillSheetModifiedHistoryCardState - .pillSheetModifiedHistoriesThreshold - - 1, + CalendarPillSheetModifiedHistoryCardState.pillSheetModifiedHistoriesThreshold - 1, copied.length, ); return copied; @@ -65,8 +58,7 @@ class CalendarPillSheetModifiedHistoryCard extends StatelessWidget { Widget build(BuildContext context) { return AppCard( child: Container( - padding: - const EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 16), + padding: const EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -100,10 +92,7 @@ class CalendarPillSheetModifiedHistoryCard extends StatelessWidget { premiumOrTrial: user.premiumOrTrial, ), ), - if (histories.length > - CalendarPillSheetModifiedHistoryCardState - .pillSheetModifiedHistoriesThreshold) - PillSheetModifiedHistoryMoreButton(user: user), + if (histories.length > CalendarPillSheetModifiedHistoryCardState.pillSheetModifiedHistoriesThreshold) PillSheetModifiedHistoryMoreButton(user: user), ]; } else { return [ @@ -130,8 +119,7 @@ class CalendarPillSheetModifiedHistoryCard extends StatelessWidget { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - const Text(lockEmoji, - style: TextStyle(fontSize: 40)), + const Text(lockEmoji, style: TextStyle(fontSize: 40)), const SizedBox(height: 12), const Text( "服用履歴はプレミアム機能です", @@ -149,8 +137,7 @@ class CalendarPillSheetModifiedHistoryCard extends StatelessWidget { text: "くわしくみる", onPressed: () async { analytics.logEvent( - name: - "pressed_show_detail_pill_sheet_history", + name: "pressed_show_detail_pill_sheet_history", ); showPremiumIntroductionSheet(context); }, diff --git a/lib/features/calendar/components/pill_sheet_modified_history/pill_sheet_modified_history_list.dart b/lib/features/calendar/components/pill_sheet_modified_history/pill_sheet_modified_history_list.dart index d4d352db9f..620bad2184 100644 --- a/lib/features/calendar/components/pill_sheet_modified_history/pill_sheet_modified_history_list.dart +++ b/lib/features/calendar/components/pill_sheet_modified_history/pill_sheet_modified_history_list.dart @@ -43,15 +43,11 @@ class PillSheetModifiedHistoryList extends HookConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { return Column( crossAxisAlignment: CrossAxisAlignment.start, - children: _summarizedForEachMonth - .map((model) => _monthlyHeaderAndRelativedHistories(ref, model)) - .expand((element) => element) - .toList(), + children: _summarizedForEachMonth.map((model) => _monthlyHeaderAndRelativedHistories(ref, model)).expand((element) => element).toList(), ); } - List _monthlyHeaderAndRelativedHistories( - WidgetRef ref, PillSheetModifiedHistoryListModel model) { + List _monthlyHeaderAndRelativedHistories(WidgetRef ref, PillSheetModifiedHistoryListModel model) { var dirtyIndex = 0; return [ @@ -59,15 +55,11 @@ class PillSheetModifiedHistoryList extends HookConsumerWidget { dateTimeOfMonth: model.dateTimeOfMonth, ), const SizedBox(height: 16), - ...model.pillSheetModifiedHistories - .where((history) => history.enumActionType != null) - .map((history) { + ...model.pillSheetModifiedHistories.where((history) => history.enumActionType != null).map((history) { var isNecessaryDots = false; if (dirtyIndex != 0) { - final previousHistory = - model.pillSheetModifiedHistories[dirtyIndex - 1]; - final diff = daysBetween(previousHistory.estimatedEventCausingDate, - history.estimatedEventCausingDate); + final previousHistory = model.pillSheetModifiedHistories[dirtyIndex - 1]; + final diff = daysBetween(previousHistory.estimatedEventCausingDate, history.estimatedEventCausingDate); if (diff > 1) { isNecessaryDots = true; } @@ -77,102 +69,75 @@ class PillSheetModifiedHistoryList extends HookConsumerWidget { final Widget content; if (history.version == "v2") { content = switch (history.enumActionType) { - PillSheetModifiedActionType.createdPillSheet => - PillSheetModifiedHistoryCreatePillSheetAction( + PillSheetModifiedActionType.createdPillSheet => PillSheetModifiedHistoryCreatePillSheetAction( estimatedEventCausingDate: history.estimatedEventCausingDate, pillSheetIDs: history.afterPillSheetGroup?.pillSheetIDs ?? [], ), - PillSheetModifiedActionType.automaticallyRecordedLastTakenDate => - PillSheetModifiedHistoryAutomaticallyRecordedLastTakenDateAction( - estimatedEventCausingDate: history.estimatedEventCausingDate, - beforeLastTakenPillNumber: - history.beforePillSheetGroup?.pillSheets - .findFirstDifferencePillSheet( - history.afterPillSheetGroup?.pillSheets, - ) - ?.lastTakenPillNumber, - afterLastTakenPillNumber: - history.afterPillSheetGroup?.pillSheets.reversed - .findFirstDifferencePillSheet( - history.beforePillSheetGroup?.pillSheets.reversed, - ) - ?.lastTakenPillNumber), + PillSheetModifiedActionType.automaticallyRecordedLastTakenDate => PillSheetModifiedHistoryAutomaticallyRecordedLastTakenDateAction( + estimatedEventCausingDate: history.estimatedEventCausingDate, + beforeLastTakenPillNumber: history.beforePillSheetGroup?.pillSheets + .findFirstDifferencePillSheet( + history.afterPillSheetGroup?.pillSheets, + ) + ?.lastTakenPillNumber, + afterLastTakenPillNumber: history.afterPillSheetGroup?.pillSheets.reversed + .findFirstDifferencePillSheet( + history.beforePillSheetGroup?.pillSheets.reversed, + ) + ?.lastTakenPillNumber), PillSheetModifiedActionType.deletedPillSheet => - PillSheetModifiedHistoryDeletedPillSheetAction( - estimatedEventCausingDate: history.estimatedEventCausingDate, - pillSheetIDs: history.afterPillSheetGroup?.pillSheetIDs), - PillSheetModifiedActionType.takenPill => - PillSheetModifiedHistoryTakenPillAction( + PillSheetModifiedHistoryDeletedPillSheetAction(estimatedEventCausingDate: history.estimatedEventCausingDate, pillSheetIDs: history.afterPillSheetGroup?.pillSheetIDs), + PillSheetModifiedActionType.takenPill => PillSheetModifiedHistoryTakenPillAction( premiumOrTrial: premiumOrTrial, estimatedEventCausingDate: history.estimatedEventCausingDate, history: history, value: history.value.takenPill, - beforePillSheet: history.beforePillSheetGroup?.pillSheets - .findFirstDifferencePillSheet( + beforePillSheet: history.beforePillSheetGroup?.pillSheets.findFirstDifferencePillSheet( history.afterPillSheetGroup?.pillSheets, ), - afterPillSheet: history.afterPillSheetGroup?.pillSheets.reversed - .findFirstDifferencePillSheet( + afterPillSheet: history.afterPillSheetGroup?.pillSheets.reversed.findFirstDifferencePillSheet( history.beforePillSheetGroup?.pillSheets.reversed, ), ), // NOTE: revertTakenPill は findFirstDifferencePillSheetの向きはtakenPill等とは逆になる。なぜならbeforeの方がafterよりも後ろのピルシートの服用記録になるから、beforeの場合は後ろから(reversed)探索する - PillSheetModifiedActionType.revertTakenPill => - PillSheetModifiedHistoryRevertTakenPillAction( + PillSheetModifiedActionType.revertTakenPill => PillSheetModifiedHistoryRevertTakenPillAction( estimatedEventCausingDate: history.estimatedEventCausingDate, - beforeLastTakenPillNumber: history - .beforePillSheetGroup?.pillSheets.reversed + beforeLastTakenPillNumber: history.beforePillSheetGroup?.pillSheets.reversed.findFirstDifferencePillSheet(history.afterPillSheetGroup?.pillSheets.reversed)?.lastTakenPillNumber, + afterLastTakenPillNumber: history.afterPillSheetGroup?.pillSheets .findFirstDifferencePillSheet( - history.afterPillSheetGroup?.pillSheets.reversed) + history.beforePillSheetGroup?.pillSheets, + ) ?.lastTakenPillNumber, - afterLastTakenPillNumber: - history.afterPillSheetGroup?.pillSheets - .findFirstDifferencePillSheet( - history.beforePillSheetGroup?.pillSheets, - ) - ?.lastTakenPillNumber, ), - PillSheetModifiedActionType.changedPillNumber => - PillSheetModifiedHistoryChangedPillNumberAction( + PillSheetModifiedActionType.changedPillNumber => PillSheetModifiedHistoryChangedPillNumberAction( estimatedEventCausingDate: history.estimatedEventCausingDate, - beforeTodayPillNumber: history.beforeActivePillSheet - ?.pillNumberFor( - targetDate: history.estimatedEventCausingDate), - afterTodayPillNumber: history.afterActivePillSheet - ?.pillNumberFor( - targetDate: history.estimatedEventCausingDate), + beforeTodayPillNumber: history.beforeActivePillSheet?.pillNumberFor(targetDate: history.estimatedEventCausingDate), + afterTodayPillNumber: history.afterActivePillSheet?.pillNumberFor(targetDate: history.estimatedEventCausingDate), ), - PillSheetModifiedActionType.endedPillSheet => - PillSheetModifiedHistoryEndedPillSheetAction( + PillSheetModifiedActionType.endedPillSheet => PillSheetModifiedHistoryEndedPillSheetAction( value: history.value.endedPillSheet, ), - PillSheetModifiedActionType.beganRestDuration => - PillSheetModifiedHistoryBeganRestDuration( + PillSheetModifiedActionType.beganRestDuration => PillSheetModifiedHistoryBeganRestDuration( estimatedEventCausingDate: history.estimatedEventCausingDate, value: history.value.beganRestDurationValue, ), - PillSheetModifiedActionType.endedRestDuration => - PillSheetModifiedHistoryEndedRestDuration( + PillSheetModifiedActionType.endedRestDuration => PillSheetModifiedHistoryEndedRestDuration( estimatedEventCausingDate: history.estimatedEventCausingDate, value: history.value.endedRestDurationValue, ), - PillSheetModifiedActionType.changedBeginDisplayNumber => - PillSheetModifiedHistoryChangedBeginDisplayNumberAction( + PillSheetModifiedActionType.changedBeginDisplayNumber => PillSheetModifiedHistoryChangedBeginDisplayNumberAction( estimatedEventCausingDate: history.estimatedEventCausingDate, value: history.value.changedBeginDisplayNumber, ), - PillSheetModifiedActionType.changedEndDisplayNumber => - PillSheetModifiedHistoryChangedEndDisplayNumberAction( + PillSheetModifiedActionType.changedEndDisplayNumber => PillSheetModifiedHistoryChangedEndDisplayNumberAction( estimatedEventCausingDate: history.estimatedEventCausingDate, value: history.value.changedEndDisplayNumber, ), - PillSheetModifiedActionType.changedRestDurationBeginDate => - PillSheetModifiedHistoryChangedRestDurationBeginDate( + PillSheetModifiedActionType.changedRestDurationBeginDate => PillSheetModifiedHistoryChangedRestDurationBeginDate( estimatedEventCausingDate: history.estimatedEventCausingDate, value: history.value.changedRestDurationBeginDateValue, ), - PillSheetModifiedActionType.changedRestDuration => - PillSheetModifiedHistoryChangedRestDuration( + PillSheetModifiedActionType.changedRestDuration => PillSheetModifiedHistoryChangedRestDuration( estimatedEventCausingDate: history.estimatedEventCausingDate, value: history.value.changedRestDurationValue, ), @@ -181,31 +146,20 @@ class PillSheetModifiedHistoryList extends HookConsumerWidget { }; } else { content = switch (history.enumActionType) { - PillSheetModifiedActionType.createdPillSheet => - PillSheetModifiedHistoryCreatePillSheetAction( + PillSheetModifiedActionType.createdPillSheet => PillSheetModifiedHistoryCreatePillSheetAction( estimatedEventCausingDate: history.estimatedEventCausingDate, - pillSheetIDs: - history.value.createdPillSheet?.pillSheetIDs ?? [], + pillSheetIDs: history.value.createdPillSheet?.pillSheetIDs ?? [], ), - PillSheetModifiedActionType.automaticallyRecordedLastTakenDate => - PillSheetModifiedHistoryAutomaticallyRecordedLastTakenDateAction( + PillSheetModifiedActionType.automaticallyRecordedLastTakenDate => PillSheetModifiedHistoryAutomaticallyRecordedLastTakenDateAction( estimatedEventCausingDate: history.estimatedEventCausingDate, - beforeLastTakenPillNumber: history - .value - .automaticallyRecordedLastTakenDate - ?.beforeLastTakenPillNumber, - afterLastTakenPillNumber: history - .value - .automaticallyRecordedLastTakenDate - ?.afterLastTakenPillNumber, + beforeLastTakenPillNumber: history.value.automaticallyRecordedLastTakenDate?.beforeLastTakenPillNumber, + afterLastTakenPillNumber: history.value.automaticallyRecordedLastTakenDate?.afterLastTakenPillNumber, ), - PillSheetModifiedActionType.deletedPillSheet => - PillSheetModifiedHistoryDeletedPillSheetAction( + PillSheetModifiedActionType.deletedPillSheet => PillSheetModifiedHistoryDeletedPillSheetAction( estimatedEventCausingDate: history.estimatedEventCausingDate, pillSheetIDs: history.value.deletedPillSheet?.pillSheetIDs, ), - PillSheetModifiedActionType.takenPill => - PillSheetModifiedHistoryTakenPillAction( + PillSheetModifiedActionType.takenPill => PillSheetModifiedHistoryTakenPillAction( premiumOrTrial: premiumOrTrial, estimatedEventCausingDate: history.estimatedEventCausingDate, history: history, @@ -213,53 +167,40 @@ class PillSheetModifiedHistoryList extends HookConsumerWidget { beforePillSheet: history.before, afterPillSheet: history.after, ), - PillSheetModifiedActionType.revertTakenPill => - PillSheetModifiedHistoryRevertTakenPillAction( + PillSheetModifiedActionType.revertTakenPill => PillSheetModifiedHistoryRevertTakenPillAction( estimatedEventCausingDate: history.estimatedEventCausingDate, - beforeLastTakenPillNumber: - history.value.revertTakenPill?.beforeLastTakenPillNumber, - afterLastTakenPillNumber: - history.value.revertTakenPill?.afterLastTakenPillNumber, + beforeLastTakenPillNumber: history.value.revertTakenPill?.beforeLastTakenPillNumber, + afterLastTakenPillNumber: history.value.revertTakenPill?.afterLastTakenPillNumber, ), - PillSheetModifiedActionType.changedPillNumber => - PillSheetModifiedHistoryChangedPillNumberAction( + PillSheetModifiedActionType.changedPillNumber => PillSheetModifiedHistoryChangedPillNumberAction( estimatedEventCausingDate: history.estimatedEventCausingDate, - beforeTodayPillNumber: - history.value.changedPillNumber?.beforeTodayPillNumber, - afterTodayPillNumber: - history.value.changedPillNumber?.afterTodayPillNumber, + beforeTodayPillNumber: history.value.changedPillNumber?.beforeTodayPillNumber, + afterTodayPillNumber: history.value.changedPillNumber?.afterTodayPillNumber, ), - PillSheetModifiedActionType.endedPillSheet => - PillSheetModifiedHistoryEndedPillSheetAction( + PillSheetModifiedActionType.endedPillSheet => PillSheetModifiedHistoryEndedPillSheetAction( value: history.value.endedPillSheet, ), - PillSheetModifiedActionType.beganRestDuration => - PillSheetModifiedHistoryBeganRestDuration( + PillSheetModifiedActionType.beganRestDuration => PillSheetModifiedHistoryBeganRestDuration( estimatedEventCausingDate: history.estimatedEventCausingDate, value: history.value.beganRestDurationValue, ), - PillSheetModifiedActionType.endedRestDuration => - PillSheetModifiedHistoryEndedRestDuration( + PillSheetModifiedActionType.endedRestDuration => PillSheetModifiedHistoryEndedRestDuration( estimatedEventCausingDate: history.estimatedEventCausingDate, value: history.value.endedRestDurationValue, ), - PillSheetModifiedActionType.changedBeginDisplayNumber => - PillSheetModifiedHistoryChangedBeginDisplayNumberAction( + PillSheetModifiedActionType.changedBeginDisplayNumber => PillSheetModifiedHistoryChangedBeginDisplayNumberAction( estimatedEventCausingDate: history.estimatedEventCausingDate, value: history.value.changedBeginDisplayNumber, ), - PillSheetModifiedActionType.changedEndDisplayNumber => - PillSheetModifiedHistoryChangedEndDisplayNumberAction( + PillSheetModifiedActionType.changedEndDisplayNumber => PillSheetModifiedHistoryChangedEndDisplayNumberAction( estimatedEventCausingDate: history.estimatedEventCausingDate, value: history.value.changedEndDisplayNumber, ), - PillSheetModifiedActionType.changedRestDurationBeginDate => - PillSheetModifiedHistoryChangedRestDurationBeginDate( + PillSheetModifiedActionType.changedRestDurationBeginDate => PillSheetModifiedHistoryChangedRestDurationBeginDate( estimatedEventCausingDate: history.estimatedEventCausingDate, value: history.value.changedRestDurationBeginDateValue, ), - PillSheetModifiedActionType.changedRestDuration => - PillSheetModifiedHistoryChangedRestDuration( + PillSheetModifiedActionType.changedRestDuration => PillSheetModifiedHistoryChangedRestDuration( estimatedEventCausingDate: history.estimatedEventCausingDate, value: history.value.changedRestDurationValue, ), @@ -325,8 +266,7 @@ class PillSheetModifiedHistoryList extends HookConsumerWidget { extension on Iterable { // NOTE: メソッドのレシーバーと引数のreversedの状態は基本揃える - PillSheet? findFirstDifferencePillSheet( - Iterable? otherPillSheets) { + PillSheet? findFirstDifferencePillSheet(Iterable? otherPillSheets) { if (otherPillSheets == null) { return null; } diff --git a/lib/features/calendar/components/title/calendar_page_title.dart b/lib/features/calendar/components/title/calendar_page_title.dart index b14c0edae1..ec0a162bd0 100644 --- a/lib/features/calendar/components/title/calendar_page_title.dart +++ b/lib/features/calendar/components/title/calendar_page_title.dart @@ -27,10 +27,7 @@ class CalendarPageTitle extends StatelessWidget { onPressed: () { final previousMonthIndex = page.value - 1; - analytics.logEvent(name: "pressed_previous_month", parameters: { - "current_index": page.value, - "previous_index": previousMonthIndex - }); + analytics.logEvent(name: "pressed_previous_month", parameters: {"current_index": page.value, "previous_index": previousMonthIndex}); pageController.jumpToPage(previousMonthIndex); page.value = previousMonthIndex; @@ -50,10 +47,7 @@ class CalendarPageTitle extends StatelessWidget { onPressed: () { final nextMonthIndex = page.value + 1; - analytics.logEvent(name: "pressed_next_month", parameters: { - "current_index": page.value, - "next_index": nextMonthIndex - }); + analytics.logEvent(name: "pressed_next_month", parameters: {"current_index": page.value, "next_index": nextMonthIndex}); pageController.jumpToPage(nextMonthIndex); page.value = nextMonthIndex; @@ -63,6 +57,5 @@ class CalendarPageTitle extends StatelessWidget { ); } - String get _displayMonthString => - DateTimeFormatter.yearAndMonth(displayedMonth); + String get _displayMonthString => DateTimeFormatter.yearAndMonth(displayedMonth); } diff --git a/lib/features/calendar/page.dart b/lib/features/calendar/page.dart index d2bd7d89fc..5700e13368 100644 --- a/lib/features/calendar/page.dart +++ b/lib/features/calendar/page.dart @@ -37,12 +37,8 @@ import 'package:pilll/utils/emoji/emoji.dart'; // NOTE: 数字に特に意味はないが、ユーザーが過去のカレンダーも見たいということで十分な枠をとっている。Pilllの開始が2018年なので、それより後のデータが見れるくらいで良い const _calendarDataSourceLength = 120; -final _calendarDataSource = List.generate(_calendarDataSourceLength, - (index) => (index + 1) - (_calendarDataSourceLength ~/ 2)) - .map((e) => DateTime(today().year, today().month + e, 1)) - .toList(); -final _todayCalendarPageIndex = _calendarDataSource - .lastIndexWhere((element) => isSameMonth(element, today())); +final _calendarDataSource = List.generate(_calendarDataSourceLength, (index) => (index + 1) - (_calendarDataSourceLength ~/ 2)).map((e) => DateTime(today().year, today().month + e, 1)).toList(); +final _todayCalendarPageIndex = _calendarDataSource.lastIndexWhere((element) => isSameMonth(element, today())); class CalendarPage extends HookConsumerWidget { const CalendarPage({super.key}); @@ -50,8 +46,7 @@ class CalendarPage extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final page = useState(_todayCalendarPageIndex); - final pageController = - usePageController(initialPage: _todayCalendarPageIndex); + final pageController = usePageController(initialPage: _todayCalendarPageIndex); pageController.addListener(() { final index = (pageController.page ?? pageController.initialPage).round(); page.value = index; @@ -59,10 +54,7 @@ class CalendarPage extends HookConsumerWidget { final displayedMonth = _calendarDataSource[page.value]; return AsyncValueGroup.group6( - ref.watch(pillSheetModifiedHistoriesWithLimitProvider( - limit: CalendarPillSheetModifiedHistoryCardState - .pillSheetModifiedHistoriesThreshold + - 1)), + ref.watch(pillSheetModifiedHistoriesWithLimitProvider(limit: CalendarPillSheetModifiedHistoryCardState.pillSheetModifiedHistoriesThreshold + 1)), ref.watch(userProvider), ref.watch(calendarMenstruationBandListProvider), ref.watch(calendarScheduledMenstruationBandListProvider), @@ -91,17 +83,13 @@ class CalendarPage extends HookConsumerWidget { } const double _shadowHeight = 2; -const _monthlyCalendarHeight = WeekdayBadgeConst.height + - (CalendarConstants.tileHeight + CalendarConstants.dividerHeight) * - CalendarConstants.maxLineCount + - _shadowHeight; +const _monthlyCalendarHeight = WeekdayBadgeConst.height + (CalendarConstants.tileHeight + CalendarConstants.dividerHeight) * CalendarConstants.maxLineCount + _shadowHeight; class _CalendarPageBody extends StatelessWidget { final List histories; final User user; final List calendarMenstruationBandModels; - final List - calendarScheduledMenstruationBandModels; + final List calendarScheduledMenstruationBandModels; final List calendarNextPillSheetBandModels; final DateTime displayedMonth; final Diary? todayDiary; @@ -128,8 +116,7 @@ class _CalendarPageBody extends StatelessWidget { child: FloatingActionButton( onPressed: () { analytics.logEvent(name: "calendar_fab_pressed"); - Navigator.of(context) - .push(DiaryPostPageRoute.route(today(), todayDiary)); + Navigator.of(context).push(DiaryPostPageRoute.route(today(), todayDiary)); }, backgroundColor: PilllColors.primary, child: const Icon(Icons.add, color: Colors.white), @@ -161,22 +148,16 @@ class _CalendarPageBody extends StatelessWidget { _calendarDataSourceLength, (index) { // NOTE: 生理タブ上部のカレンダーの90日のデータと合わせて3index分の表示をフリープランとする - final withInFreePlanMonth = - _todayCalendarPageIndex + 3 >= index && - index >= _todayCalendarPageIndex - 3; + final withInFreePlanMonth = _todayCalendarPageIndex + 3 >= index && index >= _todayCalendarPageIndex - 3; return Stack( children: [ MonthCalendarPager( displayedMonth: displayedMonth, - calendarMenstruationBandModels: - calendarMenstruationBandModels, - calendarScheduledMenstruationBandModels: - calendarScheduledMenstruationBandModels, - calendarNextPillSheetBandModels: - calendarNextPillSheetBandModels, + calendarMenstruationBandModels: calendarMenstruationBandModels, + calendarScheduledMenstruationBandModels: calendarScheduledMenstruationBandModels, + calendarNextPillSheetBandModels: calendarNextPillSheetBandModels, ), - if (!user.premiumOrTrial && !withInFreePlanMonth) - const PremiumIntroductionOverlay(), + if (!user.premiumOrTrial && !withInFreePlanMonth) const PremiumIntroductionOverlay(), ], ); }, @@ -210,8 +191,7 @@ class MonthCalendarPager extends StatelessWidget { final DateTime displayedMonth; final List calendarMenstruationBandModels; - final List - calendarScheduledMenstruationBandModels; + final List calendarScheduledMenstruationBandModels; final List calendarNextPillSheetBandModels; @override @@ -235,8 +215,7 @@ class MonthCalendarPager extends StatelessWidget { return CalendarWeekLine( dateRange: weekDateRange, calendarMenstruationBandModels: calendarMenstruationBandModels, - calendarScheduledMenstruationBandModels: - calendarScheduledMenstruationBandModels, + calendarScheduledMenstruationBandModels: calendarScheduledMenstruationBandModels, calendarNextPillSheetBandModels: calendarNextPillSheetBandModels, horizontalPadding: 0, day: (context, weekday, date) { @@ -249,15 +228,11 @@ class MonthCalendarPager extends StatelessWidget { return CalendarDayTile( weekday: weekday, date: date, - diary: - diaries.firstWhereOrNull((e) => isSameDay(e.date, date)), - schedule: schedules - .firstWhereOrNull((e) => isSameDay(e.date, date)), + diary: diaries.firstWhereOrNull((e) => isSameDay(e.date, date)), + schedule: schedules.firstWhereOrNull((e) => isSameDay(e.date, date)), onTap: (date) { - analytics.logEvent( - name: "did_select_day_tile_on_calendar_card"); - transitionWhenCalendarDayTapped(context, - date: date, diaries: diaries, schedules: schedules); + analytics.logEvent(name: "did_select_day_tile_on_calendar_card"); + transitionWhenCalendarDayTapped(context, date: date, diaries: diaries, schedules: schedules); }, ); }, diff --git a/lib/features/diary_post/diary_confirmation_sheet.dart b/lib/features/diary_post/diary_confirmation_sheet.dart index e2776d287b..f54e6d5a51 100644 --- a/lib/features/diary_post/diary_confirmation_sheet.dart +++ b/lib/features/diary_post/diary_confirmation_sheet.dart @@ -37,18 +37,15 @@ class DiaryConfirmationSheet extends HookConsumerWidget { color: PilllColors.white, ), padding: const EdgeInsets.fromLTRB(16, 20, 16, 20), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - _title(context, deleteDiary, diary), - ...[ - if (diary.hasPhysicalConditionStatus) _physicalCondition(diary), - _physicalConditionDetails(diary), - if (diary.hasSex) _sex(diary), - _memo(diary), - ].map((e) => _withContentSpacer(e)), - ]), + child: Column(mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ + _title(context, deleteDiary, diary), + ...[ + if (diary.hasPhysicalConditionStatus) _physicalCondition(diary), + _physicalConditionDetails(diary), + if (diary.hasSex) _sex(diary), + _memo(diary), + ].map((e) => _withContentSpacer(e)), + ]), ); } @@ -63,18 +60,12 @@ class DiaryConfirmationSheet extends HookConsumerWidget { return Row( mainAxisSize: MainAxisSize.max, children: [ - Text(DateTimeFormatter.yearAndMonthAndDay(diary.date), - style: const TextStyle( - fontFamily: FontFamily.japanese, - fontWeight: FontWeight.w500, - fontSize: 20, - color: TextColor.main)), + Text(DateTimeFormatter.yearAndMonthAndDay(diary.date), style: const TextStyle(fontFamily: FontFamily.japanese, fontWeight: FontWeight.w500, fontSize: 20, color: TextColor.main)), const Spacer(), IconButton( icon: SvgPicture.asset("images/edit.svg"), onPressed: () { - Navigator.of(context) - .push(DiaryPostPageRoute.route(diary.date, diary)); + Navigator.of(context).push(DiaryPostPageRoute.route(diary.date, diary)); }, ), const SizedBox(width: 12), @@ -86,12 +77,7 @@ class DiaryConfirmationSheet extends HookConsumerWidget { builder: (context) { return DiscardDialog( title: "日記を削除します", - message: const Text("削除された日記は復元ができません", - style: TextStyle( - fontFamily: FontFamily.japanese, - fontWeight: FontWeight.w300, - fontSize: 14, - color: TextColor.main)), + message: const Text("削除された日記は復元ができません", style: TextStyle(fontFamily: FontFamily.japanese, fontWeight: FontWeight.w300, fontSize: 14, color: TextColor.main)), actions: [ AlertButton( text: "キャンセル", @@ -123,13 +109,9 @@ class DiaryConfirmationSheet extends HookConsumerWidget { Widget _physicalConditionImage(PhysicalConditionStatus? status) { switch (status) { case PhysicalConditionStatus.fine: - return SvgPicture.asset("images/laugh.svg", - colorFilter: - const ColorFilter.mode(PilllColors.primary, BlendMode.srcIn)); + return SvgPicture.asset("images/laugh.svg", colorFilter: const ColorFilter.mode(PilllColors.primary, BlendMode.srcIn)); case PhysicalConditionStatus.bad: - return SvgPicture.asset("images/angry.svg", - colorFilter: - const ColorFilter.mode(PilllColors.primary, BlendMode.srcIn)); + return SvgPicture.asset("images/angry.svg", colorFilter: const ColorFilter.mode(PilllColors.primary, BlendMode.srcIn)); default: return Container(); } @@ -181,11 +163,8 @@ class DiaryConfirmationSheet extends HookConsumerWidget { padding: const EdgeInsets.all(4), width: 32, height: 32, - decoration: BoxDecoration( - shape: BoxShape.circle, color: PilllColors.thinSecondary), - child: SvgPicture.asset("images/heart.svg", - colorFilter: - const ColorFilter.mode(PilllColors.primary, BlendMode.srcIn)), + decoration: BoxDecoration(shape: BoxShape.circle, color: PilllColors.thinSecondary), + child: SvgPicture.asset("images/heart.svg", colorFilter: const ColorFilter.mode(PilllColors.primary, BlendMode.srcIn)), ); } diff --git a/lib/features/diary_post/diary_post_page.dart b/lib/features/diary_post/diary_post_page.dart index 11e6942e81..8a2350bb1e 100644 --- a/lib/features/diary_post/diary_post_page.dart +++ b/lib/features/diary_post/diary_post_page.dart @@ -33,9 +33,7 @@ class DiaryPostPage extends HookConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final diary = this.diary ?? Diary.fromDate(date); - return AsyncValueGroup.group2( - ref.watch(userProvider), ref.watch(diarySettingProvider)) - .when( + return AsyncValueGroup.group2(ref.watch(userProvider), ref.watch(diarySettingProvider)).when( data: (data) => DiaryPostPageBody( date: date, diary: diary, @@ -78,13 +76,11 @@ class DiaryPostPageBody extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final memoTextEditingController = - useTextEditingController(text: diary.memo); + final memoTextEditingController = useTextEditingController(text: diary.memo); final focusNode = useFocusNode(); final scrollController = useScrollController(); - final physicalCondition = - useState(diary.physicalConditionStatus); + final physicalCondition = useState(diary.physicalConditionStatus); final physicalConditionDetails = useState(diary.physicalConditions); final sex = useState(diary.hasSex); @@ -131,8 +127,7 @@ class DiaryPostPageBody extends HookConsumerWidget { children: [ Expanded( child: ListView( - padding: - const EdgeInsets.symmetric(horizontal: 16, vertical: 16), + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), controller: scrollController, children: [ Text(DateTimeFormatter.yearAndMonthAndDay(date), @@ -143,20 +138,13 @@ class DiaryPostPageBody extends HookConsumerWidget { color: TextColor.main, )), const SizedBox(height: 20), - DiaryPostPhysicalCondition( - physicalCondition: physicalCondition), + DiaryPostPhysicalCondition(physicalCondition: physicalCondition), const SizedBox(height: 20), - DiaryPostPhysicalConditionDetails( - user: user, - diarySetting: diarySetting, - context: context, - physicalConditionDetails: physicalConditionDetails), + DiaryPostPhysicalConditionDetails(user: user, diarySetting: diarySetting, context: context, physicalConditionDetails: physicalConditionDetails), const SizedBox(height: 20), DiaryPostSex(sex: sex), const SizedBox(height: 20), - DiaryPostMemo( - textEditingController: memoTextEditingController, - focusNode: focusNode), + DiaryPostMemo(textEditingController: memoTextEditingController, focusNode: focusNode), ], ), ), diff --git a/lib/features/diary_post/memo.dart b/lib/features/diary_post/memo.dart index eda272807a..e8daa98edb 100644 --- a/lib/features/diary_post/memo.dart +++ b/lib/features/diary_post/memo.dart @@ -4,10 +4,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; class DiaryPostMemo extends HookConsumerWidget { final TextEditingController textEditingController; final FocusNode focusNode; - const DiaryPostMemo( - {super.key, - required this.textEditingController, - required this.focusNode}); + const DiaryPostMemo({super.key, required this.textEditingController, required this.focusNode}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/lib/features/diary_post/physical_condition.dart b/lib/features/diary_post/physical_condition.dart index 5266165dbb..b3fcf34d86 100644 --- a/lib/features/diary_post/physical_condition.dart +++ b/lib/features/diary_post/physical_condition.dart @@ -33,53 +33,31 @@ class DiaryPostPhysicalCondition extends StatelessWidget { children: [ Container( decoration: BoxDecoration( - borderRadius: const BorderRadius.only( - topLeft: Radius.circular(8), - bottomLeft: Radius.circular(8)), - color: physicalCondition.value == PhysicalConditionStatus.bad - ? PilllColors.thinSecondary - : Colors.transparent, + borderRadius: const BorderRadius.only(topLeft: Radius.circular(8), bottomLeft: Radius.circular(8)), + color: physicalCondition.value == PhysicalConditionStatus.bad ? PilllColors.thinSecondary : Colors.transparent, ), child: IconButton( icon: SvgPicture.asset("images/angry.svg", - colorFilter: ColorFilter.mode( - physicalCondition.value == - PhysicalConditionStatus.bad - ? PilllColors.primary - : TextColor.darkGray, - BlendMode.srcIn)), + colorFilter: ColorFilter.mode(physicalCondition.value == PhysicalConditionStatus.bad ? PilllColors.primary : TextColor.darkGray, BlendMode.srcIn)), onPressed: () { - if (physicalCondition.value == - PhysicalConditionStatus.bad) { + if (physicalCondition.value == PhysicalConditionStatus.bad) { physicalCondition.value = null; } else { physicalCondition.value = PhysicalConditionStatus.bad; } }), ), - const SizedBox( - height: 48, - child: VerticalDivider(width: 1, color: PilllColors.divider)), + const SizedBox(height: 48, child: VerticalDivider(width: 1, color: PilllColors.divider)), Container( decoration: BoxDecoration( - borderRadius: const BorderRadius.only( - topRight: Radius.circular(8), - bottomRight: Radius.circular(8)), - color: physicalCondition.value == PhysicalConditionStatus.fine - ? PilllColors.thinSecondary - : Colors.transparent, + borderRadius: const BorderRadius.only(topRight: Radius.circular(8), bottomRight: Radius.circular(8)), + color: physicalCondition.value == PhysicalConditionStatus.fine ? PilllColors.thinSecondary : Colors.transparent, ), child: IconButton( icon: SvgPicture.asset("images/laugh.svg", - colorFilter: ColorFilter.mode( - physicalCondition.value == - PhysicalConditionStatus.fine - ? PilllColors.primary - : TextColor.darkGray, - BlendMode.srcIn)), + colorFilter: ColorFilter.mode(physicalCondition.value == PhysicalConditionStatus.fine ? PilllColors.primary : TextColor.darkGray, BlendMode.srcIn)), onPressed: () { - if (physicalCondition.value == - PhysicalConditionStatus.fine) { + if (physicalCondition.value == PhysicalConditionStatus.fine) { physicalCondition.value = null; } else { physicalCondition.value = PhysicalConditionStatus.fine; diff --git a/lib/features/diary_post/physical_condition_details.dart b/lib/features/diary_post/physical_condition_details.dart index ca986ab569..ec6ef8bec2 100644 --- a/lib/features/diary_post/physical_condition_details.dart +++ b/lib/features/diary_post/physical_condition_details.dart @@ -27,8 +27,7 @@ class DiaryPostPhysicalConditionDetails extends StatelessWidget { Widget build(BuildContext context) { late List availablePhysicalConditionDetails; if (user.premiumOrTrial) { - availablePhysicalConditionDetails = - diarySetting?.physicalConditions ?? defaultPhysicalConditions; + availablePhysicalConditionDetails = diarySetting?.physicalConditions ?? defaultPhysicalConditions; } else { availablePhysicalConditionDetails = defaultPhysicalConditions; } @@ -51,8 +50,7 @@ class DiaryPostPhysicalConditionDetails extends StatelessWidget { builder: (_) { return SizedBox( height: MediaQuery.of(context).size.height - 200, - child: - const DiarySettingPhysicalConditionDetailPage(), + child: const DiarySettingPhysicalConditionDetailPage(), ); }); } else { @@ -78,23 +76,16 @@ class DiaryPostPhysicalConditionDetails extends StatelessWidget { fontFamily: FontFamily.japanese, fontWeight: FontWeight.w300, fontSize: 14, - color: physicalConditionDetails.value.contains(e) - ? TextColor.white - : TextColor.darkGray, + color: physicalConditionDetails.value.contains(e) ? TextColor.white : TextColor.darkGray, ), disabledColor: PilllColors.disabledSheet, selectedColor: PilllColors.primary, selected: physicalConditionDetails.value.contains(e), onSelected: (selected) { if (physicalConditionDetails.value.contains(e)) { - physicalConditionDetails.value = [ - ...physicalConditionDetails.value - ]..remove(e); + physicalConditionDetails.value = [...physicalConditionDetails.value]..remove(e); } else { - physicalConditionDetails.value = [ - ...physicalConditionDetails.value, - e - ]; + physicalConditionDetails.value = [...physicalConditionDetails.value, e]; } }, )) diff --git a/lib/features/diary_post/sex.dart b/lib/features/diary_post/sex.dart index b88282b25e..de0c3e5865 100644 --- a/lib/features/diary_post/sex.dart +++ b/lib/features/diary_post/sex.dart @@ -25,13 +25,8 @@ class DiaryPostSex extends StatelessWidget { padding: const EdgeInsets.all(4), width: 32, height: 32, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: sex.value - ? PilllColors.thinSecondary - : PilllColors.disabledSheet), - child: SvgPicture.asset( - sex.value ? "images/heart.svg" : "images/heart-stroke.svg"), + decoration: BoxDecoration(shape: BoxShape.circle, color: sex.value ? PilllColors.thinSecondary : PilllColors.disabledSheet), + child: SvgPicture.asset(sex.value ? "images/heart.svg" : "images/heart-stroke.svg"), ), ), const Spacer(), diff --git a/lib/features/diary_post/util.dart b/lib/features/diary_post/util.dart index b6b44a70ac..87848917bd 100644 --- a/lib/features/diary_post/util.dart +++ b/lib/features/diary_post/util.dart @@ -2,8 +2,4 @@ import 'package:flutter/widgets.dart'; import 'package:pilll/components/atoms/font.dart'; import 'package:pilll/components/atoms/text_color.dart'; -const sectionTitle = TextStyle( - fontFamily: FontFamily.japanese, - fontWeight: FontWeight.w300, - fontSize: 16, - color: TextColor.black); +const sectionTitle = TextStyle(fontFamily: FontFamily.japanese, fontWeight: FontWeight.w300, fontSize: 16, color: TextColor.black); diff --git a/lib/features/diary_setting_physical_condtion_detail/page.dart b/lib/features/diary_setting_physical_condtion_detail/page.dart index 3cdbf0c5fc..d225bc417e 100644 --- a/lib/features/diary_setting_physical_condtion_detail/page.dart +++ b/lib/features/diary_setting_physical_condtion_detail/page.dart @@ -16,14 +16,10 @@ class DiarySettingPhysicalConditionDetailPage extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final createDiarySetting = - ref.watch(createDiarySettingPhysicalConditionDetailProvider); - final addDiarySetting = - ref.watch(addDiarySettingPhysicalConditionDetailProvider); - final deleteDiarySetting = - ref.watch(deleteDiarySettingPhysicalConditionDetailProvider); - final state = - ref.watch(diarySettingPhysicalConditionDetailAsyncStateProvider); + final createDiarySetting = ref.watch(createDiarySettingPhysicalConditionDetailProvider); + final addDiarySetting = ref.watch(addDiarySettingPhysicalConditionDetailProvider); + final deleteDiarySetting = ref.watch(deleteDiarySettingPhysicalConditionDetailProvider); + final state = ref.watch(diarySettingPhysicalConditionDetailAsyncStateProvider); final textFieldController = useTextEditingController(); final scrollController = useScrollController(); @@ -73,13 +69,9 @@ class DiarySettingPhysicalConditionDetailPage extends HookConsumerWidget { hintText: "入力して追加", ), onSubmitted: (physicalConditionDetail) async { - analytics.logEvent( - name: "submit_physical_condition_detail", - parameters: {"element": physicalConditionDetail}); + analytics.logEvent(name: "submit_physical_condition_detail", parameters: {"element": physicalConditionDetail}); try { - await addDiarySetting( - diarySetting: diarySetting, - physicalConditionDetail: physicalConditionDetail); + await addDiarySetting(diarySetting: diarySetting, physicalConditionDetail: physicalConditionDetail); textFieldController.text = ""; } catch (error) { if (context.mounted) showErrorAlert(context, error); @@ -93,14 +85,11 @@ class DiarySettingPhysicalConditionDetailPage extends HookConsumerWidget { children: [ ListTile( title: Text(p), - contentPadding: const EdgeInsets.symmetric( - horizontal: 16, vertical: 0), + contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 0), trailing: IconButton( icon: const Icon(Icons.delete), onPressed: () async { - await deleteDiarySetting( - diarySetting: diarySetting, - physicalConditionDetail: p); + await deleteDiarySetting(diarySetting: diarySetting, physicalConditionDetail: p); }, ), ), @@ -111,8 +100,7 @@ class DiarySettingPhysicalConditionDetailPage extends HookConsumerWidget { ), ); }, - error: (error, _) => - UniversalErrorPage(error: error, child: null, reload: null), + error: (error, _) => UniversalErrorPage(error: error, child: null, reload: null), loading: () => const ScaffoldIndicator(), ); } diff --git a/lib/features/diary_setting_physical_condtion_detail/provider.dart b/lib/features/diary_setting_physical_condtion_detail/provider.dart index b05e127c0f..eaa29c813a 100644 --- a/lib/features/diary_setting_physical_condtion_detail/provider.dart +++ b/lib/features/diary_setting_physical_condtion_detail/provider.dart @@ -4,54 +4,35 @@ import 'package:pilll/provider/database.dart'; import 'package:pilll/entity/diary_setting.codegen.dart'; import 'package:pilll/utils/datetime/day.dart'; -final createDiarySettingPhysicalConditionDetailProvider = Provider.autoDispose( - (ref) => CreateDiarySettingPhysicalConditionDetail( - ref.watch(databaseProvider).diarySettingReference())); +final createDiarySettingPhysicalConditionDetailProvider = Provider.autoDispose((ref) => CreateDiarySettingPhysicalConditionDetail(ref.watch(databaseProvider).diarySettingReference())); class CreateDiarySettingPhysicalConditionDetail { final DocumentReference reference; CreateDiarySettingPhysicalConditionDetail(this.reference); Future call() async { - await reference.set( - DiarySetting(createdAt: now()), SetOptions(merge: true)); + await reference.set(DiarySetting(createdAt: now()), SetOptions(merge: true)); } } -final addDiarySettingPhysicalConditionDetailProvider = Provider.autoDispose( - (ref) => AddDiarySettingPhysicalConditionDetail( - ref.watch(databaseProvider).diarySettingReference())); +final addDiarySettingPhysicalConditionDetailProvider = Provider.autoDispose((ref) => AddDiarySettingPhysicalConditionDetail(ref.watch(databaseProvider).diarySettingReference())); class AddDiarySettingPhysicalConditionDetail { final DocumentReference reference; AddDiarySettingPhysicalConditionDetail(this.reference); - Future call( - {required DiarySetting diarySetting, - required String physicalConditionDetail}) async { - await reference.set( - diarySetting.copyWith( - physicalConditions: [...diarySetting.physicalConditions] - ..insert(0, physicalConditionDetail)), - SetOptions(merge: true)); + Future call({required DiarySetting diarySetting, required String physicalConditionDetail}) async { + await reference.set(diarySetting.copyWith(physicalConditions: [...diarySetting.physicalConditions]..insert(0, physicalConditionDetail)), SetOptions(merge: true)); } } -final deleteDiarySettingPhysicalConditionDetailProvider = Provider.autoDispose( - (ref) => DeleteDiarySettingPhysicalConditionDetail( - ref.watch(databaseProvider).diarySettingReference())); +final deleteDiarySettingPhysicalConditionDetailProvider = Provider.autoDispose((ref) => DeleteDiarySettingPhysicalConditionDetail(ref.watch(databaseProvider).diarySettingReference())); class DeleteDiarySettingPhysicalConditionDetail { final DocumentReference reference; DeleteDiarySettingPhysicalConditionDetail(this.reference); - Future call( - {required DiarySetting diarySetting, - required String physicalConditionDetail}) async { - await reference.set( - diarySetting.copyWith( - physicalConditions: [...diarySetting.physicalConditions] - ..remove(physicalConditionDetail)), - SetOptions(merge: true)); + Future call({required DiarySetting diarySetting, required String physicalConditionDetail}) async { + await reference.set(diarySetting.copyWith(physicalConditions: [...diarySetting.physicalConditions]..remove(physicalConditionDetail)), SetOptions(merge: true)); } } diff --git a/lib/features/diary_setting_physical_condtion_detail/state.codegen.dart b/lib/features/diary_setting_physical_condtion_detail/state.codegen.dart index 64f196db6c..1133c40186 100644 --- a/lib/features/diary_setting_physical_condtion_detail/state.codegen.dart +++ b/lib/features/diary_setting_physical_condtion_detail/state.codegen.dart @@ -5,9 +5,7 @@ import 'package:pilll/entity/diary_setting.codegen.dart'; part 'state.codegen.freezed.dart'; -final diarySettingPhysicalConditionDetailAsyncStateProvider = - Provider.autoDispose>( - (ref) { +final diarySettingPhysicalConditionDetailAsyncStateProvider = Provider.autoDispose>((ref) { final diarySetting = ref.watch(diarySettingProvider); if (diarySetting is AsyncLoading) { @@ -24,8 +22,7 @@ final diarySettingPhysicalConditionDetailAsyncStateProvider = }); @freezed -class DiarySettingPhysicalConditionDetailState - with _$DiarySettingPhysicalConditionDetailState { +class DiarySettingPhysicalConditionDetailState with _$DiarySettingPhysicalConditionDetailState { factory DiarySettingPhysicalConditionDetailState({ required DiarySetting? diarySetting, }) = _DiarySettingPhysicalConditionDetailState; diff --git a/lib/features/diary_setting_physical_condtion_detail/state.codegen.freezed.dart b/lib/features/diary_setting_physical_condtion_detail/state.codegen.freezed.dart index a1cbdaff18..1bc274e035 100644 --- a/lib/features/diary_setting_physical_condtion_detail/state.codegen.freezed.dart +++ b/lib/features/diary_setting_physical_condtion_detail/state.codegen.freezed.dart @@ -19,18 +19,13 @@ mixin _$DiarySettingPhysicalConditionDetailState { DiarySetting? get diarySetting => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $DiarySettingPhysicalConditionDetailStateCopyWith< - DiarySettingPhysicalConditionDetailState> - get copyWith => throw _privateConstructorUsedError; + $DiarySettingPhysicalConditionDetailStateCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $DiarySettingPhysicalConditionDetailStateCopyWith<$Res> { - factory $DiarySettingPhysicalConditionDetailStateCopyWith( - DiarySettingPhysicalConditionDetailState value, - $Res Function(DiarySettingPhysicalConditionDetailState) then) = - _$DiarySettingPhysicalConditionDetailStateCopyWithImpl<$Res, - DiarySettingPhysicalConditionDetailState>; + factory $DiarySettingPhysicalConditionDetailStateCopyWith(DiarySettingPhysicalConditionDetailState value, $Res Function(DiarySettingPhysicalConditionDetailState) then) = + _$DiarySettingPhysicalConditionDetailStateCopyWithImpl<$Res, DiarySettingPhysicalConditionDetailState>; @useResult $Res call({DiarySetting? diarySetting}); @@ -38,11 +33,8 @@ abstract class $DiarySettingPhysicalConditionDetailStateCopyWith<$Res> { } /// @nodoc -class _$DiarySettingPhysicalConditionDetailStateCopyWithImpl<$Res, - $Val extends DiarySettingPhysicalConditionDetailState> - implements $DiarySettingPhysicalConditionDetailStateCopyWith<$Res> { - _$DiarySettingPhysicalConditionDetailStateCopyWithImpl( - this._value, this._then); +class _$DiarySettingPhysicalConditionDetailStateCopyWithImpl<$Res, $Val extends DiarySettingPhysicalConditionDetailState> implements $DiarySettingPhysicalConditionDetailStateCopyWith<$Res> { + _$DiarySettingPhysicalConditionDetailStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -76,11 +68,8 @@ class _$DiarySettingPhysicalConditionDetailStateCopyWithImpl<$Res, } /// @nodoc -abstract class _$$DiarySettingPhysicalConditionDetailStateImplCopyWith<$Res> - implements $DiarySettingPhysicalConditionDetailStateCopyWith<$Res> { - factory _$$DiarySettingPhysicalConditionDetailStateImplCopyWith( - _$DiarySettingPhysicalConditionDetailStateImpl value, - $Res Function(_$DiarySettingPhysicalConditionDetailStateImpl) then) = +abstract class _$$DiarySettingPhysicalConditionDetailStateImplCopyWith<$Res> implements $DiarySettingPhysicalConditionDetailStateCopyWith<$Res> { + factory _$$DiarySettingPhysicalConditionDetailStateImplCopyWith(_$DiarySettingPhysicalConditionDetailStateImpl value, $Res Function(_$DiarySettingPhysicalConditionDetailStateImpl) then) = __$$DiarySettingPhysicalConditionDetailStateImplCopyWithImpl<$Res>; @override @useResult @@ -91,13 +80,9 @@ abstract class _$$DiarySettingPhysicalConditionDetailStateImplCopyWith<$Res> } /// @nodoc -class __$$DiarySettingPhysicalConditionDetailStateImplCopyWithImpl<$Res> - extends _$DiarySettingPhysicalConditionDetailStateCopyWithImpl<$Res, - _$DiarySettingPhysicalConditionDetailStateImpl> +class __$$DiarySettingPhysicalConditionDetailStateImplCopyWithImpl<$Res> extends _$DiarySettingPhysicalConditionDetailStateCopyWithImpl<$Res, _$DiarySettingPhysicalConditionDetailStateImpl> implements _$$DiarySettingPhysicalConditionDetailStateImplCopyWith<$Res> { - __$$DiarySettingPhysicalConditionDetailStateImplCopyWithImpl( - _$DiarySettingPhysicalConditionDetailStateImpl _value, - $Res Function(_$DiarySettingPhysicalConditionDetailStateImpl) _then) + __$$DiarySettingPhysicalConditionDetailStateImplCopyWithImpl(_$DiarySettingPhysicalConditionDetailStateImpl _value, $Res Function(_$DiarySettingPhysicalConditionDetailStateImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -116,10 +101,8 @@ class __$$DiarySettingPhysicalConditionDetailStateImplCopyWithImpl<$Res> /// @nodoc -class _$DiarySettingPhysicalConditionDetailStateImpl - extends _DiarySettingPhysicalConditionDetailState { - _$DiarySettingPhysicalConditionDetailStateImpl({required this.diarySetting}) - : super._(); +class _$DiarySettingPhysicalConditionDetailStateImpl extends _DiarySettingPhysicalConditionDetailState { + _$DiarySettingPhysicalConditionDetailStateImpl({required this.diarySetting}) : super._(); @override final DiarySetting? diarySetting; @@ -132,10 +115,7 @@ class _$DiarySettingPhysicalConditionDetailStateImpl @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$DiarySettingPhysicalConditionDetailStateImpl && - (identical(other.diarySetting, diarySetting) || - other.diarySetting == diarySetting)); + (other.runtimeType == runtimeType && other is _$DiarySettingPhysicalConditionDetailStateImpl && (identical(other.diarySetting, diarySetting) || other.diarySetting == diarySetting)); } @override @@ -144,25 +124,17 @@ class _$DiarySettingPhysicalConditionDetailStateImpl @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$DiarySettingPhysicalConditionDetailStateImplCopyWith< - _$DiarySettingPhysicalConditionDetailStateImpl> - get copyWith => - __$$DiarySettingPhysicalConditionDetailStateImplCopyWithImpl< - _$DiarySettingPhysicalConditionDetailStateImpl>(this, _$identity); + _$$DiarySettingPhysicalConditionDetailStateImplCopyWith<_$DiarySettingPhysicalConditionDetailStateImpl> get copyWith => + __$$DiarySettingPhysicalConditionDetailStateImplCopyWithImpl<_$DiarySettingPhysicalConditionDetailStateImpl>(this, _$identity); } -abstract class _DiarySettingPhysicalConditionDetailState - extends DiarySettingPhysicalConditionDetailState { - factory _DiarySettingPhysicalConditionDetailState( - {required final DiarySetting? diarySetting}) = - _$DiarySettingPhysicalConditionDetailStateImpl; +abstract class _DiarySettingPhysicalConditionDetailState extends DiarySettingPhysicalConditionDetailState { + factory _DiarySettingPhysicalConditionDetailState({required final DiarySetting? diarySetting}) = _$DiarySettingPhysicalConditionDetailStateImpl; _DiarySettingPhysicalConditionDetailState._() : super._(); @override DiarySetting? get diarySetting; @override @JsonKey(ignore: true) - _$$DiarySettingPhysicalConditionDetailStateImplCopyWith< - _$DiarySettingPhysicalConditionDetailStateImpl> - get copyWith => throw _privateConstructorUsedError; + _$$DiarySettingPhysicalConditionDetailStateImplCopyWith<_$DiarySettingPhysicalConditionDetailStateImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/error/error_alert.dart b/lib/features/error/error_alert.dart index 1472361c85..b70ae38934 100644 --- a/lib/features/error/error_alert.dart +++ b/lib/features/error/error_alert.dart @@ -10,8 +10,7 @@ class ErrorAlert extends StatelessWidget { final String errorMessage; final String? faqLinkURL; - const ErrorAlert( - {super.key, this.title, this.faqLinkURL, required this.errorMessage}); + const ErrorAlert({super.key, this.title, this.faqLinkURL, required this.errorMessage}); @override Widget build(BuildContext context) { final faq = faqLinkURL; diff --git a/lib/features/error/universal_error_page.dart b/lib/features/error/universal_error_page.dart index 77ca045c0c..788534a15c 100644 --- a/lib/features/error/universal_error_page.dart +++ b/lib/features/error/universal_error_page.dart @@ -126,8 +126,7 @@ class UniversalErrorPageState extends State { color: TextColor.black, )), onPressed: () { - analytics.logEvent( - name: "problem_unresolved_button_pressed"); + analytics.logEvent(name: "problem_unresolved_button_pressed"); inquiry(); }, ) diff --git a/lib/features/home/home_page.dart b/lib/features/home/home_page.dart index d046d4edc2..6e770a9dbd 100644 --- a/lib/features/home/home_page.dart +++ b/lib/features/home/home_page.dart @@ -35,8 +35,7 @@ class HomePage extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final user = ref.watch(userProvider); - final registerRemotePushNotificationToken = - ref.watch(registerRemotePushNotificationTokenProvider); + final registerRemotePushNotificationToken = ref.watch(registerRemotePushNotificationTokenProvider); useEffect(() { final userValue = user.valueOrNull; @@ -90,35 +89,22 @@ class HomePageBody extends HookConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final tabIndex = useState(0); final ticker = useSingleTickerProvider(); - final tabController = useTabController( - initialLength: HomePageTabType.values.length, vsync: ticker); + final tabController = useTabController(initialLength: HomePageTabType.values.length, vsync: ticker); tabController.addListener(() { tabIndex.value = tabController.index; _screenTracking(tabController.index); }); - final isAlreadyAnsweredPreStoreReviewModal = sharedPreferences - .getBool(BoolKey.isAlreadyAnsweredPreStoreReviewModal) ?? - false; - final totalCountOfActionForTakenPill = - sharedPreferences.getInt(IntKey.totalCountOfActionForTakenPill) ?? 0; - final disableShouldAskCancelReason = - ref.watch(disableShouldAskCancelReasonProvider); + final isAlreadyAnsweredPreStoreReviewModal = sharedPreferences.getBool(BoolKey.isAlreadyAnsweredPreStoreReviewModal) ?? false; + final totalCountOfActionForTakenPill = sharedPreferences.getInt(IntKey.totalCountOfActionForTakenPill) ?? 0; + final disableShouldAskCancelReason = ref.watch(disableShouldAskCancelReasonProvider); final shouldAskCancelReason = user.shouldAskCancelReason; - final monthlyPremiumIntroductionSheetPresentedDateMilliSeconds = - sharedPreferences.getInt(IntKey - .monthlyPremiumIntroductionSheetPresentedDateMilliSeconds) ?? - 0; - final isOneMonthPassedSinceLastDisplayedMonthlyPremiumIntroductionSheet = - now().millisecondsSinceEpoch - - monthlyPremiumIntroductionSheetPresentedDateMilliSeconds > - 1000 * 60 * 60 * 24 * 30; + final monthlyPremiumIntroductionSheetPresentedDateMilliSeconds = sharedPreferences.getInt(IntKey.monthlyPremiumIntroductionSheetPresentedDateMilliSeconds) ?? 0; + final isOneMonthPassedSinceLastDisplayedMonthlyPremiumIntroductionSheet = now().millisecondsSinceEpoch - monthlyPremiumIntroductionSheetPresentedDateMilliSeconds > 1000 * 60 * 60 * 24 * 30; final bool isOneMonthPassedTrialDeadline; final trialDeadlineDate = user.trialDeadlineDate; if (trialDeadlineDate != null) { - isOneMonthPassedTrialDeadline = now().millisecondsSinceEpoch - - trialDeadlineDate.millisecondsSinceEpoch > - 1000 * 60 * 60 * 24 * 30; + isOneMonthPassedTrialDeadline = now().millisecondsSinceEpoch - trialDeadlineDate.millisecondsSinceEpoch > 1000 * 60 * 60 * 24 * 30; } else { isOneMonthPassedTrialDeadline = false; } @@ -136,32 +122,23 @@ class HomePageBody extends HookConsumerWidget { await Navigator.of(context).push( WebViewPageRoute.route( title: "解約後のアンケートご協力のお願い", - url: - "https://docs.google.com/forms/d/e/1FAIpQLScmxg1amJik_8viuPI3MeDCzz7FuBDXeIHWzorbXRKR38yp7g/viewform", + url: "https://docs.google.com/forms/d/e/1FAIpQLScmxg1amJik_8viuPI3MeDCzz7FuBDXeIHWzorbXRKR38yp7g/viewform", ), ); disableShouldAskCancelReason(); // ignore: use_build_context_synchronously - showDialog( - context: context, - builder: (_) => const ChurnSurveyCompleteDialog()); - } else if (!isAlreadyAnsweredPreStoreReviewModal && - totalCountOfActionForTakenPill > 10) { + showDialog(context: context, builder: (_) => const ChurnSurveyCompleteDialog()); + } else if (!isAlreadyAnsweredPreStoreReviewModal && totalCountOfActionForTakenPill > 10) { showModalBottomSheet( context: context, backgroundColor: Colors.transparent, builder: (_) => const PreStoreReviewModal(), ); - sharedPreferences.setBool( - BoolKey.isAlreadyAnsweredPreStoreReviewModal, true); - } else if (isOneMonthPassedTrialDeadline && - isOneMonthPassedSinceLastDisplayedMonthlyPremiumIntroductionSheet && - !user.premiumOrTrial) { + sharedPreferences.setBool(BoolKey.isAlreadyAnsweredPreStoreReviewModal, true); + } else if (isOneMonthPassedTrialDeadline && isOneMonthPassedSinceLastDisplayedMonthlyPremiumIntroductionSheet && !user.premiumOrTrial) { if (!user.premiumOrTrial) { showPremiumIntroductionSheet(context); - sharedPreferences.setInt( - IntKey.monthlyPremiumIntroductionSheetPresentedDateMilliSeconds, - now().millisecondsSinceEpoch); + sharedPreferences.setInt(IntKey.monthlyPremiumIntroductionSheetPresentedDateMilliSeconds, now().millisecondsSinceEpoch); } } }); @@ -176,8 +153,7 @@ class HomePageBody extends HookConsumerWidget { appBar: null, bottomNavigationBar: Container( decoration: const BoxDecoration( - border: - Border(top: BorderSide(width: 1, color: PilllColors.border)), + border: Border(top: BorderSide(width: 1, color: PilllColors.border)), ), child: Ink( color: PilllColors.bottomBar, @@ -191,31 +167,19 @@ class HomePageBody extends HookConsumerWidget { tabs: [ Tab( text: "ピル", - icon: SvgPicture.asset( - tabIndex.value == HomePageTabType.record.index - ? "images/tab_icon_pill_enable.svg" - : "images/tab_icon_pill_disable.svg"), + icon: SvgPicture.asset(tabIndex.value == HomePageTabType.record.index ? "images/tab_icon_pill_enable.svg" : "images/tab_icon_pill_disable.svg"), ), Tab( text: "生理", - icon: SvgPicture.asset( - tabIndex.value == HomePageTabType.menstruation.index - ? "images/menstruation.svg" - : "images/menstruation_disable.svg"), + icon: SvgPicture.asset(tabIndex.value == HomePageTabType.menstruation.index ? "images/menstruation.svg" : "images/menstruation_disable.svg"), ), Tab( text: "カレンダー", - icon: SvgPicture.asset( - tabIndex.value == HomePageTabType.calendar.index - ? "images/tab_icon_calendar_enable.svg" - : "images/tab_icon_calendar_disable.svg"), + icon: SvgPicture.asset(tabIndex.value == HomePageTabType.calendar.index ? "images/tab_icon_calendar_enable.svg" : "images/tab_icon_calendar_disable.svg"), ), Tab( text: "設定", - icon: SvgPicture.asset( - tabIndex.value == HomePageTabType.setting.index - ? "images/tab_icon_setting_enable.svg" - : "images/tab_icon_setting_disable.svg"), + icon: SvgPicture.asset(tabIndex.value == HomePageTabType.setting.index ? "images/tab_icon_setting_enable.svg" : "images/tab_icon_setting_disable.svg"), ), ], ), diff --git a/lib/features/initial_setting/initial_setting_state.codegen.dart b/lib/features/initial_setting/initial_setting_state.codegen.dart index c8942f7ed6..9a868a31b8 100644 --- a/lib/features/initial_setting/initial_setting_state.codegen.dart +++ b/lib/features/initial_setting/initial_setting_state.codegen.dart @@ -49,11 +49,8 @@ class InitialSettingState with _$InitialSettingState { Future buildSetting() async { const menstruationDuration = 4; - final maxPillCount = pillSheetTypes - .map((e) => e.totalCount) - .fold(0, (previousValue, element) => previousValue + element); - final pillNumberForFromMenstruation = - max(0, maxPillCount - menstruationDuration); + final maxPillCount = pillSheetTypes.map((e) => e.totalCount).fold(0, (previousValue, element) => previousValue + element); + final pillNumberForFromMenstruation = max(0, maxPillCount - menstruationDuration); final setting = Setting( pillNumberForFromMenstruation: pillNumberForFromMenstruation, @@ -105,20 +102,15 @@ class InitialSettingState with _$InitialSettingState { if (pageIndex <= todayPillNumber.pageIndex) { // Left side from todayPillNumber.pageIndex // Or current pageIndex == todayPillNumber.pageIndex - final passedTotalCountElement = pillSheetTypes - .sublist(0, todayPillNumber.pageIndex - pageIndex) - .map((e) => e.totalCount); + final passedTotalCountElement = pillSheetTypes.sublist(0, todayPillNumber.pageIndex - pageIndex).map((e) => e.totalCount); final int passedTotalCount; if (passedTotalCountElement.isEmpty) { passedTotalCount = 0; } else { - passedTotalCount = - passedTotalCountElement.reduce((value, element) => value + element); + passedTotalCount = passedTotalCountElement.reduce((value, element) => value + element); } - return today().subtract(Duration( - days: - passedTotalCount + (todayPillNumber.pillNumberInPillSheet - 1))); + return today().subtract(Duration(days: passedTotalCount + (todayPillNumber.pillNumberInPillSheet - 1))); } else { // Right Side from todayPillNumber.pageIndex final beforePillSheetBeginingDate = _beginingDate( @@ -127,8 +119,7 @@ class InitialSettingState with _$InitialSettingState { pillSheetTypes: pillSheetTypes, ); final beforePillSheetType = pillSheetTypes[pageIndex - 1]; - return beforePillSheetBeginingDate - .addDays(beforePillSheetType.totalCount); + return beforePillSheetBeginingDate.addDays(beforePillSheetType.totalCount); } } @@ -137,9 +128,7 @@ class InitialSettingState with _$InitialSettingState { required InitialSettingTodayPillNumber todayPillNumber, required List pillSheetTypes, }) { - if (pageIndex == 0 && - todayPillNumber.pageIndex == 0 && - todayPillNumber.pillNumberInPillSheet == 1) { + if (pageIndex == 0 && todayPillNumber.pageIndex == 0 && todayPillNumber.pillNumberInPillSheet == 1) { return null; } final pillSheetType = pillSheetTypes[pageIndex]; @@ -166,8 +155,7 @@ class InitialSettingState with _$InitialSettingState { DateTime reminderDateTime(int index) { var t = DateTime.now(); final reminderTime = reminderTimes[index]; - return DateTime(t.year, t.month, t.day, reminderTime.hour, - reminderTime.minute, t.second, t.millisecond, t.microsecond); + return DateTime(t.year, t.month, t.day, reminderTime.hour, reminderTime.minute, t.second, t.millisecond, t.microsecond); } int? selectedTodayPillNumberIntoPillSheet({required int pageIndex}) { diff --git a/lib/features/initial_setting/initial_setting_state.codegen.freezed.dart b/lib/features/initial_setting/initial_setting_state.codegen.freezed.dart index 92a5ca542c..0254388ccd 100644 --- a/lib/features/initial_setting/initial_setting_state.codegen.freezed.dart +++ b/lib/features/initial_setting/initial_setting_state.codegen.freezed.dart @@ -20,25 +20,19 @@ mixin _$InitialSettingTodayPillNumber { int get pillNumberInPillSheet => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $InitialSettingTodayPillNumberCopyWith - get copyWith => throw _privateConstructorUsedError; + $InitialSettingTodayPillNumberCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $InitialSettingTodayPillNumberCopyWith<$Res> { - factory $InitialSettingTodayPillNumberCopyWith( - InitialSettingTodayPillNumber value, - $Res Function(InitialSettingTodayPillNumber) then) = - _$InitialSettingTodayPillNumberCopyWithImpl<$Res, - InitialSettingTodayPillNumber>; + factory $InitialSettingTodayPillNumberCopyWith(InitialSettingTodayPillNumber value, $Res Function(InitialSettingTodayPillNumber) then) = + _$InitialSettingTodayPillNumberCopyWithImpl<$Res, InitialSettingTodayPillNumber>; @useResult $Res call({int pageIndex, int pillNumberInPillSheet}); } /// @nodoc -class _$InitialSettingTodayPillNumberCopyWithImpl<$Res, - $Val extends InitialSettingTodayPillNumber> - implements $InitialSettingTodayPillNumberCopyWith<$Res> { +class _$InitialSettingTodayPillNumberCopyWithImpl<$Res, $Val extends InitialSettingTodayPillNumber> implements $InitialSettingTodayPillNumberCopyWith<$Res> { _$InitialSettingTodayPillNumberCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -66,11 +60,8 @@ class _$InitialSettingTodayPillNumberCopyWithImpl<$Res, } /// @nodoc -abstract class _$$InitialSettingTodayPillNumberImplCopyWith<$Res> - implements $InitialSettingTodayPillNumberCopyWith<$Res> { - factory _$$InitialSettingTodayPillNumberImplCopyWith( - _$InitialSettingTodayPillNumberImpl value, - $Res Function(_$InitialSettingTodayPillNumberImpl) then) = +abstract class _$$InitialSettingTodayPillNumberImplCopyWith<$Res> implements $InitialSettingTodayPillNumberCopyWith<$Res> { + factory _$$InitialSettingTodayPillNumberImplCopyWith(_$InitialSettingTodayPillNumberImpl value, $Res Function(_$InitialSettingTodayPillNumberImpl) then) = __$$InitialSettingTodayPillNumberImplCopyWithImpl<$Res>; @override @useResult @@ -78,14 +69,9 @@ abstract class _$$InitialSettingTodayPillNumberImplCopyWith<$Res> } /// @nodoc -class __$$InitialSettingTodayPillNumberImplCopyWithImpl<$Res> - extends _$InitialSettingTodayPillNumberCopyWithImpl<$Res, - _$InitialSettingTodayPillNumberImpl> +class __$$InitialSettingTodayPillNumberImplCopyWithImpl<$Res> extends _$InitialSettingTodayPillNumberCopyWithImpl<$Res, _$InitialSettingTodayPillNumberImpl> implements _$$InitialSettingTodayPillNumberImplCopyWith<$Res> { - __$$InitialSettingTodayPillNumberImplCopyWithImpl( - _$InitialSettingTodayPillNumberImpl _value, - $Res Function(_$InitialSettingTodayPillNumberImpl) _then) - : super(_value, _then); + __$$InitialSettingTodayPillNumberImplCopyWithImpl(_$InitialSettingTodayPillNumberImpl _value, $Res Function(_$InitialSettingTodayPillNumberImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -108,10 +94,8 @@ class __$$InitialSettingTodayPillNumberImplCopyWithImpl<$Res> /// @nodoc -class _$InitialSettingTodayPillNumberImpl - implements _InitialSettingTodayPillNumber { - const _$InitialSettingTodayPillNumberImpl( - {this.pageIndex = 0, this.pillNumberInPillSheet = 0}); +class _$InitialSettingTodayPillNumberImpl implements _InitialSettingTodayPillNumber { + const _$InitialSettingTodayPillNumberImpl({this.pageIndex = 0, this.pillNumberInPillSheet = 0}); @override @JsonKey() @@ -130,30 +114,22 @@ class _$InitialSettingTodayPillNumberImpl return identical(this, other) || (other.runtimeType == runtimeType && other is _$InitialSettingTodayPillNumberImpl && - (identical(other.pageIndex, pageIndex) || - other.pageIndex == pageIndex) && - (identical(other.pillNumberInPillSheet, pillNumberInPillSheet) || - other.pillNumberInPillSheet == pillNumberInPillSheet)); + (identical(other.pageIndex, pageIndex) || other.pageIndex == pageIndex) && + (identical(other.pillNumberInPillSheet, pillNumberInPillSheet) || other.pillNumberInPillSheet == pillNumberInPillSheet)); } @override - int get hashCode => - Object.hash(runtimeType, pageIndex, pillNumberInPillSheet); + int get hashCode => Object.hash(runtimeType, pageIndex, pillNumberInPillSheet); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$InitialSettingTodayPillNumberImplCopyWith< - _$InitialSettingTodayPillNumberImpl> - get copyWith => __$$InitialSettingTodayPillNumberImplCopyWithImpl< - _$InitialSettingTodayPillNumberImpl>(this, _$identity); + _$$InitialSettingTodayPillNumberImplCopyWith<_$InitialSettingTodayPillNumberImpl> get copyWith => + __$$InitialSettingTodayPillNumberImplCopyWithImpl<_$InitialSettingTodayPillNumberImpl>(this, _$identity); } -abstract class _InitialSettingTodayPillNumber - implements InitialSettingTodayPillNumber { - const factory _InitialSettingTodayPillNumber( - {final int pageIndex, - final int pillNumberInPillSheet}) = _$InitialSettingTodayPillNumberImpl; +abstract class _InitialSettingTodayPillNumber implements InitialSettingTodayPillNumber { + const factory _InitialSettingTodayPillNumber({final int pageIndex, final int pillNumberInPillSheet}) = _$InitialSettingTodayPillNumberImpl; @override int get pageIndex; @@ -161,16 +137,13 @@ abstract class _InitialSettingTodayPillNumber int get pillNumberInPillSheet; @override @JsonKey(ignore: true) - _$$InitialSettingTodayPillNumberImplCopyWith< - _$InitialSettingTodayPillNumberImpl> - get copyWith => throw _privateConstructorUsedError; + _$$InitialSettingTodayPillNumberImplCopyWith<_$InitialSettingTodayPillNumberImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc mixin _$InitialSettingState { List get pillSheetTypes => throw _privateConstructorUsedError; - InitialSettingTodayPillNumber? get todayPillNumber => - throw _privateConstructorUsedError; + InitialSettingTodayPillNumber? get todayPillNumber => throw _privateConstructorUsedError; List get reminderTimes => throw _privateConstructorUsedError; bool get isOnReminder => throw _privateConstructorUsedError; bool get isLoading => throw _privateConstructorUsedError; @@ -178,15 +151,12 @@ mixin _$InitialSettingState { LinkAccountType? get accountType => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $InitialSettingStateCopyWith get copyWith => - throw _privateConstructorUsedError; + $InitialSettingStateCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $InitialSettingStateCopyWith<$Res> { - factory $InitialSettingStateCopyWith( - InitialSettingState value, $Res Function(InitialSettingState) then) = - _$InitialSettingStateCopyWithImpl<$Res, InitialSettingState>; + factory $InitialSettingStateCopyWith(InitialSettingState value, $Res Function(InitialSettingState) then) = _$InitialSettingStateCopyWithImpl<$Res, InitialSettingState>; @useResult $Res call( {List pillSheetTypes, @@ -201,8 +171,7 @@ abstract class $InitialSettingStateCopyWith<$Res> { } /// @nodoc -class _$InitialSettingStateCopyWithImpl<$Res, $Val extends InitialSettingState> - implements $InitialSettingStateCopyWith<$Res> { +class _$InitialSettingStateCopyWithImpl<$Res, $Val extends InitialSettingState> implements $InitialSettingStateCopyWith<$Res> { _$InitialSettingStateCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -260,19 +229,15 @@ class _$InitialSettingStateCopyWithImpl<$Res, $Val extends InitialSettingState> return null; } - return $InitialSettingTodayPillNumberCopyWith<$Res>(_value.todayPillNumber!, - (value) { + return $InitialSettingTodayPillNumberCopyWith<$Res>(_value.todayPillNumber!, (value) { return _then(_value.copyWith(todayPillNumber: value) as $Val); }); } } /// @nodoc -abstract class _$$InitialSettingStateImplCopyWith<$Res> - implements $InitialSettingStateCopyWith<$Res> { - factory _$$InitialSettingStateImplCopyWith(_$InitialSettingStateImpl value, - $Res Function(_$InitialSettingStateImpl) then) = - __$$InitialSettingStateImplCopyWithImpl<$Res>; +abstract class _$$InitialSettingStateImplCopyWith<$Res> implements $InitialSettingStateCopyWith<$Res> { + factory _$$InitialSettingStateImplCopyWith(_$InitialSettingStateImpl value, $Res Function(_$InitialSettingStateImpl) then) = __$$InitialSettingStateImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -289,12 +254,8 @@ abstract class _$$InitialSettingStateImplCopyWith<$Res> } /// @nodoc -class __$$InitialSettingStateImplCopyWithImpl<$Res> - extends _$InitialSettingStateCopyWithImpl<$Res, _$InitialSettingStateImpl> - implements _$$InitialSettingStateImplCopyWith<$Res> { - __$$InitialSettingStateImplCopyWithImpl(_$InitialSettingStateImpl _value, - $Res Function(_$InitialSettingStateImpl) _then) - : super(_value, _then); +class __$$InitialSettingStateImplCopyWithImpl<$Res> extends _$InitialSettingStateCopyWithImpl<$Res, _$InitialSettingStateImpl> implements _$$InitialSettingStateImplCopyWith<$Res> { + __$$InitialSettingStateImplCopyWithImpl(_$InitialSettingStateImpl _value, $Res Function(_$InitialSettingStateImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -396,39 +357,23 @@ class _$InitialSettingStateImpl extends _InitialSettingState { return identical(this, other) || (other.runtimeType == runtimeType && other is _$InitialSettingStateImpl && - const DeepCollectionEquality() - .equals(other._pillSheetTypes, _pillSheetTypes) && - (identical(other.todayPillNumber, todayPillNumber) || - other.todayPillNumber == todayPillNumber) && - const DeepCollectionEquality() - .equals(other._reminderTimes, _reminderTimes) && - (identical(other.isOnReminder, isOnReminder) || - other.isOnReminder == isOnReminder) && - (identical(other.isLoading, isLoading) || - other.isLoading == isLoading) && - (identical(other.settingIsExist, settingIsExist) || - other.settingIsExist == settingIsExist) && - (identical(other.accountType, accountType) || - other.accountType == accountType)); + const DeepCollectionEquality().equals(other._pillSheetTypes, _pillSheetTypes) && + (identical(other.todayPillNumber, todayPillNumber) || other.todayPillNumber == todayPillNumber) && + const DeepCollectionEquality().equals(other._reminderTimes, _reminderTimes) && + (identical(other.isOnReminder, isOnReminder) || other.isOnReminder == isOnReminder) && + (identical(other.isLoading, isLoading) || other.isLoading == isLoading) && + (identical(other.settingIsExist, settingIsExist) || other.settingIsExist == settingIsExist) && + (identical(other.accountType, accountType) || other.accountType == accountType)); } @override int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(_pillSheetTypes), - todayPillNumber, - const DeepCollectionEquality().hash(_reminderTimes), - isOnReminder, - isLoading, - settingIsExist, - accountType); + runtimeType, const DeepCollectionEquality().hash(_pillSheetTypes), todayPillNumber, const DeepCollectionEquality().hash(_reminderTimes), isOnReminder, isLoading, settingIsExist, accountType); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$InitialSettingStateImplCopyWith<_$InitialSettingStateImpl> get copyWith => - __$$InitialSettingStateImplCopyWithImpl<_$InitialSettingStateImpl>( - this, _$identity); + _$$InitialSettingStateImplCopyWith<_$InitialSettingStateImpl> get copyWith => __$$InitialSettingStateImplCopyWithImpl<_$InitialSettingStateImpl>(this, _$identity); } abstract class _InitialSettingState extends InitialSettingState { @@ -458,6 +403,5 @@ abstract class _InitialSettingState extends InitialSettingState { LinkAccountType? get accountType; @override @JsonKey(ignore: true) - _$$InitialSettingStateImplCopyWith<_$InitialSettingStateImpl> get copyWith => - throw _privateConstructorUsedError; + _$$InitialSettingStateImplCopyWith<_$InitialSettingStateImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/initial_setting/initial_setting_state_notifier.dart b/lib/features/initial_setting/initial_setting_state_notifier.dart index a7b69ef37c..07cd990255 100644 --- a/lib/features/initial_setting/initial_setting_state_notifier.dart +++ b/lib/features/initial_setting/initial_setting_state_notifier.dart @@ -18,8 +18,7 @@ import 'package:pilll/utils/datetime/day.dart'; import 'package:pilll/utils/local_notification.dart'; import 'package:riverpod/riverpod.dart'; -final initialSettingStateNotifierProvider = StateNotifierProvider.autoDispose< - InitialSettingStateNotifier, InitialSettingState>( +final initialSettingStateNotifierProvider = StateNotifierProvider.autoDispose( (ref) => InitialSettingStateNotifier( ref.watch(endInitialSettingProvider), ref.watch(batchFactoryProvider), @@ -39,8 +38,7 @@ class InitialSettingStateNotifier extends StateNotifier { final BatchSetPillSheetModifiedHistory batchSetPillSheetModifiedHistory; final BatchSetPillSheetGroup batchSetPillSheetGroup; final RemoteConfigParameter remoteConfigParameter; - final RegisterReminderLocalNotificationRunner - registerReminderLocalNotificationRunner; + final RegisterReminderLocalNotificationRunner registerReminderLocalNotificationRunner; InitialSettingStateNotifier( this.endInitialSetting, @@ -67,8 +65,7 @@ class InitialSettingStateNotifier extends StateNotifier { } void addPillSheetType(PillSheetType pillSheetType) { - state = state - .copyWith(pillSheetTypes: [...state.pillSheetTypes, pillSheetType]); + state = state.copyWith(pillSheetTypes: [...state.pillSheetTypes, pillSheetType]); } void changePillSheetType(int index, PillSheetType pillSheetType) { @@ -119,8 +116,7 @@ class InitialSettingStateNotifier extends StateNotifier { final todayPillNumber = state.todayPillNumber; PillSheetGroup? createdPillSheetGroup; if (todayPillNumber != null) { - final createdPillSheets = - state.pillSheetTypes.asMap().keys.map((pageIndex) { + final createdPillSheets = state.pillSheetTypes.asMap().keys.map((pageIndex) { return InitialSettingState.buildPillSheet( pageIndex: pageIndex, todayPillNumber: todayPillNumber, @@ -141,8 +137,7 @@ class InitialSettingStateNotifier extends StateNotifier { ), ); - final history = PillSheetModifiedHistoryServiceActionFactory - .createCreatedPillSheetAction( + final history = PillSheetModifiedHistoryServiceActionFactory.createCreatedPillSheetAction( pillSheetIDs: pillSheetIDs, pillSheetGroupID: createdPillSheetGroup.id, beforePillSheetGroup: null, @@ -178,8 +173,7 @@ class InitialSettingStateNotifier extends StateNotifier { } } -final registerReminderLocalNotificationRunnerProvider = - Provider((ref) => RegisterReminderLocalNotificationRunner()); +final registerReminderLocalNotificationRunnerProvider = Provider((ref) => RegisterReminderLocalNotificationRunner()); // MockができないのでWrapperを作る class RegisterReminderLocalNotificationRunner { diff --git a/lib/features/initial_setting/migrate_info.dart b/lib/features/initial_setting/migrate_info.dart index 9ddfe5b786..e8b4577b46 100644 --- a/lib/features/initial_setting/migrate_info.dart +++ b/lib/features/initial_setting/migrate_info.dart @@ -12,16 +12,14 @@ class MigrateInfo extends HookConsumerWidget { const MigrateInfo({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { - final sharedPreferences = ref.watch( - boolSharedPreferencesProvider(BoolKey.migrateFrom132IsShown).notifier); + final sharedPreferences = ref.watch(boolSharedPreferencesProvider(BoolKey.migrateFrom132IsShown).notifier); return Scaffold( backgroundColor: PilllColors.background, body: SingleChildScrollView( child: Center( child: Container( - padding: - const EdgeInsets.only(left: 15, right: 15, bottom: 15, top: 24), + padding: const EdgeInsets.only(left: 15, right: 15, bottom: 15, top: 24), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, @@ -41,8 +39,7 @@ class MigrateInfo extends HookConsumerWidget { text: const TextSpan( children: [ TextSpan( - text: - "今回のアップデートにより大型リニューアル前のアプリでピルシートを服用していたときのデータを参照できるようにしました。", + text: "今回のアップデートにより大型リニューアル前のアプリでピルシートを服用していたときのデータを参照できるようにしました。", style: TextStyle( fontFamily: FontFamily.japanese, fontWeight: FontWeight.w300, @@ -87,8 +84,7 @@ class MigrateInfo extends HookConsumerWidget { text: const TextSpan( children: [ TextSpan( - text: - "同じようにお困りの方はこちらの表示を参考にしてピルシートの番号を調整していただくようお願いします。ピル番号の調整はピルシートを作っていただいてから", + text: "同じようにお困りの方はこちらの表示を参考にしてピルシートの番号を調整していただくようお願いします。ピル番号の調整はピルシートを作っていただいてから", style: TextStyle( fontFamily: FontFamily.japanese, fontWeight: FontWeight.w300, diff --git a/lib/features/initial_setting/pill_sheet_group/initial_setting_pill_sheet_group_page.dart b/lib/features/initial_setting/pill_sheet_group/initial_setting_pill_sheet_group_page.dart index 04b4bd9ed5..fefa2f61c7 100644 --- a/lib/features/initial_setting/pill_sheet_group/initial_setting_pill_sheet_group_page.dart +++ b/lib/features/initial_setting/pill_sheet_group/initial_setting_pill_sheet_group_page.dart @@ -28,15 +28,12 @@ class InitialSettingPillSheetGroupPage extends HookConsumerWidget { final state = ref.watch(initialSettingStateNotifierProvider); final isAppleLinked = ref.watch(isAppleLinkedProvider); final isGoogleLinked = ref.watch(isGoogleLinkedProvider); - final userIsAnonymous = - FirebaseAuth.instance.currentUser?.isAnonymous == true; + final userIsAnonymous = FirebaseAuth.instance.currentUser?.isAnonymous == true; // For linked user useEffect(() { if (userIsAnonymous) { - analytics.logEvent( - name: "initial_setting_signin_account", - parameters: {"uid": FirebaseAuth.instance.currentUser?.uid}); + analytics.logEvent(name: "initial_setting_signin_account", parameters: {"uid": FirebaseAuth.instance.currentUser?.uid}); final LinkAccountType? accountType = () { if (isAppleLinked) { @@ -92,8 +89,7 @@ class InitialSettingPillSheetGroupPage extends HookConsumerWidget { ), textAlign: TextAlign.center, ), - InitialSettingPillSheetGroupPageBody( - state: state, store: store), + InitialSettingPillSheetGroupPageBody(state: state, store: store), const SizedBox(height: 100), ], ), @@ -112,11 +108,8 @@ class InitialSettingPillSheetGroupPage extends HookConsumerWidget { child: PrimaryButton( text: "次へ", onPressed: () async { - analytics.logEvent( - name: "next_to_today_pill_number"); - Navigator.of(context).push( - InitialSettingSelectTodayPillNumberPageRoute - .route()); + analytics.logEvent(name: "next_to_today_pill_number"); + Navigator.of(context).push(InitialSettingSelectTodayPillNumberPageRoute.route()); }, ), ), @@ -125,8 +118,7 @@ class InitialSettingPillSheetGroupPage extends HookConsumerWidget { AlertButton( text: "すでにアカウントをお持ちの方はこちら", onPressed: () async { - analytics.logEvent( - name: "pressed_initial_setting_signin"); + analytics.logEvent(name: "pressed_initial_setting_signin"); showSignInSheet( context, SignInSheetStateContext.initialSetting, @@ -164,9 +156,7 @@ class InitialSettingPillSheetGroupPageBody extends StatelessWidget { @override Widget build(BuildContext context) { if (state.pillSheetTypes.isEmpty) { - return AddPillSheetTypeEmpty( - onSelect: (pillSheetType) => - store.selectedFirstPillSheetType(pillSheetType)); + return AddPillSheetTypeEmpty(onSelect: (pillSheetType) => store.selectedFirstPillSheetType(pillSheetType)); } else { return Column( children: [ @@ -174,24 +164,15 @@ class InitialSettingPillSheetGroupPageBody extends StatelessWidget { SettingPillSheetGroup( pillSheetTypes: state.pillSheetTypes, onAdd: (pillSheetType) { - analytics.logEvent( - name: "initial_setting_add_pill_sheet_group", - parameters: {"pill_sheet_type": pillSheetType.fullName}); + analytics.logEvent(name: "initial_setting_add_pill_sheet_group", parameters: {"pill_sheet_type": pillSheetType.fullName}); store.addPillSheetType(pillSheetType); }, onChange: (index, pillSheetType) { - analytics.logEvent( - name: "initial_setting_change_pill_sheet_group", - parameters: { - "index": index, - "pill_sheet_type": pillSheetType.fullName - }); + analytics.logEvent(name: "initial_setting_change_pill_sheet_group", parameters: {"index": index, "pill_sheet_type": pillSheetType.fullName}); store.changePillSheetType(index, pillSheetType); }, onDelete: (index) { - analytics.logEvent( - name: "initial_setting_delete_pill_sheet_group", - parameters: {"index": index}); + analytics.logEvent(name: "initial_setting_delete_pill_sheet_group", parameters: {"index": index}); store.removePillSheetType(index); }), ], @@ -200,8 +181,7 @@ class InitialSettingPillSheetGroupPageBody extends StatelessWidget { } } -extension InitialSettingPillSheetGroupPageRoute - on InitialSettingPillSheetGroupPage { +extension InitialSettingPillSheetGroupPageRoute on InitialSettingPillSheetGroupPage { static InitialSettingPillSheetGroupPage screen() { analytics.setCurrentScreen(screenName: "InitialSettingPillSheetGroupPage"); return const InitialSettingPillSheetGroupPage(); diff --git a/lib/features/initial_setting/premium_trial/initial_setting_premium_trial_start_page.dart b/lib/features/initial_setting/premium_trial/initial_setting_premium_trial_start_page.dart index ac9761590c..0fa42a8cea 100644 --- a/lib/features/initial_setting/premium_trial/initial_setting_premium_trial_start_page.dart +++ b/lib/features/initial_setting/premium_trial/initial_setting_premium_trial_start_page.dart @@ -22,10 +22,8 @@ class IntiialSettingPremiumTrialStartPage extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final store = ref.watch(initialSettingStateNotifierProvider.notifier); - final registerReminderLocalNotification = - ref.watch(registerReminderLocalNotificationProvider); - final didEndInitialSettingNotifier = ref.watch( - boolSharedPreferencesProvider(BoolKey.didEndInitialSetting).notifier); + final registerReminderLocalNotification = ref.watch(registerReminderLocalNotificationProvider); + final didEndInitialSettingNotifier = ref.watch(boolSharedPreferencesProvider(BoolKey.didEndInitialSetting).notifier); final remoteConfigParameter = ref.watch(remoteConfigParameterProvider); return Scaffold( @@ -65,16 +63,13 @@ class IntiialSettingPremiumTrialStartPage extends HookConsumerWidget { ], ), Padding( - padding: const EdgeInsets.only( - left: 24.5, right: 24.5, top: 24), + padding: const EdgeInsets.only(left: 24.5, right: 24.5, top: 24), child: Stack( clipBehavior: Clip.none, alignment: AlignmentDirectional.topEnd, children: [ Image.asset( - Platform.isIOS - ? "images/ios-quick-record.gif" - : "images/android-quick-record.gif", + Platform.isIOS ? "images/ios-quick-record.gif" : "images/android-quick-record.gif", ), Positioned( right: -27, @@ -144,11 +139,9 @@ ${remoteConfigParameter.trialDeadlineDateOffsetDay}日間すべての機能が final navigator = Navigator.of(context); await store.register(); await registerReminderLocalNotification(); - await AppRouter.endInitialSetting( - navigator, didEndInitialSettingNotifier); + await AppRouter.endInitialSetting(navigator, didEndInitialSettingNotifier); } catch (error) { - if (context.mounted) - showErrorAlert(context, error.toString()); + if (context.mounted) showErrorAlert(context, error.toString()); } }, ), @@ -161,12 +154,10 @@ ${remoteConfigParameter.trialDeadlineDateOffsetDay}日間すべての機能が } } -extension IntiialSettingPremiumTrialStartPageRoute - on IntiialSettingPremiumTrialStartPage { +extension IntiialSettingPremiumTrialStartPageRoute on IntiialSettingPremiumTrialStartPage { static Route route() { return MaterialPageRoute( - settings: - const RouteSettings(name: "IntiialSettingPremiumTrialStartPage"), + settings: const RouteSettings(name: "IntiialSettingPremiumTrialStartPage"), builder: (_) => const IntiialSettingPremiumTrialStartPage(), ); } diff --git a/lib/features/initial_setting/reminder_times/initial_setting_reminder_times_page.dart b/lib/features/initial_setting/reminder_times/initial_setting_reminder_times_page.dart index 724d827861..f70649802d 100644 --- a/lib/features/initial_setting/reminder_times/initial_setting_reminder_times_page.dart +++ b/lib/features/initial_setting/reminder_times/initial_setting_reminder_times_page.dart @@ -87,10 +87,7 @@ class InitialSettingReminderTimesPage extends HookConsumerWidget { ), recognizer: TapGestureRecognizer() ..onTap = () { - launchUrl( - Uri.parse( - "https://bannzai.github.io/Pilll/PrivacyPolicy"), - mode: LaunchMode.inAppWebView); + launchUrl(Uri.parse("https://bannzai.github.io/Pilll/PrivacyPolicy"), mode: LaunchMode.inAppWebView); }, ), const TextSpan( @@ -112,10 +109,7 @@ class InitialSettingReminderTimesPage extends HookConsumerWidget { ), recognizer: TapGestureRecognizer() ..onTap = () { - launchUrl( - Uri.parse( - "https://bannzai.github.io/Pilll/Terms"), - mode: LaunchMode.inAppWebView); + launchUrl(Uri.parse("https://bannzai.github.io/Pilll/Terms"), mode: LaunchMode.inAppWebView); }, ), const TextSpan( @@ -136,10 +130,8 @@ class InitialSettingReminderTimesPage extends HookConsumerWidget { child: PrimaryButton( text: "次へ", onPressed: () async { - analytics.logEvent( - name: "next_initial_setting_reminder_times"); - Navigator.of(context).push( - IntiialSettingPremiumTrialStartPageRoute.route()); + analytics.logEvent(name: "next_initial_setting_reminder_times"); + Navigator.of(context).push(IntiialSettingPremiumTrialStartPageRoute.route()); }, ), ), @@ -162,19 +154,15 @@ class InitialSettingReminderTimesPage extends HookConsumerWidget { analytics.logEvent(name: "show_initial_setting_reminder_picker"); final reminderDateTime = state.reminderTimeOrNull(index); final n = now(); - DateTime initialDateTime = - reminderDateTime ?? DateTime(n.year, n.month, n.day, n.hour, 0, 0); + DateTime initialDateTime = reminderDateTime ?? DateTime(n.year, n.month, n.day, n.hour, 0, 0); showModalBottomSheet( context: context, builder: (BuildContext context) { return TimePicker( initialDateTime: initialDateTime, done: (dateTime) { - analytics.logEvent( - name: "selected_times_initial_setting", - parameters: {"hour": dateTime.hour, "minute": dateTime.minute}); - store.setReminderTime( - index: index, hour: dateTime.hour, minute: dateTime.minute); + analytics.logEvent(name: "selected_times_initial_setting", parameters: {"hour": dateTime.hour, "minute": dateTime.minute}); + store.setReminderTime(index: index, hour: dateTime.hour, minute: dateTime.minute); Navigator.pop(context); }, ); @@ -189,9 +177,7 @@ class InitialSettingReminderTimesPage extends HookConsumerWidget { int index, ) { final reminderTime = state.reminderTimeOrNull(index); - final formValue = reminderTime == null - ? "--:--" - : DateTimeFormatter.militaryTime(reminderTime); + final formValue = reminderTime == null ? "--:--" : DateTimeFormatter.militaryTime(reminderTime); return Padding( padding: const EdgeInsets.fromLTRB(10, 0, 10, 0), child: Column( @@ -239,8 +225,7 @@ class InitialSettingReminderTimesPage extends HookConsumerWidget { } } -extension InitialSettingReminderTimesPageRoute - on InitialSettingReminderTimesPage { +extension InitialSettingReminderTimesPageRoute on InitialSettingReminderTimesPage { static Route route() { return MaterialPageRoute( settings: const RouteSettings(name: "InitialSettingReminderTimesPage"), diff --git a/lib/features/initial_setting/today_pill_number/initial_setting_select_today_pill_number_page.dart b/lib/features/initial_setting/today_pill_number/initial_setting_select_today_pill_number_page.dart index 2ced1d4c67..c8465296d3 100644 --- a/lib/features/initial_setting/today_pill_number/initial_setting_select_today_pill_number_page.dart +++ b/lib/features/initial_setting/today_pill_number/initial_setting_select_today_pill_number_page.dart @@ -67,10 +67,8 @@ class InitialSettingSelectTodayPillNumberPage extends HookConsumerWidget { InconspicuousButton( onPressed: () async { store.unsetTodayPillNumber(); - analytics.logEvent( - name: "unknown_number_initial_setting"); - Navigator.of(context) - .push(InitialSettingReminderTimesPageRoute.route()); + analytics.logEvent(name: "unknown_number_initial_setting"); + Navigator.of(context).push(InitialSettingReminderTimesPageRoute.route()); }, text: "まだ分からない", ), @@ -88,10 +86,8 @@ class InitialSettingSelectTodayPillNumberPage extends HookConsumerWidget { onPressed: state.todayPillNumber == null ? null : () async { - analytics.logEvent( - name: "done_today_number_initial_setting"); - Navigator.of(context).push( - InitialSettingReminderTimesPageRoute.route()); + analytics.logEvent(name: "done_today_number_initial_setting"); + Navigator.of(context).push(InitialSettingReminderTimesPageRoute.route()); }, ), ), @@ -106,12 +102,10 @@ class InitialSettingSelectTodayPillNumberPage extends HookConsumerWidget { } } -extension InitialSettingSelectTodayPillNumberPageRoute - on InitialSettingSelectTodayPillNumberPage { +extension InitialSettingSelectTodayPillNumberPageRoute on InitialSettingSelectTodayPillNumberPage { static Route route() { return MaterialPageRoute( - settings: - const RouteSettings(name: "InitialSettingSelectTodayPillNumberPage"), + settings: const RouteSettings(name: "InitialSettingSelectTodayPillNumberPage"), builder: (_) => const InitialSettingSelectTodayPillNumberPage(), ); } diff --git a/lib/features/initial_setting/today_pill_number/select_today_pill_number_pill_sheet_list.dart b/lib/features/initial_setting/today_pill_number/select_today_pill_number_pill_sheet_list.dart index 9c5d8cfd1e..a2e8d59fa9 100644 --- a/lib/features/initial_setting/today_pill_number/select_today_pill_number_pill_sheet_list.dart +++ b/lib/features/initial_setting/today_pill_number/select_today_pill_number_pill_sheet_list.dart @@ -22,15 +22,12 @@ class SelectTodayPillNumberPillSheetList extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final pageController = usePageController( - viewportFraction: (PillSheetViewLayout.width + 20) / - MediaQuery.of(context).size.width); + final pageController = usePageController(viewportFraction: (PillSheetViewLayout.width + 20) / MediaQuery.of(context).size.width); return Column( children: [ SizedBox( height: PillSheetViewLayout.calcHeight( - PillSheetViewLayout.mostLargePillSheetType(state.pillSheetTypes) - .numberOfLineInPillSheet, + PillSheetViewLayout.mostLargePillSheetType(state.pillSheetTypes).numberOfLineInPillSheet, true, ), child: PageView( @@ -47,16 +44,12 @@ class SelectTodayPillNumberPillSheetList extends HookConsumerWidget { pageIndex: index, appearanceMode: PillSheetAppearanceMode.number, pillSheetTypes: state.pillSheetTypes, - selectedPillNumberIntoPillSheet: - state.selectedTodayPillNumberIntoPillSheet( - pageIndex: index), + selectedPillNumberIntoPillSheet: state.selectedTodayPillNumberIntoPillSheet(pageIndex: index), markSelected: (pageIndex, number) { - analytics.logEvent( - name: "selected_today_number_initial_setting", - parameters: { - "pill_number": number, - "page": pageIndex, - }); + analytics.logEvent(name: "selected_today_number_initial_setting", parameters: { + "pill_number": number, + "page": pageIndex, + }); store.setTodayPillNumber( pageIndex: pageIndex, pillNumberInPillSheet: number, diff --git a/lib/features/menstruation/components/calendar/menstruation_calendar_header.dart b/lib/features/menstruation/components/calendar/menstruation_calendar_header.dart index e2cbbfcc52..8b2faee35e 100644 --- a/lib/features/menstruation/components/calendar/menstruation_calendar_header.dart +++ b/lib/features/menstruation/components/calendar/menstruation_calendar_header.dart @@ -19,8 +19,7 @@ const double _horizontalPadding = 10; class MenstruationCalendarHeader extends StatelessWidget { final List calendarMenstruationBandModels; - final List - calendarScheduledMenstruationBandModels; + final List calendarScheduledMenstruationBandModels; final List calendarNextPillSheetBandModels; final List diaries; final List schedules; @@ -57,8 +56,7 @@ class MenstruationCalendarHeader extends StatelessWidget { itemBuilder: (context, index) { final days = menstruationWeekCalendarDataSource[index]; return SizedBox( - width: MediaQuery.of(context).size.width - - _horizontalPadding * 2, + width: MediaQuery.of(context).size.width - _horizontalPadding * 2, height: MenstruationPageConst.tileHeight, child: CalendarWeekLine( dateRange: DateRange(days.first, days.last), @@ -67,25 +65,16 @@ class MenstruationCalendarHeader extends StatelessWidget { return CalendarDayTile( weekday: weekday, date: date, - diary: diaries.firstWhereOrNull( - (e) => isSameDay(e.date, date)), - schedule: schedules.firstWhereOrNull( - (e) => isSameDay(e.date, date)), + diary: diaries.firstWhereOrNull((e) => isSameDay(e.date, date)), + schedule: schedules.firstWhereOrNull((e) => isSameDay(e.date, date)), onTap: (date) { - analytics.logEvent( - name: "did_select_day_tile_on_menstruation"); - transitionWhenCalendarDayTapped(context, - date: date, - diaries: diaries, - schedules: schedules); + analytics.logEvent(name: "did_select_day_tile_on_menstruation"); + transitionWhenCalendarDayTapped(context, date: date, diaries: diaries, schedules: schedules); }); }, - calendarMenstruationBandModels: - calendarMenstruationBandModels, - calendarNextPillSheetBandModels: - calendarNextPillSheetBandModels, - calendarScheduledMenstruationBandModels: - calendarScheduledMenstruationBandModels, + calendarMenstruationBandModels: calendarMenstruationBandModels, + calendarNextPillSheetBandModels: calendarNextPillSheetBandModels, + calendarScheduledMenstruationBandModels: calendarScheduledMenstruationBandModels, ), ); }, @@ -103,10 +92,7 @@ class _WeekdayLine extends StatelessWidget { Widget build(BuildContext context) { return Row( mainAxisAlignment: MainAxisAlignment.start, - children: List.generate( - Weekday.values.length, - (index) => - Expanded(child: WeekdayBadge(weekday: Weekday.values[index]))), + children: List.generate(Weekday.values.length, (index) => Expanded(child: WeekdayBadge(weekday: Weekday.values[index]))), ); } } diff --git a/lib/features/menstruation/components/menstruation_card_list.dart b/lib/features/menstruation/components/menstruation_card_list.dart index c21c4b081c..1a0c41c366 100644 --- a/lib/features/menstruation/components/menstruation_card_list.dart +++ b/lib/features/menstruation/components/menstruation_card_list.dart @@ -13,8 +13,7 @@ import 'package:pilll/entity/setting.codegen.dart'; import 'package:pilll/utils/datetime/day.dart'; class MenstruationCardList extends StatelessWidget { - final List - calendarScheduledMenstruationBandModels; + final List calendarScheduledMenstruationBandModels; final User user; final Setting setting; final PillSheetGroup? latestPillSheetGroup; @@ -33,10 +32,8 @@ class MenstruationCardList extends StatelessWidget { @override Widget build(BuildContext context) { - final card = cardState(latestPillSheetGroup, latestMenstruation, setting, - calendarScheduledMenstruationBandModels); - final historyCard = - historyCardState(latestMenstruation, allMenstruation, user); + final card = cardState(latestPillSheetGroup, latestMenstruation, setting, calendarScheduledMenstruationBandModels); + final historyCard = historyCardState(latestMenstruation, allMenstruation, user); return Expanded( child: Container( color: PilllColors.background, @@ -48,8 +45,7 @@ class MenstruationCardList extends StatelessWidget { MenstruationCard(card), const SizedBox(height: 24), ], - if (historyCard != null) - MenstruationHistoryCard(state: historyCard), + if (historyCard != null) MenstruationHistoryCard(state: historyCard), ], ), ), @@ -61,8 +57,7 @@ MenstruationCardState? cardState( PillSheetGroup? pillSheetGroup, Menstruation? menstration, Setting setting, - List - calendarScheduledMenstruationBandModels, + List calendarScheduledMenstruationBandModels, ) { if (menstration != null && menstration.dateRange.inRange(today())) { return MenstruationCardState.record(menstruation: menstration); @@ -71,26 +66,20 @@ MenstruationCardState? cardState( if (pillSheetGroup == null || pillSheetGroup.pillSheets.isEmpty) { return null; } - if (setting.pillNumberForFromMenstruation == 0 || - setting.durationMenstruation == 0) { + if (setting.pillNumberForFromMenstruation == 0 || setting.durationMenstruation == 0) { return null; } final menstruationDateRanges = calendarScheduledMenstruationBandModels; - final inTheMiddleDateRanges = menstruationDateRanges - .map((e) => DateRange(e.begin, e.end)) - .where((element) => element.inRange(today())); + final inTheMiddleDateRanges = menstruationDateRanges.map((e) => DateRange(e.begin, e.end)).where((element) => element.inRange(today())); if (inTheMiddleDateRanges.isNotEmpty) { - return MenstruationCardState.inTheMiddle( - scheduledDate: inTheMiddleDateRanges.first.begin); + return MenstruationCardState.inTheMiddle(scheduledDate: inTheMiddleDateRanges.first.begin); } - final futureDateRanges = - menstruationDateRanges.where((element) => element.begin.isAfter(today())); + final futureDateRanges = menstruationDateRanges.where((element) => element.begin.isAfter(today())); if (futureDateRanges.isNotEmpty) { - return MenstruationCardState.future( - nextSchedule: futureDateRanges.first.begin); + return MenstruationCardState.future(nextSchedule: futureDateRanges.first.begin); } // 生理設定のfromMenstruationの値がすべてのピルシートタイプの合計よりも小さい場合に起こる diff --git a/lib/features/menstruation/components/menstruation_record_button.dart b/lib/features/menstruation/components/menstruation_record_button.dart index 15cc35900d..4c75fb83b0 100644 --- a/lib/features/menstruation/components/menstruation_record_button.dart +++ b/lib/features/menstruation/components/menstruation_record_button.dart @@ -32,8 +32,7 @@ class MenstruationRecordButton extends HookConsumerWidget { ScaffoldMessenger.of(context).showSnackBar( SnackBar( duration: const Duration(seconds: 2), - content: Text( - "${DateTimeFormatter.monthAndDay(menstruation.beginDate)}から生理開始で記録しました"), + content: Text("${DateTimeFormatter.monthAndDay(menstruation.beginDate)}から生理開始で記録しました"), ), ); } @@ -45,8 +44,7 @@ class MenstruationRecordButton extends HookConsumerWidget { analytics.logEvent(name: "pressed_menstruation_record"); final latestMenstruation = this.latestMenstruation; - if (latestMenstruation != null && - latestMenstruation.dateRange.inRange(today())) { + if (latestMenstruation != null && latestMenstruation.dateRange.inRange(today())) { // 生理期間中は、生理期間を編集する return showMenstruationEditSelectionSheet( context, @@ -62,8 +60,7 @@ class MenstruationRecordButton extends HookConsumerWidget { showModalBottomSheet( context: context, - builder: (_) => - MenstruationSelectModifyTypeSheet(onTap: (type) async { + builder: (_) => MenstruationSelectModifyTypeSheet(onTap: (type) async { switch (type) { case MenstruationSelectModifyType.today: analytics.logEvent(name: "tapped_menstruation_record_today"); @@ -82,8 +79,7 @@ class MenstruationRecordButton extends HookConsumerWidget { } return; case MenstruationSelectModifyType.yesterday: - analytics.logEvent( - name: "tapped_menstruation_record_yesterday"); + analytics.logEvent(name: "tapped_menstruation_record_yesterday"); try { final begin = yesterday(); final created = await beginMenstruation( diff --git a/lib/features/menstruation/data.dart b/lib/features/menstruation/data.dart index 3c807c2a14..a232d223f7 100644 --- a/lib/features/menstruation/data.dart +++ b/lib/features/menstruation/data.dart @@ -3,9 +3,7 @@ import 'package:pilll/utils/datetime/date_add.dart'; import 'package:pilll/utils/datetime/date_compare.dart'; import 'package:pilll/utils/datetime/day.dart'; -final todayCalendarPageIndex = - menstruationWeekCalendarDataSource.lastIndexWhere((element) => - element.where((element) => isSameDay(element, today())).isNotEmpty); +final todayCalendarPageIndex = menstruationWeekCalendarDataSource.lastIndexWhere((element) => element.where((element) => isSameDay(element, today())).isNotEmpty); final List> menstruationWeekCalendarDataSource = () { final base = today(); @@ -15,8 +13,7 @@ final List> menstruationWeekCalendarDataSource = () { begin = begin.subtract(Duration(days: beginWeekdayOffset)); var end = base.add(const Duration(days: 90)); - final endWeekdayOffset = - Weekday.values.last.index - WeekdayFunctions.weekdayFromDate(end).index; + final endWeekdayOffset = Weekday.values.last.index - WeekdayFunctions.weekdayFromDate(end).index; end = end.addDays(endWeekdayOffset); var diffDay = daysBetween(begin, end); @@ -25,8 +22,5 @@ final List> menstruationWeekCalendarDataSource = () { for (int i = 0; i < diffDay; i++) { days.add(begin.addDays(i)); } - return List.generate( - ((diffDay) / Weekday.values.length).round(), - (i) => days.sublist(i * Weekday.values.length, - i * Weekday.values.length + Weekday.values.length)); + return List.generate(((diffDay) / Weekday.values.length).round(), (i) => days.sublist(i * Weekday.values.length, i * Weekday.values.length + Weekday.values.length)); }(); diff --git a/lib/features/menstruation/history/menstruation_history_card.dart b/lib/features/menstruation/history/menstruation_history_card.dart index 8b5336adaf..07d6d96cde 100644 --- a/lib/features/menstruation/history/menstruation_history_card.dart +++ b/lib/features/menstruation/history/menstruation_history_card.dart @@ -21,8 +21,7 @@ class MenstruationHistoryCard extends StatelessWidget { Widget build(BuildContext context) { return AppCard( child: Padding( - padding: - const EdgeInsets.only(top: 16, left: 16, bottom: 16, right: 16), + padding: const EdgeInsets.only(top: 16, left: 16, bottom: 16, right: 16), child: GestureDetector( onTap: () { analytics.logEvent(name: "menstruation_history_card_tapped"); @@ -137,9 +136,7 @@ class MenstruationHisotryCardAvarageInformation extends StatelessWidget { const Spacer(), CounterUnitLayout( title: "平均周期", - number: (state.isPremium || state.isTrial) - ? state.avalageMenstruationDuration - : "🔒", + number: (state.isPremium || state.isTrial) ? state.avalageMenstruationDuration : "🔒", unit: "日", ), const SizedBox(width: 30), @@ -152,9 +149,7 @@ class MenstruationHisotryCardAvarageInformation extends StatelessWidget { const SizedBox(width: 30), CounterUnitLayout( title: "平均日数", - number: (state.isPremium || state.isTrial) - ? state.avalageMenstruationPeriod - : "🔒", + number: (state.isPremium || state.isTrial) ? state.avalageMenstruationPeriod : "🔒", unit: "日", ), const Spacer(), diff --git a/lib/features/menstruation/history/menstruation_history_card_state.dart b/lib/features/menstruation/history/menstruation_history_card_state.dart index 83560a5878..37ebb5ed91 100644 --- a/lib/features/menstruation/history/menstruation_history_card_state.dart +++ b/lib/features/menstruation/history/menstruation_history_card_state.dart @@ -17,10 +17,7 @@ class MenstruationHistoryCardState { required this.trialDeadlineDate, }); - bool get moreButtonIsHidden => - allMenstruations.firstWhereOrNull((element) => element.isActive) != null - ? allMenstruations.length <= 3 - : allMenstruations.length <= 2; + bool get moreButtonIsHidden => allMenstruations.firstWhereOrNull((element) => element.isActive) != null ? allMenstruations.length <= 3 : allMenstruations.length <= 2; Menstruation? get activeMenstruation { if (latestMenstruation.isActive) { return latestMenstruation; @@ -64,8 +61,7 @@ class MenstruationHistoryCardState { break; } final menstruation = allMenstruations[i]; - final menstruationDuration = - menstruationsDiff(menstruation, allMenstruations[i + 1]); + final menstruationDuration = menstruationsDiff(menstruation, allMenstruations[i + 1]); if (menstruationDuration != null) { totalMenstruationDuration += menstruationDuration; count += 1; diff --git a/lib/features/menstruation/menstruation_card.dart b/lib/features/menstruation/menstruation_card.dart index a79b4e9e67..c0b2b27dc6 100644 --- a/lib/features/menstruation/menstruation_card.dart +++ b/lib/features/menstruation/menstruation_card.dart @@ -29,8 +29,7 @@ class MenstruationCard extends StatelessWidget { SvgPicture.asset( "images/menstruation.svg", width: 24, - colorFilter: const ColorFilter.mode( - PilllColors.red, BlendMode.srcIn), + colorFilter: const ColorFilter.mode(PilllColors.red, BlendMode.srcIn), ), Text( state.title, @@ -46,18 +45,13 @@ class MenstruationCard extends StatelessWidget { const SizedBox(width: 12), Text( DateTimeFormatter.monthAndWeekday(state.scheduleDate), - style: const TextStyle( - color: TextColor.gray, - fontSize: 20, - fontWeight: FontWeight.w500, - fontFamily: FontFamily.japanese), + style: const TextStyle(color: TextColor.gray, fontSize: 20, fontWeight: FontWeight.w500, fontFamily: FontFamily.japanese), ), ], ), const SizedBox(height: 8), Container( - padding: - const EdgeInsets.only(left: 32, right: 32, top: 2, bottom: 2), + padding: const EdgeInsets.only(left: 32, right: 32, top: 2, bottom: 2), decoration: BoxDecoration( color: PilllColors.primary, borderRadius: BorderRadius.circular(30), diff --git a/lib/features/menstruation/menstruation_card_state.codegen.dart b/lib/features/menstruation/menstruation_card_state.codegen.dart index 3d0dded371..901a080d51 100644 --- a/lib/features/menstruation/menstruation_card_state.codegen.dart +++ b/lib/features/menstruation/menstruation_card_state.codegen.dart @@ -41,7 +41,6 @@ class MenstruationCardState with _$MenstruationCardState { MenstruationCardState( title: "生理開始日", scheduleDate: menstruation.beginDate, - countdownString: - "${daysBetween(menstruation.beginDate, today()) + 1}日目", + countdownString: "${daysBetween(menstruation.beginDate, today()) + 1}日目", ); } diff --git a/lib/features/menstruation/menstruation_card_state.codegen.freezed.dart b/lib/features/menstruation/menstruation_card_state.codegen.freezed.dart index 7307a1a6aa..d7cc4d93cd 100644 --- a/lib/features/menstruation/menstruation_card_state.codegen.freezed.dart +++ b/lib/features/menstruation/menstruation_card_state.codegen.freezed.dart @@ -21,23 +21,18 @@ mixin _$MenstruationCardState { String get countdownString => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $MenstruationCardStateCopyWith get copyWith => - throw _privateConstructorUsedError; + $MenstruationCardStateCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $MenstruationCardStateCopyWith<$Res> { - factory $MenstruationCardStateCopyWith(MenstruationCardState value, - $Res Function(MenstruationCardState) then) = - _$MenstruationCardStateCopyWithImpl<$Res, MenstruationCardState>; + factory $MenstruationCardStateCopyWith(MenstruationCardState value, $Res Function(MenstruationCardState) then) = _$MenstruationCardStateCopyWithImpl<$Res, MenstruationCardState>; @useResult $Res call({String title, DateTime scheduleDate, String countdownString}); } /// @nodoc -class _$MenstruationCardStateCopyWithImpl<$Res, - $Val extends MenstruationCardState> - implements $MenstruationCardStateCopyWith<$Res> { +class _$MenstruationCardStateCopyWithImpl<$Res, $Val extends MenstruationCardState> implements $MenstruationCardStateCopyWith<$Res> { _$MenstruationCardStateCopyWithImpl(this._value, this._then); // ignore: unused_field @@ -70,25 +65,16 @@ class _$MenstruationCardStateCopyWithImpl<$Res, } /// @nodoc -abstract class _$$MenstruationCardStateImplCopyWith<$Res> - implements $MenstruationCardStateCopyWith<$Res> { - factory _$$MenstruationCardStateImplCopyWith( - _$MenstruationCardStateImpl value, - $Res Function(_$MenstruationCardStateImpl) then) = - __$$MenstruationCardStateImplCopyWithImpl<$Res>; +abstract class _$$MenstruationCardStateImplCopyWith<$Res> implements $MenstruationCardStateCopyWith<$Res> { + factory _$$MenstruationCardStateImplCopyWith(_$MenstruationCardStateImpl value, $Res Function(_$MenstruationCardStateImpl) then) = __$$MenstruationCardStateImplCopyWithImpl<$Res>; @override @useResult $Res call({String title, DateTime scheduleDate, String countdownString}); } /// @nodoc -class __$$MenstruationCardStateImplCopyWithImpl<$Res> - extends _$MenstruationCardStateCopyWithImpl<$Res, - _$MenstruationCardStateImpl> - implements _$$MenstruationCardStateImplCopyWith<$Res> { - __$$MenstruationCardStateImplCopyWithImpl(_$MenstruationCardStateImpl _value, - $Res Function(_$MenstruationCardStateImpl) _then) - : super(_value, _then); +class __$$MenstruationCardStateImplCopyWithImpl<$Res> extends _$MenstruationCardStateCopyWithImpl<$Res, _$MenstruationCardStateImpl> implements _$$MenstruationCardStateImplCopyWith<$Res> { + __$$MenstruationCardStateImplCopyWithImpl(_$MenstruationCardStateImpl _value, $Res Function(_$MenstruationCardStateImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -117,11 +103,7 @@ class __$$MenstruationCardStateImplCopyWithImpl<$Res> /// @nodoc class _$MenstruationCardStateImpl extends _MenstruationCardState { - const _$MenstruationCardStateImpl( - {required this.title, - required this.scheduleDate, - required this.countdownString}) - : super._(); + const _$MenstruationCardStateImpl({required this.title, required this.scheduleDate, required this.countdownString}) : super._(); @override final String title; @@ -141,29 +123,21 @@ class _$MenstruationCardStateImpl extends _MenstruationCardState { (other.runtimeType == runtimeType && other is _$MenstruationCardStateImpl && (identical(other.title, title) || other.title == title) && - (identical(other.scheduleDate, scheduleDate) || - other.scheduleDate == scheduleDate) && - (identical(other.countdownString, countdownString) || - other.countdownString == countdownString)); + (identical(other.scheduleDate, scheduleDate) || other.scheduleDate == scheduleDate) && + (identical(other.countdownString, countdownString) || other.countdownString == countdownString)); } @override - int get hashCode => - Object.hash(runtimeType, title, scheduleDate, countdownString); + int get hashCode => Object.hash(runtimeType, title, scheduleDate, countdownString); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$MenstruationCardStateImplCopyWith<_$MenstruationCardStateImpl> - get copyWith => __$$MenstruationCardStateImplCopyWithImpl< - _$MenstruationCardStateImpl>(this, _$identity); + _$$MenstruationCardStateImplCopyWith<_$MenstruationCardStateImpl> get copyWith => __$$MenstruationCardStateImplCopyWithImpl<_$MenstruationCardStateImpl>(this, _$identity); } abstract class _MenstruationCardState extends MenstruationCardState { - const factory _MenstruationCardState( - {required final String title, - required final DateTime scheduleDate, - required final String countdownString}) = _$MenstruationCardStateImpl; + const factory _MenstruationCardState({required final String title, required final DateTime scheduleDate, required final String countdownString}) = _$MenstruationCardStateImpl; const _MenstruationCardState._() : super._(); @override @@ -174,6 +148,5 @@ abstract class _MenstruationCardState extends MenstruationCardState { String get countdownString; @override @JsonKey(ignore: true) - _$$MenstruationCardStateImplCopyWith<_$MenstruationCardStateImpl> - get copyWith => throw _privateConstructorUsedError; + _$$MenstruationCardStateImplCopyWith<_$MenstruationCardStateImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/menstruation/menstruation_page.dart b/lib/features/menstruation/menstruation_page.dart index 0ba2b36ebb..17e810d4ab 100644 --- a/lib/features/menstruation/menstruation_page.dart +++ b/lib/features/menstruation/menstruation_page.dart @@ -34,10 +34,8 @@ import 'package:pilll/utils/formatter/date_time_formatter.dart'; abstract class MenstruationPageConst { static const double calendarHeaderDropShadowOffset = 2; - static const double tileHeight = - CalendarConstants.tileHeight + calendarHeaderDropShadowOffset; - static const double calendarHeaderHeight = - WeekdayBadgeConst.height + tileHeight; + static const double tileHeight = CalendarConstants.tileHeight + calendarHeaderDropShadowOffset; + static const double calendarHeaderHeight = WeekdayBadgeConst.height + tileHeight; } class MenstruationPage extends HookConsumerWidget { @@ -92,8 +90,7 @@ class MenstruationPageBody extends HookConsumerWidget { final List diaries; final List schedules; final List calendarMenstruationBandModels; - final List - calendarScheduledMenstruationBandModels; + final List calendarScheduledMenstruationBandModels; final List calendarNextPillSheetBandModels; const MenstruationPageBody({ @@ -125,8 +122,7 @@ class MenstruationPageBody extends HookConsumerWidget { backgroundColor: PilllColors.background, appBar: AppBar( title: SizedBox( - child: Text(_displayMonth(page.value), - style: const TextStyle(color: TextColor.black)), + child: Text(_displayMonth(page.value), style: const TextStyle(color: TextColor.black)), ), backgroundColor: PilllColors.white, elevation: 0, @@ -138,18 +134,14 @@ class MenstruationPageBody extends HookConsumerWidget { children: [ MenstruationCalendarHeader( pageController: pageController, - calendarMenstruationBandModels: - calendarMenstruationBandModels, - calendarNextPillSheetBandModels: - calendarNextPillSheetBandModels, - calendarScheduledMenstruationBandModels: - calendarScheduledMenstruationBandModels, + calendarMenstruationBandModels: calendarMenstruationBandModels, + calendarNextPillSheetBandModels: calendarNextPillSheetBandModels, + calendarScheduledMenstruationBandModels: calendarScheduledMenstruationBandModels, diaries: diaries, schedules: schedules, ), MenstruationCardList( - calendarScheduledMenstruationBandModels: - calendarScheduledMenstruationBandModels, + calendarScheduledMenstruationBandModels: calendarScheduledMenstruationBandModels, user: user, setting: setting, latestPillSheetGroup: latestPillSheetGroup, @@ -175,8 +167,7 @@ class MenstruationPageBody extends HookConsumerWidget { ); } - String _displayMonth(int page) => - DateTimeFormatter.jaMonth(_targetEndDayOfWeekday(page)); + String _displayMonth(int page) => DateTimeFormatter.jaMonth(_targetEndDayOfWeekday(page)); DateTime _targetEndDayOfWeekday(int page) { final diff = page - todayCalendarPageIndex; final base = today().addDays(diff * Weekday.values.length); diff --git a/lib/features/menstruation/menstruation_select_modify_type_sheet.dart b/lib/features/menstruation/menstruation_select_modify_type_sheet.dart index c2d23ace35..370e61c282 100644 --- a/lib/features/menstruation/menstruation_select_modify_type_sheet.dart +++ b/lib/features/menstruation/menstruation_select_modify_type_sheet.dart @@ -30,9 +30,7 @@ extension _CellTypeFunction on MenstruationSelectModifyType { } } - return SvgPicture.asset(name(), - colorFilter: - const ColorFilter.mode(PilllColors.primary, BlendMode.srcIn)); + return SvgPicture.asset(name(), colorFilter: const ColorFilter.mode(PilllColors.primary, BlendMode.srcIn)); } } diff --git a/lib/features/menstruation_edit/components/edit/menstruation_date_time_range_picker.dart b/lib/features/menstruation_edit/components/edit/menstruation_date_time_range_picker.dart index cabb2d1581..3c24589880 100644 --- a/lib/features/menstruation_edit/components/edit/menstruation_date_time_range_picker.dart +++ b/lib/features/menstruation_edit/components/edit/menstruation_date_time_range_picker.dart @@ -8,15 +8,13 @@ import 'package:pilll/provider/menstruation.dart'; import 'package:pilll/utils/datetime/day.dart'; import 'package:pilll/utils/formatter/date_time_formatter.dart'; -void _showMenstruationDateRangePicker(BuildContext context, WidgetRef ref, - {required Menstruation? initialMenstruation}) async { +void _showMenstruationDateRangePicker(BuildContext context, WidgetRef ref, {required Menstruation? initialMenstruation}) async { void onSaved(Menstruation savedMenstruation) { if (initialMenstruation == null) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( duration: const Duration(seconds: 2), - content: Text( - "${DateTimeFormatter.monthAndDay(savedMenstruation.beginDate)}から生理開始で記録しました"), + content: Text("${DateTimeFormatter.monthAndDay(savedMenstruation.beginDate)}から生理開始で記録しました"), ), ); } else { @@ -74,13 +72,10 @@ void _showMenstruationDateRangePicker(BuildContext context, WidgetRef ref, } } -void showEditMenstruationDateRangePicker(BuildContext context, WidgetRef ref, - {required Menstruation initialMenstruation}) async { - _showMenstruationDateRangePicker(context, ref, - initialMenstruation: initialMenstruation); +void showEditMenstruationDateRangePicker(BuildContext context, WidgetRef ref, {required Menstruation initialMenstruation}) async { + _showMenstruationDateRangePicker(context, ref, initialMenstruation: initialMenstruation); } -void showCreateMenstruationDateRangePicker( - BuildContext context, WidgetRef ref) async { +void showCreateMenstruationDateRangePicker(BuildContext context, WidgetRef ref) async { _showMenstruationDateRangePicker(context, ref, initialMenstruation: null); } diff --git a/lib/features/menstruation_edit/components/edit/menstruation_edit_selection_sheet.dart b/lib/features/menstruation_edit/components/edit/menstruation_edit_selection_sheet.dart index 10c7572fa3..d169175071 100644 --- a/lib/features/menstruation_edit/components/edit/menstruation_edit_selection_sheet.dart +++ b/lib/features/menstruation_edit/components/edit/menstruation_edit_selection_sheet.dart @@ -106,8 +106,7 @@ class MenstruationEditSelectionSheet extends HookConsumerWidget { AlertButton( text: "キャンセル", onPressed: () async { - analytics.logEvent( - name: "cancelled_delete_menstruation"); + analytics.logEvent(name: "cancelled_delete_menstruation"); Navigator.of(context).pop(); }, @@ -115,14 +114,11 @@ class MenstruationEditSelectionSheet extends HookConsumerWidget { AlertButton( text: "削除する", onPressed: () async { - analytics.logEvent( - name: "pressed_delete_menstruation"); + analytics.logEvent(name: "pressed_delete_menstruation"); final navigator = Navigator.of(context); try { - await ref - .read(deleteMenstruationProvider) - .call(menstruation); + await ref.read(deleteMenstruationProvider).call(menstruation); } catch (e) { if (context.mounted) showErrorAlert(context, e); } @@ -142,8 +138,7 @@ class MenstruationEditSelectionSheet extends HookConsumerWidget { } } -void showMenstruationEditSelectionSheet(BuildContext context, - MenstruationEditSelectionSheet menstruationEditSelectionSheet) { +void showMenstruationEditSelectionSheet(BuildContext context, MenstruationEditSelectionSheet menstruationEditSelectionSheet) { showModalBottomSheet( context: context, builder: (BuildContext context) { diff --git a/lib/features/menstruation_list/menstruation_list_page.dart b/lib/features/menstruation_list/menstruation_list_page.dart index 58bb3bc711..83f5dea52f 100644 --- a/lib/features/menstruation_list/menstruation_list_page.dart +++ b/lib/features/menstruation_list/menstruation_list_page.dart @@ -26,12 +26,7 @@ class MenstruationListPage extends HookConsumerWidget { onPressed: () => Navigator.of(context).pop(), ), centerTitle: false, - title: const Text("生理履歴", - style: TextStyle( - fontFamily: FontFamily.japanese, - fontWeight: FontWeight.w500, - fontSize: 20, - color: TextColor.main)), + title: const Text("生理履歴", style: TextStyle(fontFamily: FontFamily.japanese, fontWeight: FontWeight.w500, fontSize: 20, color: TextColor.main)), backgroundColor: PilllColors.white, elevation: 0, ), @@ -44,9 +39,7 @@ class MenstruationListPage extends HookConsumerWidget { for (var i = 0; i < menstruations.length; i++) ...[ MenstruationListRow( menstruation: menstruations[i], - previousMenstruation: menstruations.length - 1 <= i - ? null - : menstruations[i + 1], + previousMenstruation: menstruations.length - 1 <= i ? null : menstruations[i + 1], ), const SizedBox(height: 8), ], diff --git a/lib/features/menstruation_list/menstruation_list_row.dart b/lib/features/menstruation_list/menstruation_list_row.dart index 1e8a260e36..68f836197c 100644 --- a/lib/features/menstruation_list/menstruation_list_row.dart +++ b/lib/features/menstruation_list/menstruation_list_row.dart @@ -33,12 +33,7 @@ class MenstruationListRow extends HookConsumerWidget { children: [ Row( children: [ - Text(_dateRange, - style: const TextStyle( - fontFamily: FontFamily.japanese, - fontWeight: FontWeight.w400, - fontSize: 12, - color: TextColor.main)), + Text(_dateRange, style: const TextStyle(fontFamily: FontFamily.japanese, fontWeight: FontWeight.w400, fontSize: 12, color: TextColor.main)), ], ), const SizedBox(height: 6), @@ -112,6 +107,5 @@ class MenstruationListRow extends HookConsumerWidget { return widthForDay * menstruationDuration; } - int? get _menstruationDuration => - menstruationsDiff(menstruation, previousMenstruation); + int? get _menstruationDuration => menstruationsDiff(menstruation, previousMenstruation); } diff --git a/lib/features/pill_sheet_modified_history/pill_sheet_modified_history_page.dart b/lib/features/pill_sheet_modified_history/pill_sheet_modified_history_page.dart index fc3d2770f7..de7eba7422 100644 --- a/lib/features/pill_sheet_modified_history/pill_sheet_modified_history_page.dart +++ b/lib/features/pill_sheet_modified_history/pill_sheet_modified_history_page.dart @@ -18,8 +18,7 @@ class PillSheetModifiedHistoriesPage extends HookConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final loadingNext = useState(false); final limit = useState(20); - final historiesAsync = ref - .watch(pillSheetModifiedHistoriesWithLimitProvider(limit: limit.value)); + final historiesAsync = ref.watch(pillSheetModifiedHistoriesWithLimitProvider(limit: limit.value)); final histories = historiesAsync.asData?.value ?? []; return ref.watch(userProvider).when( @@ -47,18 +46,14 @@ class PillSheetModifiedHistoriesPage extends HookConsumerWidget { body: SafeArea( child: NotificationListener( onNotification: (notification) { - if (!loadingNext.value && - notification.metrics.pixels >= - notification.metrics.maxScrollExtent && - histories.isNotEmpty) { + if (!loadingNext.value && notification.metrics.pixels >= notification.metrics.maxScrollExtent && histories.isNotEmpty) { loadingNext.value = true; limit.value += 20; } return true; }, child: Container( - padding: - const EdgeInsets.only(left: 24, right: 24, top: 24), + padding: const EdgeInsets.only(left: 24, right: 24, top: 24), child: Column( mainAxisSize: MainAxisSize.min, children: [ @@ -85,8 +80,7 @@ class PillSheetModifiedHistoriesPage extends HookConsumerWidget { } } -extension PillSheetModifiedHistoriesPageRoute - on PillSheetModifiedHistoriesPage { +extension PillSheetModifiedHistoriesPageRoute on PillSheetModifiedHistoriesPage { static Route route() { return MaterialPageRoute( settings: const RouteSettings(name: "PillSheetModifiedHistoriesPage"), diff --git a/lib/features/premium_introduction/ab_test/b/components/features.dart b/lib/features/premium_introduction/ab_test/b/components/features.dart index 2aeb96cb00..a1d9488e15 100644 --- a/lib/features/premium_introduction/ab_test/b/components/features.dart +++ b/lib/features/premium_introduction/ab_test/b/components/features.dart @@ -15,9 +15,7 @@ class PremiumIntroductionFeatures extends StatelessWidget { alignment: AlignmentDirectional.topEnd, children: [ Image.asset( - Platform.isIOS - ? "images/ios-quick-record.gif" - : "images/android-quick-record.gif", + Platform.isIOS ? "images/ios-quick-record.gif" : "images/android-quick-record.gif", ), Positioned( right: -27, diff --git a/lib/features/premium_introduction/ab_test/b/premium_introduction_sheet.dart b/lib/features/premium_introduction/ab_test/b/premium_introduction_sheet.dart index 39fdcd87ce..a8f9bb0f75 100644 --- a/lib/features/premium_introduction/ab_test/b/premium_introduction_sheet.dart +++ b/lib/features/premium_introduction/ab_test/b/premium_introduction_sheet.dart @@ -64,8 +64,7 @@ class PremiumIntroductionSheetBody extends HookConsumerWidget { final offeringType = ref.watch(currentOfferingTypeProvider(user)); final monthlyPackage = ref.watch(monthlyPackageProvider(user)); final annualPackage = ref.watch(annualPackageProvider(user)); - final monthlyPremiumPackage = - ref.watch(monthlyPremiumPackageProvider(user)); + final monthlyPremiumPackage = ref.watch(monthlyPremiumPackageProvider(user)); final isLoading = useState(false); @@ -89,8 +88,7 @@ class PremiumIntroductionSheetBody extends HookConsumerWidget { fit: BoxFit.cover, ), ), - padding: - const EdgeInsets.only(left: 40, right: 40, bottom: 40), + padding: const EdgeInsets.only(left: 40, right: 40, bottom: 40), width: MediaQuery.of(context).size.width, ), SingleChildScrollView( @@ -109,8 +107,7 @@ class PremiumIntroductionSheetBody extends HookConsumerWidget { if (monthlyPremiumPackage != null) PremiumIntroductionDiscountRow( monthlyPremiumPackage: monthlyPremiumPackage, - discountEntitlementDeadlineDate: - user.discountEntitlementDeadlineDate, + discountEntitlementDeadlineDate: user.discountEntitlementDeadlineDate, ), const SizedBox(height: 12), PurchaseButtons( @@ -122,8 +119,7 @@ class PremiumIntroductionSheetBody extends HookConsumerWidget { ], const SizedBox(height: 24), const Padding( - padding: - EdgeInsets.symmetric(horizontal: 40, vertical: 8), + padding: EdgeInsets.symmetric(horizontal: 40, vertical: 8), child: Align( alignment: Alignment.centerLeft, child: PremiumIntroductionFeatures(), @@ -133,8 +129,7 @@ class PremiumIntroductionSheetBody extends HookConsumerWidget { alignment: Alignment.center, child: AlertButton( onPressed: () async { - analytics.logEvent( - name: "pressed_premium_functions_on_sheet2"); + analytics.logEvent(name: "pressed_premium_functions_on_sheet2"); await launchUrl(Uri.parse(preimumLink)); }, text: "プレミアム機能の詳細を見る", diff --git a/lib/features/premium_introduction/ab_test/c/premium_introduction_sheet.dart b/lib/features/premium_introduction/ab_test/c/premium_introduction_sheet.dart index b6c5620137..ec77a47b8f 100644 --- a/lib/features/premium_introduction/ab_test/c/premium_introduction_sheet.dart +++ b/lib/features/premium_introduction/ab_test/c/premium_introduction_sheet.dart @@ -64,8 +64,7 @@ class PremiumIntroductionSheetBody extends HookConsumerWidget { final offeringType = ref.watch(currentOfferingTypeProvider(user)); final monthlyPackage = ref.watch(monthlyPackageProvider(user)); final annualPackage = ref.watch(annualPackageProvider(user)); - final monthlyPremiumPackage = - ref.watch(monthlyPremiumPackageProvider(user)); + final monthlyPremiumPackage = ref.watch(monthlyPremiumPackageProvider(user)); final isLoading = useState(false); @@ -97,8 +96,7 @@ class PremiumIntroductionSheetBody extends HookConsumerWidget { if (monthlyPremiumPackage != null) PremiumIntroductionDiscountRow( monthlyPremiumPackage: monthlyPremiumPackage, - discountEntitlementDeadlineDate: - user.discountEntitlementDeadlineDate, + discountEntitlementDeadlineDate: user.discountEntitlementDeadlineDate, ), const SizedBox(height: 12), PurchaseButtons( @@ -120,8 +118,7 @@ class PremiumIntroductionSheetBody extends HookConsumerWidget { alignment: Alignment.center, child: AlertButton( onPressed: () async { - analytics.logEvent( - name: "pressed_premium_functions_on_sheet2"); + analytics.logEvent(name: "pressed_premium_functions_on_sheet2"); await launchUrl(Uri.parse(preimumLink)); }, text: "プレミアム機能の詳細を見る", diff --git a/lib/features/premium_introduction/components/annual_purchase_button.dart b/lib/features/premium_introduction/components/annual_purchase_button.dart index 9d38ae283d..c968accebc 100644 --- a/lib/features/premium_introduction/components/annual_purchase_button.dart +++ b/lib/features/premium_introduction/components/annual_purchase_button.dart @@ -21,9 +21,7 @@ class AnnualPurchaseButton extends StatelessWidget { Widget build(BuildContext context) { final monthlyPrice = annualPackage.storeProduct.price / 12; Locale locale = Localizations.localeOf(context); - final monthlyPriceString = - NumberFormat.simpleCurrency(locale: locale.toString(), decimalDigits: 0) - .format(monthlyPrice); + final monthlyPriceString = NumberFormat.simpleCurrency(locale: locale.toString(), decimalDigits: 0).format(monthlyPrice); return GestureDetector( onTap: () { diff --git a/lib/features/premium_introduction/components/premium_introduction_discount.dart b/lib/features/premium_introduction/components/premium_introduction_discount.dart index 134a2f4170..488113a7f6 100644 --- a/lib/features/premium_introduction/components/premium_introduction_discount.dart +++ b/lib/features/premium_introduction/components/premium_introduction_discount.dart @@ -23,13 +23,11 @@ class PremiumIntroductionDiscountRow extends HookConsumerWidget { // TODO: Androidで審査落とされたので一時的にifを入れる。2023-10に外す。フォントサイズを調整するかも if (Platform.isAndroid) return Container(); - final discountEntitlementDeadlineDate = - this.discountEntitlementDeadlineDate; + final discountEntitlementDeadlineDate = this.discountEntitlementDeadlineDate; final Duration? diff; final String? countdown; if (discountEntitlementDeadlineDate != null) { - final tmpDiff = ref.watch(durationToDiscountPriceDeadlineProvider( - discountEntitlementDeadlineDate: discountEntitlementDeadlineDate)); + final tmpDiff = ref.watch(durationToDiscountPriceDeadlineProvider(discountEntitlementDeadlineDate: discountEntitlementDeadlineDate)); countdown = discountPriceDeadlineCountdownString(tmpDiff); diff = tmpDiff; } else { diff --git a/lib/features/premium_introduction/components/premium_introduction_footer.dart b/lib/features/premium_introduction/components/premium_introduction_footer.dart index e783f8da28..aa571a3a90 100644 --- a/lib/features/premium_introduction/components/premium_introduction_footer.dart +++ b/lib/features/premium_introduction/components/premium_introduction_footer.dart @@ -31,25 +31,16 @@ class PremiumIntroductionFotter extends StatelessWidget { child: RichText( textAlign: TextAlign.start, text: TextSpan( - style: const TextStyle( - fontWeight: FontWeight.w400, - fontSize: 10, - fontFamily: FontFamily.japanese, - color: TextColor.gray), + style: const TextStyle(fontWeight: FontWeight.w400, fontSize: 10, fontFamily: FontFamily.japanese, color: TextColor.gray), children: [ - const TextSpan( - text: "・プレミアム契約期間は開始日から起算して1ヶ月または1年ごとの自動更新となります\n"), + const TextSpan(text: "・プレミアム契約期間は開始日から起算して1ヶ月または1年ごとの自動更新となります\n"), const TextSpan(text: "・"), TextSpan( text: "プライバシーポリシー", - style: - const TextStyle(decoration: TextDecoration.underline), + style: const TextStyle(decoration: TextDecoration.underline), recognizer: TapGestureRecognizer() ..onTap = () { - launchUrl( - Uri.parse( - "https://bannzai.github.io/Pilll/PrivacyPolicy"), - mode: LaunchMode.inAppWebView); + launchUrl(Uri.parse("https://bannzai.github.io/Pilll/PrivacyPolicy"), mode: LaunchMode.inAppWebView); }, ), const TextSpan( @@ -57,13 +48,10 @@ class PremiumIntroductionFotter extends StatelessWidget { ), TextSpan( text: "利用規約", - style: - const TextStyle(decoration: TextDecoration.underline), + style: const TextStyle(decoration: TextDecoration.underline), recognizer: TapGestureRecognizer() ..onTap = () { - launchUrl( - Uri.parse("https://bannzai.github.io/Pilll/Terms"), - mode: LaunchMode.inAppWebView); + launchUrl(Uri.parse("https://bannzai.github.io/Pilll/Terms"), mode: LaunchMode.inAppWebView); }, ), const TextSpan( @@ -71,14 +59,10 @@ class PremiumIntroductionFotter extends StatelessWidget { ), TextSpan( text: "特定商取引法に基づく表示", - style: - const TextStyle(decoration: TextDecoration.underline), + style: const TextStyle(decoration: TextDecoration.underline), recognizer: TapGestureRecognizer() ..onTap = () { - launchUrl( - Uri.parse( - "https://bannzai.github.io/Pilll/SpecifiedCommercialTransactionAct"), - mode: LaunchMode.inAppWebView); + launchUrl(Uri.parse("https://bannzai.github.io/Pilll/SpecifiedCommercialTransactionAct"), mode: LaunchMode.inAppWebView); }, ), const TextSpan( @@ -88,19 +72,14 @@ class PremiumIntroductionFotter extends StatelessWidget { text: "・プレミアム契約期間の終了日の24時間以上前に解約しない限り契約期間が自動更新されます\n", ), TextSpan( - text: - "・購入後、自動更新の解約は$storeNameアプリのアカウント設定で行えます。(アプリ内から自動更新の解約は行なえません)。", + text: "・購入後、自動更新の解約は$storeNameアプリのアカウント設定で行えます。(アプリ内から自動更新の解約は行なえません)。", ), TextSpan( text: "詳細はこちら", - style: - const TextStyle(decoration: TextDecoration.underline), + style: const TextStyle(decoration: TextDecoration.underline), recognizer: TapGestureRecognizer() ..onTap = () { - launchUrl( - Uri.parse( - "https://pilll.wraptas.site/b10fd76f1d2246d286ad5cff03f22940"), - mode: LaunchMode.inAppWebView); + launchUrl(Uri.parse("https://pilll.wraptas.site/b10fd76f1d2246d286ad5cff03f22940"), mode: LaunchMode.inAppWebView); }, ), ], @@ -170,11 +149,7 @@ class PremiumIntroductionFotter extends StatelessWidget { }); throw AlertError("以前の購入情報が見つかりません。アカウントをお確かめの上再度お試しください"); } on PlatformException catch (exception, stack) { - analytics.logEvent(name: "catched_restore_exception", parameters: { - "code": exception.code, - "details": exception.details.toString(), - "message": exception.message - }); + analytics.logEvent(name: "catched_restore_exception", parameters: {"code": exception.code, "details": exception.details.toString(), "message": exception.message}); final newException = mapToDisplayedException(exception); if (newException == null) { return Future.value(false); @@ -182,8 +157,7 @@ class PremiumIntroductionFotter extends StatelessWidget { errorLogger.recordError(exception, stack); throw newException; } catch (exception, stack) { - analytics - .logEvent(name: "catched_restore_anonymous_exception", parameters: { + analytics.logEvent(name: "catched_restore_anonymous_exception", parameters: { "exception_type": exception.runtimeType.toString(), }); errorLogger.recordError(exception, stack); diff --git a/lib/features/premium_introduction/components/purchase_buttons.dart b/lib/features/premium_introduction/components/purchase_buttons.dart index 0622f90923..d54e9b0f65 100644 --- a/lib/features/premium_introduction/components/purchase_buttons.dart +++ b/lib/features/premium_introduction/components/purchase_buttons.dart @@ -49,8 +49,7 @@ class PurchaseButtons extends HookConsumerWidget { ); } - Future _purchase( - BuildContext context, Package package, Purchase purchase) async { + Future _purchase(BuildContext context, Package package, Purchase purchase) async { if (isLoading.value) { return; } diff --git a/lib/features/premium_introduction/premium_introduction_sheet.dart b/lib/features/premium_introduction/premium_introduction_sheet.dart index c5264bee1a..ab3681b707 100644 --- a/lib/features/premium_introduction/premium_introduction_sheet.dart +++ b/lib/features/premium_introduction/premium_introduction_sheet.dart @@ -67,8 +67,7 @@ class PremiumIntroductionSheetBody extends HookConsumerWidget { final offeringType = ref.watch(currentOfferingTypeProvider(user)); final monthlyPackage = ref.watch(monthlyPackageProvider(user)); final annualPackage = ref.watch(annualPackageProvider(user)); - final monthlyPremiumPackage = - ref.watch(monthlyPremiumPackageProvider(user)); + final monthlyPremiumPackage = ref.watch(monthlyPremiumPackageProvider(user)); final isLoading = useState(false); @@ -92,8 +91,7 @@ class PremiumIntroductionSheetBody extends HookConsumerWidget { fit: BoxFit.cover, ), ), - padding: - const EdgeInsets.only(left: 40, right: 40, bottom: 40), + padding: const EdgeInsets.only(left: 40, right: 40, bottom: 40), width: MediaQuery.of(context).size.width, ), SingleChildScrollView( @@ -112,8 +110,7 @@ class PremiumIntroductionSheetBody extends HookConsumerWidget { if (monthlyPremiumPackage != null) PremiumIntroductionDiscountRow( monthlyPremiumPackage: monthlyPremiumPackage, - discountEntitlementDeadlineDate: - user.discountEntitlementDeadlineDate, + discountEntitlementDeadlineDate: user.discountEntitlementDeadlineDate, ), const SizedBox(height: 12), PurchaseButtons( @@ -126,8 +123,7 @@ class PremiumIntroductionSheetBody extends HookConsumerWidget { const SizedBox(height: 24), AlertButton( onPressed: () async { - analytics.logEvent( - name: "pressed_premium_functions_on_sheet"); + analytics.logEvent(name: "pressed_premium_functions_on_sheet"); await launchUrl(Uri.parse(preimumLink)); }, text: "プレミアム機能を見る"), @@ -157,8 +153,7 @@ class PremiumIntroductionSheetBody extends HookConsumerWidget { } Future showPremiumIntroductionSheet(BuildContext context) async { - final premiumIntroductionPattern = - remoteConfig.getString(RemoteConfigKeys.premiumIntroductionPattern); + final premiumIntroductionPattern = remoteConfig.getString(RemoteConfigKeys.premiumIntroductionPattern); switch (premiumIntroductionPattern) { case "B": await _showPremiumIntroductionSheetB(context); diff --git a/lib/features/premium_introduction/util/discount_deadline.dart b/lib/features/premium_introduction/util/discount_deadline.dart index 0027521eee..215f481249 100644 --- a/lib/features/premium_introduction/util/discount_deadline.dart +++ b/lib/features/premium_introduction/util/discount_deadline.dart @@ -6,8 +6,7 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'discount_deadline.g.dart'; @Riverpod() -bool isOverDiscountDeadline(IsOverDiscountDeadlineRef ref, - {required DateTime? discountEntitlementDeadlineDate}) { +bool isOverDiscountDeadline(IsOverDiscountDeadlineRef ref, {required DateTime? discountEntitlementDeadlineDate}) { if (discountEntitlementDeadlineDate == null) { // NOTE: discountEntitlementDeadlineDate が存在しない時はbackendの方でまだ期限を決めていないのでfalse状態で扱う return false; @@ -17,22 +16,18 @@ bool isOverDiscountDeadline(IsOverDiscountDeadlineRef ref, } @Riverpod(dependencies: [remoteConfigParameter]) -bool hiddenCountdownDiscountDeadline(HiddenCountdownDiscountDeadlineRef ref, - {required DateTime? discountEntitlementDeadlineDate}) { +bool hiddenCountdownDiscountDeadline(HiddenCountdownDiscountDeadlineRef ref, {required DateTime? discountEntitlementDeadlineDate}) { if (discountEntitlementDeadlineDate == null) { // NOTE: discountEntitlementDeadlineDate が存在しない時はbackendの方でまだ期限を決めていないのでfalse状態で扱う return false; } final remoteConfigParameter = ref.watch(remoteConfigParameterProvider); final timer = ref.watch(tickProvider); - return !(timer.isBefore(discountEntitlementDeadlineDate) && - discountEntitlementDeadlineDate.difference(timer).inMinutes <= - remoteConfigParameter.discountCountdownBoundaryHour * 60); + return !(timer.isBefore(discountEntitlementDeadlineDate) && discountEntitlementDeadlineDate.difference(timer).inMinutes <= remoteConfigParameter.discountCountdownBoundaryHour * 60); } @Riverpod() -Duration durationToDiscountPriceDeadline(DurationToDiscountPriceDeadlineRef ref, - {required DateTime discountEntitlementDeadlineDate}) { +Duration durationToDiscountPriceDeadline(DurationToDiscountPriceDeadlineRef ref, {required DateTime discountEntitlementDeadlineDate}) { final timerDate = ref.watch(tickProvider); return discountEntitlementDeadlineDate.difference(timerDate); } diff --git a/lib/features/premium_introduction/util/discount_deadline.g.dart b/lib/features/premium_introduction/util/discount_deadline.g.dart index 433cc5188c..ccba3ab34e 100644 --- a/lib/features/premium_introduction/util/discount_deadline.g.dart +++ b/lib/features/premium_introduction/util/discount_deadline.g.dart @@ -6,8 +6,7 @@ part of 'discount_deadline.dart'; // RiverpodGenerator // ************************************************************************** -String _$isOverDiscountDeadlineHash() => - r'4336d52719c10c6d3e9acc171f33f9ebc744976b'; +String _$isOverDiscountDeadlineHash() => r'4336d52719c10c6d3e9acc171f33f9ebc744976b'; /// Copied from Dart SDK class _SystemHash { @@ -65,8 +64,7 @@ class IsOverDiscountDeadlineFamily extends Family { static const Iterable? _allTransitiveDependencies = null; @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; + Iterable? get allTransitiveDependencies => _allTransitiveDependencies; @override String? get name => r'isOverDiscountDeadlineProvider'; @@ -84,13 +82,9 @@ class IsOverDiscountDeadlineProvider extends AutoDisposeProvider { ), from: isOverDiscountDeadlineProvider, name: r'isOverDiscountDeadlineProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$isOverDiscountDeadlineHash, + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') ? null : _$isOverDiscountDeadlineHash, dependencies: IsOverDiscountDeadlineFamily._dependencies, - allTransitiveDependencies: - IsOverDiscountDeadlineFamily._allTransitiveDependencies, + allTransitiveDependencies: IsOverDiscountDeadlineFamily._allTransitiveDependencies, discountEntitlementDeadlineDate: discountEntitlementDeadlineDate, ); @@ -131,9 +125,7 @@ class IsOverDiscountDeadlineProvider extends AutoDisposeProvider { @override bool operator ==(Object other) { - return other is IsOverDiscountDeadlineProvider && - other.discountEntitlementDeadlineDate == - discountEntitlementDeadlineDate; + return other is IsOverDiscountDeadlineProvider && other.discountEntitlementDeadlineDate == discountEntitlementDeadlineDate; } @override @@ -150,23 +142,18 @@ mixin IsOverDiscountDeadlineRef on AutoDisposeProviderRef { DateTime? get discountEntitlementDeadlineDate; } -class _IsOverDiscountDeadlineProviderElement - extends AutoDisposeProviderElement with IsOverDiscountDeadlineRef { +class _IsOverDiscountDeadlineProviderElement extends AutoDisposeProviderElement with IsOverDiscountDeadlineRef { _IsOverDiscountDeadlineProviderElement(super.provider); @override - DateTime? get discountEntitlementDeadlineDate => - (origin as IsOverDiscountDeadlineProvider) - .discountEntitlementDeadlineDate; + DateTime? get discountEntitlementDeadlineDate => (origin as IsOverDiscountDeadlineProvider).discountEntitlementDeadlineDate; } -String _$hiddenCountdownDiscountDeadlineHash() => - r'b60536a8c5f8ee430f25d88781c84c3b4c381b21'; +String _$hiddenCountdownDiscountDeadlineHash() => r'b60536a8c5f8ee430f25d88781c84c3b4c381b21'; /// See also [hiddenCountdownDiscountDeadline]. @ProviderFor(hiddenCountdownDiscountDeadline) -const hiddenCountdownDiscountDeadlineProvider = - HiddenCountdownDiscountDeadlineFamily(); +const hiddenCountdownDiscountDeadlineProvider = HiddenCountdownDiscountDeadlineFamily(); /// See also [hiddenCountdownDiscountDeadline]. class HiddenCountdownDiscountDeadlineFamily extends Family { @@ -191,30 +178,22 @@ class HiddenCountdownDiscountDeadlineFamily extends Family { ); } - static final Iterable _dependencies = [ - remoteConfigParameterProvider - ]; + static final Iterable _dependencies = [remoteConfigParameterProvider]; @override Iterable? get dependencies => _dependencies; - static final Iterable _allTransitiveDependencies = - { - remoteConfigParameterProvider, - ...?remoteConfigParameterProvider.allTransitiveDependencies - }; + static final Iterable _allTransitiveDependencies = {remoteConfigParameterProvider, ...?remoteConfigParameterProvider.allTransitiveDependencies}; @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; + Iterable? get allTransitiveDependencies => _allTransitiveDependencies; @override String? get name => r'hiddenCountdownDiscountDeadlineProvider'; } /// See also [hiddenCountdownDiscountDeadline]. -class HiddenCountdownDiscountDeadlineProvider - extends AutoDisposeProvider { +class HiddenCountdownDiscountDeadlineProvider extends AutoDisposeProvider { /// See also [hiddenCountdownDiscountDeadline]. HiddenCountdownDiscountDeadlineProvider({ required DateTime? discountEntitlementDeadlineDate, @@ -225,13 +204,9 @@ class HiddenCountdownDiscountDeadlineProvider ), from: hiddenCountdownDiscountDeadlineProvider, name: r'hiddenCountdownDiscountDeadlineProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$hiddenCountdownDiscountDeadlineHash, + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') ? null : _$hiddenCountdownDiscountDeadlineHash, dependencies: HiddenCountdownDiscountDeadlineFamily._dependencies, - allTransitiveDependencies: - HiddenCountdownDiscountDeadlineFamily._allTransitiveDependencies, + allTransitiveDependencies: HiddenCountdownDiscountDeadlineFamily._allTransitiveDependencies, discountEntitlementDeadlineDate: discountEntitlementDeadlineDate, ); @@ -272,9 +247,7 @@ class HiddenCountdownDiscountDeadlineProvider @override bool operator ==(Object other) { - return other is HiddenCountdownDiscountDeadlineProvider && - other.discountEntitlementDeadlineDate == - discountEntitlementDeadlineDate; + return other is HiddenCountdownDiscountDeadlineProvider && other.discountEntitlementDeadlineDate == discountEntitlementDeadlineDate; } @override @@ -291,24 +264,18 @@ mixin HiddenCountdownDiscountDeadlineRef on AutoDisposeProviderRef { DateTime? get discountEntitlementDeadlineDate; } -class _HiddenCountdownDiscountDeadlineProviderElement - extends AutoDisposeProviderElement - with HiddenCountdownDiscountDeadlineRef { +class _HiddenCountdownDiscountDeadlineProviderElement extends AutoDisposeProviderElement with HiddenCountdownDiscountDeadlineRef { _HiddenCountdownDiscountDeadlineProviderElement(super.provider); @override - DateTime? get discountEntitlementDeadlineDate => - (origin as HiddenCountdownDiscountDeadlineProvider) - .discountEntitlementDeadlineDate; + DateTime? get discountEntitlementDeadlineDate => (origin as HiddenCountdownDiscountDeadlineProvider).discountEntitlementDeadlineDate; } -String _$durationToDiscountPriceDeadlineHash() => - r'cf08e12e1dea3d5475632bc452d12a78aec274b7'; +String _$durationToDiscountPriceDeadlineHash() => r'cf08e12e1dea3d5475632bc452d12a78aec274b7'; /// See also [durationToDiscountPriceDeadline]. @ProviderFor(durationToDiscountPriceDeadline) -const durationToDiscountPriceDeadlineProvider = - DurationToDiscountPriceDeadlineFamily(); +const durationToDiscountPriceDeadlineProvider = DurationToDiscountPriceDeadlineFamily(); /// See also [durationToDiscountPriceDeadline]. class DurationToDiscountPriceDeadlineFamily extends Family { @@ -341,16 +308,14 @@ class DurationToDiscountPriceDeadlineFamily extends Family { static const Iterable? _allTransitiveDependencies = null; @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; + Iterable? get allTransitiveDependencies => _allTransitiveDependencies; @override String? get name => r'durationToDiscountPriceDeadlineProvider'; } /// See also [durationToDiscountPriceDeadline]. -class DurationToDiscountPriceDeadlineProvider - extends AutoDisposeProvider { +class DurationToDiscountPriceDeadlineProvider extends AutoDisposeProvider { /// See also [durationToDiscountPriceDeadline]. DurationToDiscountPriceDeadlineProvider({ required DateTime discountEntitlementDeadlineDate, @@ -361,13 +326,9 @@ class DurationToDiscountPriceDeadlineProvider ), from: durationToDiscountPriceDeadlineProvider, name: r'durationToDiscountPriceDeadlineProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$durationToDiscountPriceDeadlineHash, + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') ? null : _$durationToDiscountPriceDeadlineHash, dependencies: DurationToDiscountPriceDeadlineFamily._dependencies, - allTransitiveDependencies: - DurationToDiscountPriceDeadlineFamily._allTransitiveDependencies, + allTransitiveDependencies: DurationToDiscountPriceDeadlineFamily._allTransitiveDependencies, discountEntitlementDeadlineDate: discountEntitlementDeadlineDate, ); @@ -408,9 +369,7 @@ class DurationToDiscountPriceDeadlineProvider @override bool operator ==(Object other) { - return other is DurationToDiscountPriceDeadlineProvider && - other.discountEntitlementDeadlineDate == - discountEntitlementDeadlineDate; + return other is DurationToDiscountPriceDeadlineProvider && other.discountEntitlementDeadlineDate == discountEntitlementDeadlineDate; } @override @@ -427,15 +386,11 @@ mixin DurationToDiscountPriceDeadlineRef on AutoDisposeProviderRef { DateTime get discountEntitlementDeadlineDate; } -class _DurationToDiscountPriceDeadlineProviderElement - extends AutoDisposeProviderElement - with DurationToDiscountPriceDeadlineRef { +class _DurationToDiscountPriceDeadlineProviderElement extends AutoDisposeProviderElement with DurationToDiscountPriceDeadlineRef { _DurationToDiscountPriceDeadlineProviderElement(super.provider); @override - DateTime get discountEntitlementDeadlineDate => - (origin as DurationToDiscountPriceDeadlineProvider) - .discountEntitlementDeadlineDate; + DateTime get discountEntitlementDeadlineDate => (origin as DurationToDiscountPriceDeadlineProvider).discountEntitlementDeadlineDate; } // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member diff --git a/lib/features/premium_introduction/util/map_to_error.dart b/lib/features/premium_introduction/util/map_to_error.dart index 15608ae5ae..f681c04440 100644 --- a/lib/features/premium_introduction/util/map_to_error.dart +++ b/lib/features/premium_introduction/util/map_to_error.dart @@ -8,8 +8,7 @@ Exception? mapToDisplayedException(PlatformException exception) { final errorCode = PurchasesErrorHelper.getErrorCode(exception); switch (errorCode) { case PurchasesErrorCode.unknownError: - return FormatException( - "原因不明のエラーが発生しました。時間をおいて再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); + return FormatException("原因不明のエラーが発生しました。時間をおいて再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); case PurchasesErrorCode.purchaseCancelledError: // NOTE: This exception indicates that the User has canceled. // See more details: https://docs.revenuecat.com/docs/errors#--purchase_cancelled @@ -37,8 +36,7 @@ Exception? mapToDisplayedException(PlatformException exception) { // User already has same product. Announcement to restore // See more details: https://docs.revenuecat.com/docs/errors#-product_already_purchased // > If this occurs in production, make sure the user restores purchases to re-sync any transactions with their current App User Id. - return AlertError( - "すでにプランを購入済みです。この端末で購入情報を復元する場合は「以前購入した方はこちら」から購入情報を復元してくさい"); + return AlertError("すでにプランを購入済みです。この端末で購入情報を復元する場合は「以前購入した方はこちら」から購入情報を復元してくさい"); case PurchasesErrorCode.receiptAlreadyInUseError: return AlertError('既に購入済み。もくは購入情報は別のユーザーで使用されています。$accountNameを確認してください'); case PurchasesErrorCode.invalidReceiptError: @@ -50,89 +48,64 @@ Exception? mapToDisplayedException(PlatformException exception) { case PurchasesErrorCode.invalidCredentialsError: // Maybe developer or store settings error // See more details: https://docs.revenuecat.com/docs/errors#---invalid_credentials - return FormatException( - "購入に失敗しました。時間をおいて再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); + return FormatException("購入に失敗しました。時間をおいて再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); case PurchasesErrorCode.unexpectedBackendResponseError: // Maybe RevenueCat incident // See more details: https://docs.revenuecat.com/docs/errors#-unexpected_backend_response_error - return FormatException( - "現在購入ができません。時間をおいて再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); + return FormatException("現在購入ができません。時間をおいて再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); case PurchasesErrorCode.receiptInUseByOtherSubscriberError: - return AlertError( - '購入情報は別のユーザーで使用されています。端末にログインしている$accountNameを確認してください'); + return AlertError('購入情報は別のユーザーで使用されています。端末にログインしている$accountNameを確認してください'); case PurchasesErrorCode.invalidAppUserIdError: - return FormatException( - "ユーザーが確認できませんでした。アプリを再起動の上再度お試しください。詳細: ${exception.message}:${exception.details}"); + return FormatException("ユーザーが確認できませんでした。アプリを再起動の上再度お試しください。詳細: ${exception.message}:${exception.details}"); case PurchasesErrorCode.operationAlreadyInProgressError: return AlertError('購入処理が別途進んでおります。お時間をおいて再度ご確認ください'); case PurchasesErrorCode.unknownBackendError: // Maybe RevenueCat incident // See more details: https://docs.revenuecat.com/docs/errors#-unknown_backend_error - return FormatException( - "現在購入ができません。時間をおいて再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); + return FormatException("現在購入ができません。時間をおいて再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); case PurchasesErrorCode.invalidAppleSubscriptionKeyError: // Maybe developer setting error on AppStore // See more details: https://docs.revenuecat.com/docs/errors#-invalid_apple_subscription_key // > In order to provide Subscription Offers you must first generate a subscription key. - return FormatException( - "購入に失敗しました。時間をおいて再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); + return FormatException("購入に失敗しました。時間をおいて再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); case PurchasesErrorCode.ineligibleError: // Invalidate user // See more details: https://docs.revenuecat.com/docs/errors#-ineligible_error - return FormatException( - "お使いのユーザーでの購入に失敗しました。時間をおいて再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); + return FormatException("お使いのユーザーでの購入に失敗しました。時間をおいて再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); case PurchasesErrorCode.insufficientPermissionsError: - return AlertError( - 'お使いの $accountName ではプランへの加入ができません。お支払い情報をご確認の上再度お試しください'); + return AlertError('お使いの $accountName ではプランへの加入ができません。お支払い情報をご確認の上再度お試しください'); case PurchasesErrorCode.paymentPendingError: - return AlertError( - '支払いが途中で止まっております。ログイン中の$accountNameで$storeNameをお確かめくだい'); + return AlertError('支払いが途中で止まっております。ログイン中の$accountNameで$storeNameをお確かめくだい'); case PurchasesErrorCode.invalidSubscriberAttributesError: // See more details: https://docs.revenuecat.com/docs/errors#-invalid_subscriber_attributes - return FormatException( - "購入に失敗しました。時間をおいて再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); + return FormatException("購入に失敗しました。時間をおいて再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); case PurchasesErrorCode.logOutWithAnonymousUserError: - return FormatException( - "ユーザー情報を取得失敗しました。時間をおいて再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); + return FormatException("ユーザー情報を取得失敗しました。時間をおいて再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); case PurchasesErrorCode.configurationError: - return FormatException( - "購入情報取得に失敗しました。時間をおいて再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); + return FormatException("購入情報取得に失敗しました。時間をおいて再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); case PurchasesErrorCode.unsupportedError: - return FormatException( - "原因不明のエラーです。最新版にアップデートして再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。コード: $errorCode 詳細: ${exception.message}:${exception.details}"); + return FormatException("原因不明のエラーです。最新版にアップデートして再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。コード: $errorCode 詳細: ${exception.message}:${exception.details}"); case PurchasesErrorCode.emptySubscriberAttributesError: - return AlertError( - "原因不明のエラーです。購入情報を事前に取得できませんでした。詳細: ${exception.message}:${exception.details}"); + return AlertError("原因不明のエラーです。購入情報を事前に取得できませんでした。詳細: ${exception.message}:${exception.details}"); case PurchasesErrorCode.productDiscountMissingIdentifierError: - return FormatException( - "原因不明のエラーです。最新版にアップデートして再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。コード: $errorCode 詳細: ${exception.message}:${exception.details}"); + return FormatException("原因不明のエラーです。最新版にアップデートして再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。コード: $errorCode 詳細: ${exception.message}:${exception.details}"); case PurchasesErrorCode.unknownNonNativeError: - return FormatException( - "原因不明のエラーです。最新版にアップデートして再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。コード: $errorCode 詳細: ${exception.message}:${exception.details}"); - case PurchasesErrorCode - .productDiscountMissingSubscriptionGroupIdentifierError: - return FormatException( - "原因不明のエラーです。最新版にアップデートして再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。コード: $errorCode 詳細: ${exception.message}:${exception.details}"); + return FormatException("原因不明のエラーです。最新版にアップデートして再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。コード: $errorCode 詳細: ${exception.message}:${exception.details}"); + case PurchasesErrorCode.productDiscountMissingSubscriptionGroupIdentifierError: + return FormatException("原因不明のエラーです。最新版にアップデートして再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。コード: $errorCode 詳細: ${exception.message}:${exception.details}"); case PurchasesErrorCode.customerInfoError: - return FormatException( - "顧客情報の取得に失敗しました。時間をおいて再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: コード: $errorCode ${exception.message}:${exception.details}"); + return FormatException("顧客情報の取得に失敗しました。時間をおいて再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: コード: $errorCode ${exception.message}:${exception.details}"); case PurchasesErrorCode.systemInfoError: - return FormatException( - "端末の設定に問題があります。確認して再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。コード: $errorCode 詳細: ${exception.message}:${exception.details}"); + return FormatException("端末の設定に問題があります。確認して再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。コード: $errorCode 詳細: ${exception.message}:${exception.details}"); case PurchasesErrorCode.beginRefundRequestError: - return FormatException( - "返金処理が開始されています。確認して再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。コード: $errorCode 詳細: ${exception.message}:${exception.details}"); + return FormatException("返金処理が開始されています。確認して再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。コード: $errorCode 詳細: ${exception.message}:${exception.details}"); case PurchasesErrorCode.productRequestTimeout: - return FormatException( - "タイムアウトしました。通信環境をお確かめの上再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); + return FormatException("タイムアウトしました。通信環境をお確かめの上再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); case PurchasesErrorCode.apiEndpointBlocked: - return FormatException( - "原因不明のエラーです。最新版にアップデートして再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。コード: $errorCode 詳細: ${exception.message}:${exception.details}"); + return FormatException("原因不明のエラーです。最新版にアップデートして再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。コード: $errorCode 詳細: ${exception.message}:${exception.details}"); case PurchasesErrorCode.invalidPromotionalOfferError: - return FormatException( - "原因不明のエラーです。最新版にアップデートして再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。コード: $errorCode 詳細: ${exception.message}:${exception.details}"); + return FormatException("原因不明のエラーです。最新版にアップデートして再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。コード: $errorCode 詳細: ${exception.message}:${exception.details}"); case PurchasesErrorCode.offlineConnectionError: - return FormatException( - "通信不良です。通信環境をお確かめの上再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); + return FormatException("通信不良です。通信環境をお確かめの上再度お試しください。解決しない場合は 設定 > 問い合わせ よりお問い合わせください。詳細: ${exception.message}:${exception.details}"); } } diff --git a/lib/features/record/components/add_pill_sheet_group/add_pill_sheet_group_page.dart b/lib/features/record/components/add_pill_sheet_group/add_pill_sheet_group_page.dart index ef83b2a99f..bda8a59555 100644 --- a/lib/features/record/components/add_pill_sheet_group/add_pill_sheet_group_page.dart +++ b/lib/features/record/components/add_pill_sheet_group/add_pill_sheet_group_page.dart @@ -18,18 +18,15 @@ import 'package:pilll/utils/local_notification.dart'; class AddPillSheetGroupPage extends HookConsumerWidget { final PillSheetGroup? pillSheetGroup; final Setting setting; - const AddPillSheetGroupPage( - {super.key, required this.pillSheetGroup, required this.setting}); + const AddPillSheetGroupPage({super.key, required this.pillSheetGroup, required this.setting}); @override Widget build(BuildContext context, WidgetRef ref) { final pillSheetGroup = this.pillSheetGroup; final addPillSheetGroup = ref.watch(addPillSheetGroupProvider); - final registerReminderLocalNotification = - ref.watch(registerReminderLocalNotificationProvider); + final registerReminderLocalNotification = ref.watch(registerReminderLocalNotificationProvider); final pillSheetTypes = useState(setting.pillSheetEnumTypes); - final displayNumberSetting = - useState(null); + final displayNumberSetting = useState(null); return Scaffold( backgroundColor: PilllColors.background, @@ -52,10 +49,7 @@ class AddPillSheetGroupPage extends HookConsumerWidget { if (pillSheetTypes.value.isEmpty) ...[ const Spacer(), AddPillSheetTypeEmpty(onSelect: (pillSheetType) { - pillSheetTypes.value = [ - ...pillSheetTypes.value, - pillSheetType - ]; + pillSheetTypes.value = [...pillSheetTypes.value, pillSheetType]; }), const Spacer(flex: 3), ] else ...[ @@ -65,33 +59,18 @@ class AddPillSheetGroupPage extends HookConsumerWidget { SettingPillSheetGroup( pillSheetTypes: pillSheetTypes.value, onAdd: (pillSheetType) { - analytics.logEvent( - name: "setting_add_pill_sheet_group", - parameters: { - "pill_sheet_type": pillSheetType.fullName - }); - pillSheetTypes.value = [ - ...pillSheetTypes.value, - pillSheetType - ]; + analytics.logEvent(name: "setting_add_pill_sheet_group", parameters: {"pill_sheet_type": pillSheetType.fullName}); + pillSheetTypes.value = [...pillSheetTypes.value, pillSheetType]; }, onChange: (index, pillSheetType) { - analytics.logEvent( - name: "setting_change_pill_sheet_group", - parameters: { - "index": index, - "pill_sheet_type": pillSheetType.fullName - }); + analytics.logEvent(name: "setting_change_pill_sheet_group", parameters: {"index": index, "pill_sheet_type": pillSheetType.fullName}); final copied = [...pillSheetTypes.value]; copied[index] = pillSheetType; pillSheetTypes.value = copied; }, onDelete: (index) { - analytics.logEvent( - name: "setting_delete_pill_sheet_group", - parameters: {"index": index}); - pillSheetTypes.value = [...pillSheetTypes.value] - ..removeAt(index); + analytics.logEvent(name: "setting_delete_pill_sheet_group", parameters: {"index": index}); + pillSheetTypes.value = [...pillSheetTypes.value]..removeAt(index); }, ), ], @@ -118,15 +97,13 @@ class AddPillSheetGroupPage extends HookConsumerWidget { onPressed: pillSheetTypes.value.isEmpty ? null : () async { - analytics.logEvent( - name: "pressed_add_pill_sheet_group"); + analytics.logEvent(name: "pressed_add_pill_sheet_group"); final navigator = Navigator.of(context); await addPillSheetGroup.call( setting: setting, pillSheetGroup: pillSheetGroup, pillSheetTypes: pillSheetTypes.value, - displayNumberSetting: - displayNumberSetting.value, + displayNumberSetting: displayNumberSetting.value, ); await registerReminderLocalNotification(); navigator.pop(); @@ -147,13 +124,11 @@ class AddPillSheetGroupPage extends HookConsumerWidget { } extension AddPillSheetGroupPageRoute on AddPillSheetGroupPage { - static Route route( - {required PillSheetGroup? pillSheetGroup, required Setting setting}) { + static Route route({required PillSheetGroup? pillSheetGroup, required Setting setting}) { return MaterialPageRoute( fullscreenDialog: true, settings: const RouteSettings(name: "RecordPageAddingPillSheetGroupPage"), - builder: (_) => AddPillSheetGroupPage( - pillSheetGroup: pillSheetGroup, setting: setting), + builder: (_) => AddPillSheetGroupPage(pillSheetGroup: pillSheetGroup, setting: setting), ); } } diff --git a/lib/features/record/components/add_pill_sheet_group/display_number_setting.dart b/lib/features/record/components/add_pill_sheet_group/display_number_setting.dart index 30c24829c9..e50b668785 100644 --- a/lib/features/record/components/add_pill_sheet_group/display_number_setting.dart +++ b/lib/features/record/components/add_pill_sheet_group/display_number_setting.dart @@ -26,11 +26,9 @@ class DisplayNumberSetting extends HookConsumerWidget { return Container(); } - final estimatedEndPillNumber = - pillSheetGroup.sequentialEstimatedEndPillNumber; + final estimatedEndPillNumber = pillSheetGroup.sequentialEstimatedEndPillNumber; final beginDisplayPillNumber = useState(estimatedEndPillNumber + 1); - final textFieldController = - useTextEditingController(text: "${beginDisplayPillNumber.value}"); + final textFieldController = useTextEditingController(text: "${beginDisplayPillNumber.value}"); return Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -76,12 +74,9 @@ class DisplayNumberSetting extends HookConsumerWidget { ), onChanged: (text) { try { - analytics.logEvent( - name: "on_changed_display_number", - parameters: {"text": text}); + analytics.logEvent(name: "on_changed_display_number", parameters: {"text": text}); beginDisplayPillNumber.value = int.parse(text); - onChanged(PillSheetGroupDisplayNumberSetting( - beginPillNumber: beginDisplayPillNumber.value)); + onChanged(PillSheetGroupDisplayNumberSetting(beginPillNumber: beginDisplayPillNumber.value)); } catch (_) {} }, ), diff --git a/lib/features/record/components/add_pill_sheet_group/provider.dart b/lib/features/record/components/add_pill_sheet_group/provider.dart index eb4398358b..308ec13a6a 100644 --- a/lib/features/record/components/add_pill_sheet_group/provider.dart +++ b/lib/features/record/components/add_pill_sheet_group/provider.dart @@ -16,8 +16,7 @@ final addPillSheetGroupProvider = Provider.autoDispose( (ref) => AddPillSheetGroup( batchFactory: ref.watch(batchFactoryProvider), batchSetPillSheetGroup: ref.watch(batchSetPillSheetGroupProvider), - batchSetPillSheetModifiedHistory: - ref.watch(batchSetPillSheetModifiedHistoryProvider), + batchSetPillSheetModifiedHistory: ref.watch(batchSetPillSheetModifiedHistoryProvider), batchSetSetting: ref.watch(batchSetSettingProvider), ), ); @@ -54,8 +53,7 @@ class AddPillSheetGroup { updatedPillSheetGroup, ); - final history = PillSheetModifiedHistoryServiceActionFactory - .createCreatedPillSheetAction( + final history = PillSheetModifiedHistoryServiceActionFactory.createCreatedPillSheetAction( beforePillSheetGroup: pillSheetGroup, createdNewPillSheetGroup: createdPillSheetGroup, pillSheetIDs: updatedPillSheetGroup.pillSheetIDs, @@ -82,8 +80,7 @@ PillSheetGroup buildPillSheetGroup({ final n = now(); final createdPillSheets = pillSheetTypes.asMap().keys.map((pageIndex) { final pillSheetType = backportPillSheetTypes(pillSheetTypes)[pageIndex]; - final offset = summarizedPillCountWithPillSheetTypesToIndex( - pillSheetTypes: pillSheetTypes, toIndex: pageIndex); + final offset = summarizedPillCountWithPillSheetTypesToIndex(pillSheetTypes: pillSheetTypes, toIndex: pageIndex); return PillSheet( id: firestoreIDGenerator(), typeInfo: pillSheetType.typeInfo, @@ -100,8 +97,7 @@ PillSheetGroup buildPillSheetGroup({ final updatedPillSheetGroup = PillSheetGroup( pillSheetIDs: pillSheetIDs, pillSheets: createdPillSheets, - pillSheetAppearanceMode: pillSheetGroup?.pillSheetAppearanceMode ?? - PillSheetAppearanceMode.number, + pillSheetAppearanceMode: pillSheetGroup?.pillSheetAppearanceMode ?? PillSheetAppearanceMode.number, displayNumberSetting: () { if (pillSheetGroup?.pillSheetAppearanceMode.isSequential == true) { if (displayNumberSetting != null) { @@ -109,8 +105,7 @@ PillSheetGroup buildPillSheetGroup({ } if (pillSheetGroup != null) { return PillSheetGroupDisplayNumberSetting( - beginPillNumber: - pillSheetGroup.sequentialEstimatedEndPillNumber + 1, + beginPillNumber: pillSheetGroup.sequentialEstimatedEndPillNumber + 1, ); } } diff --git a/lib/features/record/components/announcement_bar/announcement_bar.dart b/lib/features/record/components/announcement_bar/announcement_bar.dart index af000a37b7..aa34149db1 100644 --- a/lib/features/record/components/announcement_bar/announcement_bar.dart +++ b/lib/features/record/components/announcement_bar/announcement_bar.dart @@ -36,19 +36,14 @@ class AnnouncementBar extends HookConsumerWidget { } Widget? _body(BuildContext context, WidgetRef ref) { - final latestPillSheetGroup = - ref.watch(latestPillSheetGroupProvider).valueOrNull; + final latestPillSheetGroup = ref.watch(latestPillSheetGroupProvider).valueOrNull; final user = ref.watch(userProvider).valueOrNull; final isLinkedLoginProvider = ref.watch(isLinkedProvider); - final discountEntitlementDeadlineDate = - user?.discountEntitlementDeadlineDate; - final hiddenCountdownDiscountDeadline = ref.watch( - hiddenCountdownDiscountDeadlineProvider( - discountEntitlementDeadlineDate: discountEntitlementDeadlineDate)); + final discountEntitlementDeadlineDate = user?.discountEntitlementDeadlineDate; + final hiddenCountdownDiscountDeadline = ref.watch(hiddenCountdownDiscountDeadlineProvider(discountEntitlementDeadlineDate: discountEntitlementDeadlineDate)); final isJaLocale = ref.watch(isJaLocaleProvider); final pilllAds = ref.watch(pilllAdsProvider).asData?.value; - final appIsReleased = - ref.watch(appIsReleasedProvider).asData?.value == true; + final appIsReleased = ref.watch(appIsReleasedProvider).asData?.value == true; final isAdsDisabled = () { if (!kDebugMode) { if (!isJaLocale) { @@ -58,8 +53,7 @@ class AnnouncementBar extends HookConsumerWidget { if (pilllAds == null) { return true; } - return now().isBefore(pilllAds.startDateTime) || - now().isAfter(pilllAds.endDateTime); + return now().isBefore(pilllAds.startDateTime) || now().isAfter(pilllAds.endDateTime); }(); if (user == null) { @@ -77,11 +71,9 @@ class AnnouncementBar extends HookConsumerWidget { if (discountEntitlementDeadlineDate != null) { if (!hiddenCountdownDiscountDeadline) { return DiscountPriceDeadline( - discountEntitlementDeadlineDate: - discountEntitlementDeadlineDate, + discountEntitlementDeadlineDate: discountEntitlementDeadlineDate, onTap: () { - analytics.logEvent( - name: "pressed_discount_announcement_bar"); + analytics.logEvent(name: "pressed_discount_announcement_bar"); showPremiumIntroductionSheet(context); }); } @@ -89,8 +81,7 @@ class AnnouncementBar extends HookConsumerWidget { } } - if (latestPillSheetGroup != null && - latestPillSheetGroup.activePillSheet == null) { + if (latestPillSheetGroup != null && latestPillSheetGroup.activePillSheet == null) { // ピルシートグループが存在していてactivedPillSheetが無い場合はピルシート終了が何かしらの理由がなくなったと見なし終了表示にする return EndedPillSheet( isPremium: user.isPremium, @@ -99,19 +90,15 @@ class AnnouncementBar extends HookConsumerWidget { } if (user.isTrial) { - final premiumTrialLimit = - PremiumTrialLimitAnnouncementBar.premiumTrialLimitMessage(user); + final premiumTrialLimit = PremiumTrialLimitAnnouncementBar.premiumTrialLimitMessage(user); if (premiumTrialLimit != null) { - return PremiumTrialLimitAnnouncementBar( - premiumTrialLimit: premiumTrialLimit); + return PremiumTrialLimitAnnouncementBar(premiumTrialLimit: premiumTrialLimit); } } else { // !isPremium && !isTrial if (!isAdsDisabled && pilllAds != null) { - return PilllAdsAnnouncementBar( - pilllAds: pilllAds, - onClose: () => showPremiumIntroductionSheet(context)); + return PilllAdsAnnouncementBar(pilllAds: pilllAds, onClose: () => showPremiumIntroductionSheet(context)); } if (defaultTargetPlatform == TargetPlatform.iOS) { @@ -122,8 +109,7 @@ class AnnouncementBar extends HookConsumerWidget { return ShareRewardPremiumTrialAnnoumcenetBar(user: user); } } else { - final range = DateRange( - trialDeadlineDate.addDays(90), trialDeadlineDate.addDays(93)); + final range = DateRange(trialDeadlineDate.addDays(90), trialDeadlineDate.addDays(93)); if (range.inRange(today())) { return ShareRewardPremiumTrialAnnoumcenetBar(user: user); } @@ -138,16 +124,12 @@ class AnnouncementBar extends HookConsumerWidget { return const RecommendSignupForPremiumAnnouncementBar(); } - final restDurationNotification = - RestDurationAnnouncementBar.retrieveRestDurationNotification( - latestPillSheetGroup: latestPillSheetGroup); + final restDurationNotification = RestDurationAnnouncementBar.retrieveRestDurationNotification(latestPillSheetGroup: latestPillSheetGroup); if (restDurationNotification != null) { - return RestDurationAnnouncementBar( - restDurationNotification: restDurationNotification); + return RestDurationAnnouncementBar(restDurationNotification: restDurationNotification); } - if (latestPillSheetGroup != null && - latestPillSheetGroup.activePillSheet == null) { + if (latestPillSheetGroup != null && latestPillSheetGroup.activePillSheet == null) { // ピルシートグループが存在していてactivedPillSheetが無い場合はピルシート終了が何かしらの理由がなくなったと見なし終了表示にする return EndedPillSheet( isPremium: user.isPremium, diff --git a/lib/features/record/components/announcement_bar/components/admob_banner.dart b/lib/features/record/components/announcement_bar/components/admob_banner.dart index 84a75285ce..18b9d9329e 100644 --- a/lib/features/record/components/announcement_bar/components/admob_banner.dart +++ b/lib/features/record/components/announcement_bar/components/admob_banner.dart @@ -15,9 +15,7 @@ class AdMobBanner extends StatefulWidget { class AdMobBannerState extends State { BannerAd? _bannerAd; - final String _adUnitId = Platform.isAndroid - ? Secret.androidAdmobBannerIdentifier - : Secret.iOSAdmobBannerIdentifier; + final String _adUnitId = Platform.isAndroid ? Secret.androidAdmobBannerIdentifier : Secret.iOSAdmobBannerIdentifier; @override void initState() { diff --git a/lib/features/record/components/announcement_bar/components/admob_native_advanced.dart b/lib/features/record/components/announcement_bar/components/admob_native_advanced.dart index 099a2dbac1..c1d05a5e5b 100644 --- a/lib/features/record/components/announcement_bar/components/admob_native_advanced.dart +++ b/lib/features/record/components/announcement_bar/components/admob_native_advanced.dart @@ -15,9 +15,7 @@ class AdMobNativeAdvanceState extends State { NativeAd? _nativeAd; bool _nativeAdIsLoaded = false; - final String _adUnitId = Platform.isAndroid - ? Secret.androidAdmobNativeAdvanceIdentifier - : Secret.iOSAdmobNativeAdvanceIdentifier; + final String _adUnitId = Platform.isAndroid ? Secret.androidAdmobNativeAdvanceIdentifier : Secret.iOSAdmobNativeAdvanceIdentifier; @override void initState() { @@ -35,8 +33,7 @@ class AdMobNativeAdvanceState extends State { final width = MediaQuery.of(context).size.width; final height = width * adAspectRatioSmall; if (_nativeAdIsLoaded && _nativeAd != null) { - return SizedBox( - height: height, width: width, child: AdWidget(ad: _nativeAd!)); + return SizedBox(height: height, width: width, child: AdWidget(ad: _nativeAd!)); } else { return Container(); } @@ -74,22 +71,10 @@ class AdMobNativeAdvanceState extends State { nativeTemplateStyle: NativeTemplateStyle( templateType: TemplateType.small, mainBackgroundColor: const Color(0xfffffbed), - callToActionTextStyle: NativeTemplateTextStyle( - textColor: Colors.white, - style: NativeTemplateFontStyle.monospace, - size: 16.0), - primaryTextStyle: NativeTemplateTextStyle( - textColor: Colors.black, - style: NativeTemplateFontStyle.bold, - size: 16.0), - secondaryTextStyle: NativeTemplateTextStyle( - textColor: Colors.black, - style: NativeTemplateFontStyle.italic, - size: 16.0), - tertiaryTextStyle: NativeTemplateTextStyle( - textColor: Colors.black, - style: NativeTemplateFontStyle.normal, - size: 16.0))) + callToActionTextStyle: NativeTemplateTextStyle(textColor: Colors.white, style: NativeTemplateFontStyle.monospace, size: 16.0), + primaryTextStyle: NativeTemplateTextStyle(textColor: Colors.black, style: NativeTemplateFontStyle.bold, size: 16.0), + secondaryTextStyle: NativeTemplateTextStyle(textColor: Colors.black, style: NativeTemplateFontStyle.italic, size: 16.0), + tertiaryTextStyle: NativeTemplateTextStyle(textColor: Colors.black, style: NativeTemplateFontStyle.normal, size: 16.0))) ..load(); } diff --git a/lib/features/record/components/announcement_bar/components/discount_price_deadline.dart b/lib/features/record/components/announcement_bar/components/discount_price_deadline.dart index 9caa0a408f..be0405bf6d 100644 --- a/lib/features/record/components/announcement_bar/components/discount_price_deadline.dart +++ b/lib/features/record/components/announcement_bar/components/discount_price_deadline.dart @@ -17,8 +17,7 @@ class DiscountPriceDeadline extends HookConsumerWidget { }); @override Widget build(BuildContext context, WidgetRef ref) { - final difference = ref.watch(durationToDiscountPriceDeadlineProvider( - discountEntitlementDeadlineDate: discountEntitlementDeadlineDate)); + final difference = ref.watch(durationToDiscountPriceDeadlineProvider(discountEntitlementDeadlineDate: discountEntitlementDeadlineDate)); if (difference.inSeconds <= 0) { return Container(); } @@ -50,8 +49,7 @@ $countdown内の購入で58%OFF!""", child: IconButton( icon: SvgPicture.asset( "images/arrow_right.svg", - colorFilter: - const ColorFilter.mode(Colors.white, BlendMode.srcIn), + colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn), ), onPressed: () {}, iconSize: 24, diff --git a/lib/features/record/components/announcement_bar/components/ended_pill_sheet.dart b/lib/features/record/components/announcement_bar/components/ended_pill_sheet.dart index e8f899384f..57daa26f86 100644 --- a/lib/features/record/components/announcement_bar/components/ended_pill_sheet.dart +++ b/lib/features/record/components/announcement_bar/components/ended_pill_sheet.dart @@ -26,8 +26,7 @@ class EndedPillSheet extends StatelessWidget { }); if (isPremium || isTrial) { - Navigator.of(context) - .push(PillSheetModifiedHistoriesPageRoute.route()); + Navigator.of(context).push(PillSheetModifiedHistoriesPageRoute.route()); } else { showPremiumIntroductionSheet(context); } diff --git a/lib/features/record/components/announcement_bar/components/pilll_ads.dart b/lib/features/record/components/announcement_bar/components/pilll_ads.dart index fddedc44a9..db3b1e846a 100644 --- a/lib/features/record/components/announcement_bar/components/pilll_ads.dart +++ b/lib/features/record/components/announcement_bar/components/pilll_ads.dart @@ -20,8 +20,7 @@ class PilllAdsAnnouncementBar extends HookConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final imageURL = pilllAds.imageURL; if (imageURL != null) { - return PilllAdsImageAnnouncementBar( - imageURL: imageURL, pilllAds: pilllAds, onClose: onClose); + return PilllAdsImageAnnouncementBar(imageURL: imageURL, pilllAds: pilllAds, onClose: onClose); } else { return PilllAdsTextAnnouncementBar(pilllAds: pilllAds, onClose: onClose); } @@ -153,8 +152,7 @@ class PilllAdsTextAnnouncementBar extends StatelessWidget { const SizedBox(width: 10), SvgPicture.asset( "images/arrow_right.svg", - colorFilter: - const ColorFilter.mode(Colors.white, BlendMode.srcIn), + colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn), height: 20, width: 20, ), diff --git a/lib/features/record/components/announcement_bar/components/premium_trial_limit.dart b/lib/features/record/components/announcement_bar/components/premium_trial_limit.dart index 89d13ae0b9..d9328d3f55 100644 --- a/lib/features/record/components/announcement_bar/components/premium_trial_limit.dart +++ b/lib/features/record/components/announcement_bar/components/premium_trial_limit.dart @@ -24,8 +24,7 @@ class PremiumTrialLimitAnnouncementBar extends StatelessWidget { child: GestureDetector( onTap: () async { analytics.logEvent(name: "pressed_trial_limited_announcement_bar"); - await launchUrl(Uri.parse( - "https://pilll.wraptas.site/3abd690f501549c48f813fd310b5f242")); + await launchUrl(Uri.parse("https://pilll.wraptas.site/3abd690f501549c48f813fd310b5f242")); }, child: Row( mainAxisAlignment: MainAxisAlignment.center, @@ -45,8 +44,7 @@ class PremiumTrialLimitAnnouncementBar extends StatelessWidget { const Spacer(), SvgPicture.asset( "images/arrow_right.svg", - colorFilter: - const ColorFilter.mode(Colors.white, BlendMode.srcIn), + colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn), width: 16, height: 16, ), diff --git a/lib/features/record/components/announcement_bar/components/recommend_signup_premium.dart b/lib/features/record/components/announcement_bar/components/recommend_signup_premium.dart index b6c7e8b60f..3724e8e1d3 100644 --- a/lib/features/record/components/announcement_bar/components/recommend_signup_premium.dart +++ b/lib/features/record/components/announcement_bar/components/recommend_signup_premium.dart @@ -34,8 +34,7 @@ class RecommendSignupForPremiumAnnouncementBar extends StatelessWidget { "images/alert_24.svg", width: 16, height: 16, - colorFilter: const ColorFilter.mode( - Colors.white, BlendMode.srcIn), + colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn), ), const SizedBox(width: 5), const Text( @@ -69,8 +68,7 @@ class RecommendSignupForPremiumAnnouncementBar extends StatelessWidget { child: IconButton( icon: SvgPicture.asset( "images/arrow_right.svg", - colorFilter: - const ColorFilter.mode(Colors.white, BlendMode.srcIn), + colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn), ), onPressed: () {}, iconSize: 24, diff --git a/lib/features/record/components/announcement_bar/components/rest_duration.dart b/lib/features/record/components/announcement_bar/components/rest_duration.dart index 8921b10534..9ad60d88e1 100644 --- a/lib/features/record/components/announcement_bar/components/rest_duration.dart +++ b/lib/features/record/components/announcement_bar/components/rest_duration.dart @@ -31,8 +31,7 @@ class RestDurationAnnouncementBar extends StatelessWidget { ); } - static String? retrieveRestDurationNotification( - {required PillSheetGroup? latestPillSheetGroup}) { + static String? retrieveRestDurationNotification({required PillSheetGroup? latestPillSheetGroup}) { final activePillSheet = latestPillSheetGroup?.activePillSheet; if (activePillSheet == null) { return null; @@ -46,19 +45,15 @@ class RestDurationAnnouncementBar extends StatelessWidget { return "🌙 服用お休み $day日目"; } - if (activePillSheet.typeInfo.dosingPeriod < - activePillSheet.todayPillNumber) { - final day = activePillSheet.todayPillNumber - - activePillSheet.typeInfo.dosingPeriod; + if (activePillSheet.typeInfo.dosingPeriod < activePillSheet.todayPillNumber) { + final day = activePillSheet.todayPillNumber - activePillSheet.typeInfo.dosingPeriod; return "${activePillSheet.pillSheetType.notTakenWord}$day日目"; } const threshold = 4; if (activePillSheet.pillSheetType.notTakenWord.isNotEmpty) { - if (activePillSheet.typeInfo.dosingPeriod - threshold + 1 < - activePillSheet.todayPillNumber) { - final diff = activePillSheet.typeInfo.dosingPeriod - - activePillSheet.todayPillNumber; + if (activePillSheet.typeInfo.dosingPeriod - threshold + 1 < activePillSheet.todayPillNumber) { + final diff = activePillSheet.typeInfo.dosingPeriod - activePillSheet.todayPillNumber; return "あと${diff + 1}日で${activePillSheet.pillSheetType.notTakenWord}期間です"; } } diff --git a/lib/features/record/components/announcement_bar/components/share_reward_premium_trial.dart b/lib/features/record/components/announcement_bar/components/share_reward_premium_trial.dart index ab5d5d7e69..0fb54e874a 100644 --- a/lib/features/record/components/announcement_bar/components/share_reward_premium_trial.dart +++ b/lib/features/record/components/announcement_bar/components/share_reward_premium_trial.dart @@ -22,8 +22,7 @@ class ShareRewardPremiumTrialAnnoumcenetBar extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final applyShareRewardPremiumTrial = - ref.watch(applyShareRewardPremiumTrialProvider); + final applyShareRewardPremiumTrial = ref.watch(applyShareRewardPremiumTrialProvider); return Container( padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 8), @@ -34,8 +33,7 @@ class ShareRewardPremiumTrialAnnoumcenetBar extends HookConsumerWidget { _showPicker(context, (shareToSNSKind) async { try { - await presentShareToSNSForPremiumTrialReward(shareToSNSKind, - () async { + await presentShareToSNSForPremiumTrialReward(shareToSNSKind, () async { await applyShareRewardPremiumTrial(user); }); } catch (error) { @@ -62,8 +60,7 @@ class ShareRewardPremiumTrialAnnoumcenetBar extends HookConsumerWidget { const Spacer(), SvgPicture.asset( "images/arrow_right.svg", - colorFilter: - const ColorFilter.mode(Colors.white, BlendMode.srcIn), + colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn), width: 16, height: 16, ), @@ -74,8 +71,7 @@ class ShareRewardPremiumTrialAnnoumcenetBar extends HookConsumerWidget { ); } - void _showPicker( - BuildContext context, Function(ShareToSNSKind) completionHandler) { + void _showPicker(BuildContext context, Function(ShareToSNSKind) completionHandler) { int selected = ShareToSNSKind.values.first.index; showModalBottomSheet( @@ -117,11 +113,8 @@ class ShareRewardPremiumTrialAnnoumcenetBar extends HookConsumerWidget { onSelectedItemChanged: (index) { selected = index; }, - scrollController: - FixedExtentScrollController(initialItem: selected), - children: ShareToSNSKind.values - .map((e) => Text(e.rawValue)) - .toList(), + scrollController: FixedExtentScrollController(initialItem: selected), + children: ShareToSNSKind.values.map((e) => Text(e.rawValue)).toList(), ), ), ), diff --git a/lib/features/record/components/button/record_page_button.dart b/lib/features/record/components/button/record_page_button.dart index afb8da4052..a77351aede 100644 --- a/lib/features/record/components/button/record_page_button.dart +++ b/lib/features/record/components/button/record_page_button.dart @@ -24,8 +24,7 @@ class RecordPageButton extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final registerReminderLocalNotification = - ref.watch(registerReminderLocalNotificationProvider); + final registerReminderLocalNotification = ref.watch(registerReminderLocalNotificationProvider); if (pillSheetGroup.lastActiveRestDuration != null) { return const RestDurationButton(); diff --git a/lib/features/record/components/header/record_page_header.dart b/lib/features/record/components/header/record_page_header.dart index 4abdc563e6..6febdcdef2 100644 --- a/lib/features/record/components/header/record_page_header.dart +++ b/lib/features/record/components/header/record_page_header.dart @@ -55,11 +55,8 @@ class RecordPageInformationHeader extends StatelessWidget { TodayTakenPillNumber( pillSheetGroup: pillSheetGroup, onPressed: () { - analytics.logEvent( - name: "tapped_record_information_header"); - if (activePillSheet != null && - pillSheetGroup != null && - !pillSheetGroup.isDeactived) { + analytics.logEvent(name: "tapped_record_information_header"); + if (activePillSheet != null && pillSheetGroup != null && !pillSheetGroup.isDeactived) { Navigator.of(context).push( SettingTodayPillNumberPageRoute.route( pillSheetGroup: pillSheetGroup, diff --git a/lib/features/record/components/header/today_taken_pill_number.dart b/lib/features/record/components/header/today_taken_pill_number.dart index 0f27fe92c0..21deef33d9 100644 --- a/lib/features/record/components/header/today_taken_pill_number.dart +++ b/lib/features/record/components/header/today_taken_pill_number.dart @@ -17,8 +17,7 @@ class TodayTakenPillNumber extends StatelessWidget { required this.onPressed, }); - PillSheetAppearanceMode get _appearanceMode => - pillSheetGroup?.pillSheetAppearanceMode ?? PillSheetAppearanceMode.number; + PillSheetAppearanceMode get _appearanceMode => pillSheetGroup?.pillSheetAppearanceMode ?? PillSheetAppearanceMode.number; @override Widget build(BuildContext context) { @@ -62,10 +61,7 @@ class TodayTakenPillNumber extends StatelessWidget { Widget _content() { final pillSheetGroup = this.pillSheetGroup; final activePillSheet = this.pillSheetGroup?.activePillSheet; - if (pillSheetGroup == null || - activePillSheet == null || - pillSheetGroup.isDeactived || - pillSheetGroup.lastActiveRestDuration != null) { + if (pillSheetGroup == null || activePillSheet == null || pillSheetGroup.isDeactived || pillSheetGroup.lastActiveRestDuration != null) { return const Padding( padding: EdgeInsets.only(top: 8), child: Text("-", diff --git a/lib/features/record/components/pill_sheet/components/record_page_rest_duration_dialog.dart b/lib/features/record/components/pill_sheet/components/record_page_rest_duration_dialog.dart index 78a4458ad6..3385b6d026 100644 --- a/lib/features/record/components/pill_sheet/components/record_page_rest_duration_dialog.dart +++ b/lib/features/record/components/pill_sheet/components/record_page_rest_duration_dialog.dart @@ -22,8 +22,7 @@ class RecordPageRestDurationDialog extends StatelessWidget { @override Widget build(BuildContext context) { return AlertDialog( - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(20.0))), + shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(20.0))), contentPadding: const EdgeInsets.only(left: 24, right: 24, top: 32), actionsPadding: const EdgeInsets.only(left: 24, right: 24), content: Column( @@ -40,9 +39,7 @@ class RecordPageRestDurationDialog extends StatelessWidget { )), const SizedBox(height: 24), Text( - appearanceMode == PillSheetAppearanceMode.date - ? "例えば「1/12から3日間」服用お休みした場合" - : "例えば「18番から3日間」服用お休みした場合", + appearanceMode == PillSheetAppearanceMode.date ? "例えば「1/12から3日間」服用お休みした場合" : "例えば「18番から3日間」服用お休みした場合", style: const TextStyle( color: TextColor.main, fontWeight: FontWeight.w700, @@ -51,9 +48,7 @@ class RecordPageRestDurationDialog extends StatelessWidget { ), ), const SizedBox(height: 8), - SvgPicture.asset(appearanceMode == PillSheetAppearanceMode.date - ? "images/explain_rest_duration_date.svg" - : "images/explain_rest_duration_number.svg"), + SvgPicture.asset(appearanceMode == PillSheetAppearanceMode.date ? "images/explain_rest_duration_date.svg" : "images/explain_rest_duration_number.svg"), const SizedBox(height: 24), ], ), @@ -84,8 +79,7 @@ void showRecordPageRestDurationDialog( showDialog( context: context, builder: (context) => RecordPageRestDurationDialog( - title: RecordPageRestDurationDialogTitle( - appearanceMode: appearanceMode, pillSheetGroup: pillSheetGroup), + title: RecordPageRestDurationDialogTitle(appearanceMode: appearanceMode, pillSheetGroup: pillSheetGroup), appearanceMode: appearanceMode, onDone: onDone, ), @@ -118,10 +112,7 @@ class RecordPageRestDurationDialogTitle extends StatelessWidget { case PillSheetAppearanceMode.number: return "${pillSheetGroup.lastTakenPillSheetOrFirstPillSheet.lastTakenPillNumber + 1}番"; case PillSheetAppearanceMode.date: - final date = pillSheetGroup.lastTakenPillSheetOrFirstPillSheet - .displayPillTakeDate(pillSheetGroup - .lastTakenPillSheetOrFirstPillSheet.lastTakenPillNumber + - 1); + final date = pillSheetGroup.lastTakenPillSheetOrFirstPillSheet.displayPillTakeDate(pillSheetGroup.lastTakenPillSheetOrFirstPillSheet.lastTakenPillNumber + 1); final dateString = DateTimeFormatter.monthAndDay(date); return dateString; case PillSheetAppearanceMode.sequential: diff --git a/lib/features/record/components/pill_sheet/record_page_pill_sheet.dart b/lib/features/record/components/pill_sheet/record_page_pill_sheet.dart index 24da5c280e..ccc2437658 100644 --- a/lib/features/record/components/pill_sheet/record_page_pill_sheet.dart +++ b/lib/features/record/components/pill_sheet/record_page_pill_sheet.dart @@ -35,8 +35,7 @@ class RecordPagePillSheet extends HookConsumerWidget { final Setting setting; final User user; - List get pillSheetTypes => - pillSheetGroup.pillSheets.map((e) => e.pillSheetType).toList(); + List get pillSheetTypes => pillSheetGroup.pillSheets.map((e) => e.pillSheetType).toList(); const RecordPagePillSheet({ super.key, @@ -48,12 +47,10 @@ class RecordPagePillSheet extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final weekdayDate = pillSheet.beginingDate.addDays(summarizedRestDuration( - restDurations: pillSheet.restDurations, upperDate: today())); + final weekdayDate = pillSheet.beginingDate.addDays(summarizedRestDuration(restDurations: pillSheet.restDurations, upperDate: today())); final takePill = ref.watch(takePillProvider); final revertTakePill = ref.watch(revertTakePillProvider); - final registerReminderLocalNotification = - ref.watch(registerReminderLocalNotificationProvider); + final registerReminderLocalNotification = ref.watch(registerReminderLocalNotificationProvider); return PillSheetViewLayout( weekdayLines: PillSheetViewWeekdayLine( @@ -67,8 +64,7 @@ class RecordPagePillSheet extends HookConsumerWidget { context, takePill: takePill, revertTakePill: revertTakePill, - registerReminderLocalNotification: - registerReminderLocalNotification, + registerReminderLocalNotification: registerReminderLocalNotification, lineIndex: index, pageIndex: pillSheet.groupIndex, ), @@ -82,17 +78,14 @@ class RecordPagePillSheet extends HookConsumerWidget { BuildContext context, { required TakePill takePill, required RevertTakePill revertTakePill, - required RegisterReminderLocalNotification - registerReminderLocalNotification, + required RegisterReminderLocalNotification registerReminderLocalNotification, required int lineIndex, required int pageIndex, }) { final lineNumber = lineIndex + 1; int countOfPillMarksInLine = Weekday.values.length; - if (lineNumber * Weekday.values.length > - pillSheet.pillSheetType.totalCount) { - int diff = pillSheet.pillSheetType.totalCount - - lineIndex * Weekday.values.length; + if (lineNumber * Weekday.values.length > pillSheet.pillSheetType.totalCount) { + int diff = pillSheet.pillSheetType.totalCount - lineIndex * Weekday.values.length; countOfPillMarksInLine = diff; } @@ -101,9 +94,7 @@ class RecordPagePillSheet extends HookConsumerWidget { return Container(width: PillSheetViewLayout.componentWidth); } - final pillNumberInPillSheet = - PillMarkWithNumberLayoutHelper.calcPillNumberIntoPillSheet( - columnIndex, lineIndex); + final pillNumberInPillSheet = PillMarkWithNumberLayoutHelper.calcPillNumberIntoPillSheet(columnIndex, lineIndex); return SizedBox( width: PillSheetViewLayout.componentWidth, child: PillMarkWithNumberLayout( @@ -194,8 +185,7 @@ class RecordPagePillSheet extends HookConsumerWidget { if (activePillSheet.groupIndex < pillSheet.groupIndex) { return null; } - var diff = min(pillSheet.todayPillNumber, pillSheet.typeInfo.totalCount) - - pillNumberInPillSheet; + var diff = min(pillSheet.todayPillNumber, pillSheet.typeInfo.totalCount) - pillNumberInPillSheet; if (diff < 0) { // User tapped future pill number return null; @@ -246,10 +236,7 @@ PillMarkType pillMarkFor({ required PillSheet pillSheet, }) { if (pillNumberInPillSheet > pillSheet.typeInfo.dosingPeriod) { - return (pillSheet.pillSheetType == PillSheetType.pillsheet_21 || - pillSheet.pillSheetType == PillSheetType.pillsheet_24_rest_4) - ? PillMarkType.rest - : PillMarkType.fake; + return (pillSheet.pillSheetType == PillSheetType.pillsheet_21 || pillSheet.pillSheetType == PillSheetType.pillsheet_24_rest_4) ? PillMarkType.rest : PillMarkType.fake; } if (pillNumberInPillSheet <= pillSheet.lastTakenPillNumber) { return PillMarkType.done; @@ -284,8 +271,7 @@ bool shouldPillMarkAnimation({ return false; } - return pillNumberInPillSheet > activePillSheet.lastTakenPillNumber && - pillNumberInPillSheet <= activePillSheet.todayPillNumber; + return pillNumberInPillSheet > activePillSheet.lastTakenPillNumber && pillNumberInPillSheet <= activePillSheet.todayPillNumber; } class PillNumber extends StatelessWidget { @@ -296,24 +282,13 @@ class PillNumber extends StatelessWidget { final int pageIndex; final int pillNumberInPillSheet; - const PillNumber( - {super.key, - required this.pillSheetGroup, - required this.pillSheet, - required this.setting, - required this.user, - required this.pageIndex, - required this.pillNumberInPillSheet}); + const PillNumber({super.key, required this.pillSheetGroup, required this.pillSheet, required this.setting, required this.user, required this.pageIndex, required this.pillNumberInPillSheet}); @override Widget build(BuildContext context) { - final menstruationDateRanges = - pillSheetGroup.menstruationDateRanges(setting: setting); + final menstruationDateRanges = pillSheetGroup.menstruationDateRanges(setting: setting); - final containedMenstruationDuration = menstruationDateRanges - .where((e) => - e.inRange(pillSheet.displayPillTakeDate(pillNumberInPillSheet))) - .isNotEmpty; + final containedMenstruationDuration = menstruationDateRanges.where((e) => e.inRange(pillSheet.displayPillTakeDate(pillNumberInPillSheet))).isNotEmpty; final text = pillSheetGroup.displayPillNumber( premiumOrTrial: user.premiumOrTrial, diff --git a/lib/features/record/components/pill_sheet/record_page_pill_sheet_list.dart b/lib/features/record/components/pill_sheet/record_page_pill_sheet_list.dart index 0b623d988b..05daeaeb5c 100644 --- a/lib/features/record/components/pill_sheet/record_page_pill_sheet_list.dart +++ b/lib/features/record/components/pill_sheet/record_page_pill_sheet_list.dart @@ -27,18 +27,12 @@ class RecordPagePillSheetList extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final pageController = usePageController( - initialPage: activePillSheet.groupIndex, - viewportFraction: (PillSheetViewLayout.width + 20) / - MediaQuery.of(context).size.width); + final pageController = usePageController(initialPage: activePillSheet.groupIndex, viewportFraction: (PillSheetViewLayout.width + 20) / MediaQuery.of(context).size.width); return Column( children: [ SizedBox( height: PillSheetViewLayout.calcHeight( - PillSheetViewLayout.mostLargePillSheetType(pillSheetGroup.pillSheets - .map((e) => e.pillSheetType) - .toList()) - .numberOfLineInPillSheet, + PillSheetViewLayout.mostLargePillSheetType(pillSheetGroup.pillSheets.map((e) => e.pillSheetType).toList()).numberOfLineInPillSheet, false, ), child: PageView( diff --git a/lib/features/record/components/setting/components/appearance_mode/select_appearance_mode_modal.dart b/lib/features/record/components/setting/components/appearance_mode/select_appearance_mode_modal.dart index 79d9f5d9bb..6561c4795a 100644 --- a/lib/features/record/components/setting/components/appearance_mode/select_appearance_mode_modal.dart +++ b/lib/features/record/components/setting/components/appearance_mode/select_appearance_mode_modal.dart @@ -21,12 +21,10 @@ class SelectAppearanceModeModal extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final setting = ref.watch(settingProvider).requireValue; - final pillSheetGroup = - ref.watch(latestPillSheetGroupProvider).asData?.value; + final pillSheetGroup = ref.watch(latestPillSheetGroupProvider).asData?.value; final setSetting = ref.watch(setSettingProvider); final setPillSheetGroup = ref.watch(setPillSheetGroupProvider); - final registerReminderLocalNotification = - ref.watch(registerReminderLocalNotificationProvider); + final registerReminderLocalNotification = ref.watch(registerReminderLocalNotificationProvider); if (pillSheetGroup == null) { return const SizedBox(); @@ -57,8 +55,7 @@ class SelectAppearanceModeModal extends HookConsumerWidget { pillSheetGroup: pillSheetGroup, setSetting: setSetting, setPillSheetGroup: setPillSheetGroup, - registerReminderLocalNotification: - registerReminderLocalNotification, + registerReminderLocalNotification: registerReminderLocalNotification, user: user, mode: PillSheetAppearanceMode.date, text: "日付表示", @@ -70,8 +67,7 @@ class SelectAppearanceModeModal extends HookConsumerWidget { pillSheetGroup: pillSheetGroup, setSetting: setSetting, setPillSheetGroup: setPillSheetGroup, - registerReminderLocalNotification: - registerReminderLocalNotification, + registerReminderLocalNotification: registerReminderLocalNotification, user: user, mode: PillSheetAppearanceMode.number, text: "ピル番号", @@ -83,8 +79,7 @@ class SelectAppearanceModeModal extends HookConsumerWidget { pillSheetGroup: pillSheetGroup, setSetting: setSetting, setPillSheetGroup: setPillSheetGroup, - registerReminderLocalNotification: - registerReminderLocalNotification, + registerReminderLocalNotification: registerReminderLocalNotification, user: user, mode: PillSheetAppearanceMode.sequential, text: "服用日数", @@ -96,8 +91,7 @@ class SelectAppearanceModeModal extends HookConsumerWidget { pillSheetGroup: pillSheetGroup, setSetting: setSetting, setPillSheetGroup: setPillSheetGroup, - registerReminderLocalNotification: - registerReminderLocalNotification, + registerReminderLocalNotification: registerReminderLocalNotification, user: user, mode: PillSheetAppearanceMode.cyclicSequential, text: "服用日数(周期)", @@ -115,8 +109,7 @@ class SelectAppearanceModeModal extends HookConsumerWidget { BuildContext context, { required SetSetting setSetting, required SetPillSheetGroup setPillSheetGroup, - required RegisterReminderLocalNotification - registerReminderLocalNotification, + required RegisterReminderLocalNotification registerReminderLocalNotification, required Setting setting, required PillSheetGroup pillSheetGroup, required User user, @@ -128,17 +121,13 @@ class SelectAppearanceModeModal extends HookConsumerWidget { onTap: () async { analytics.logEvent( name: "did_select_pill_sheet_appearance", - parameters: { - "mode": mode.toString(), - "isPremiumFunction": isPremiumFunction - }, + parameters: {"mode": mode.toString(), "isPremiumFunction": isPremiumFunction}, ); if (user.isPremium || user.isTrial) { // NOTE: [Migrate:PillSheetAppearanceMode] settingも同期する await setSetting(setting.copyWith(pillSheetAppearanceMode: mode)); - await setPillSheetGroup( - pillSheetGroup.copyWith(pillSheetAppearanceMode: mode)); + await setPillSheetGroup(pillSheetGroup.copyWith(pillSheetAppearanceMode: mode)); await registerReminderLocalNotification(); } else if (isPremiumFunction) { showPremiumIntroductionSheet(context); @@ -146,8 +135,7 @@ class SelectAppearanceModeModal extends HookConsumerWidget { // User selected non premium function mode // NOTE: [Migrate:PillSheetAppearanceMode] settingも同期する await setSetting(setting.copyWith(pillSheetAppearanceMode: mode)); - await setPillSheetGroup( - pillSheetGroup.copyWith(pillSheetAppearanceMode: mode)); + await setPillSheetGroup(pillSheetGroup.copyWith(pillSheetAppearanceMode: mode)); await registerReminderLocalNotification(); } }, @@ -155,8 +143,7 @@ class SelectAppearanceModeModal extends HookConsumerWidget { height: 48, child: Row( children: [ - SelectCircle( - isSelected: mode == pillSheetGroup.pillSheetAppearanceMode), + SelectCircle(isSelected: mode == pillSheetGroup.pillSheetAppearanceMode), const SizedBox(width: 34), Text( text, diff --git a/lib/features/record/components/setting/components/appearance_mode/switching_appearance_mode.dart b/lib/features/record/components/setting/components/appearance_mode/switching_appearance_mode.dart index 53b2eab64b..bc5c70841a 100644 --- a/lib/features/record/components/setting/components/appearance_mode/switching_appearance_mode.dart +++ b/lib/features/record/components/setting/components/appearance_mode/switching_appearance_mode.dart @@ -26,8 +26,7 @@ class SwitchingAppearanceMode extends StatelessWidget { ), onTap: () { analytics.logEvent(name: "did_tapped_record_page_appearance_mode"); - showSelectAppearanceModeModal(context, - user: user, pillSheetGroup: pillSheetGroup); + showSelectAppearanceModeModal(context, user: user, pillSheetGroup: pillSheetGroup); }, ); } diff --git a/lib/features/record/components/setting/components/delete/pill_sheet_group_delete.dart b/lib/features/record/components/setting/components/delete/pill_sheet_group_delete.dart index d576e4f84c..665d3278bb 100644 --- a/lib/features/record/components/setting/components/delete/pill_sheet_group_delete.dart +++ b/lib/features/record/components/setting/components/delete/pill_sheet_group_delete.dart @@ -24,8 +24,7 @@ class PillSheetGroupDelete extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final deletePillSheetGroup = ref.watch(deletePillSheetGroupProvider); - final cancelReminderLocalNotification = - ref.watch(cancelReminderLocalNotificationProvider); + final cancelReminderLocalNotification = ref.watch(cancelReminderLocalNotificationProvider); return ListTile( leading: const Icon(Icons.delete_outline, color: PilllColors.red), title: const Text( @@ -86,13 +85,10 @@ class PillSheetGroupDelete extends HookConsumerWidget { text: "破棄する", onPressed: () async { try { - await deletePillSheetGroup( - latestPillSheetGroup: pillSheetGroup, - activePillSheet: activePillSheet); + await deletePillSheetGroup(latestPillSheetGroup: pillSheetGroup, activePillSheet: activePillSheet); await cancelReminderLocalNotification(); if (context.mounted) { - Navigator.of(context) - .popUntil((route) => route.isFirst); + Navigator.of(context).popUntil((route) => route.isFirst); ScaffoldMessenger.of(context).showSnackBar( const SnackBar( duration: Duration(seconds: 2), diff --git a/lib/features/record/components/setting/components/display_number_setting/display_number_setting.dart b/lib/features/record/components/setting/components/display_number_setting/display_number_setting.dart index f648fcfff1..4886b6dcae 100644 --- a/lib/features/record/components/setting/components/display_number_setting/display_number_setting.dart +++ b/lib/features/record/components/setting/components/display_number_setting/display_number_setting.dart @@ -15,8 +15,7 @@ class DisplayNumberSetting extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final begin = pillSheetGroup.displayNumberSetting?.beginPillNumber ?? 1; - final end = pillSheetGroup.displayNumberSetting?.endPillNumber ?? - pillSheetGroup.sequentialEstimatedEndPillNumber; + final end = pillSheetGroup.displayNumberSetting?.endPillNumber ?? pillSheetGroup.sequentialEstimatedEndPillNumber; return ListTile( leading: const Icon(Icons.change_circle_outlined), title: const Text("服用日数を変更"), diff --git a/lib/features/record/components/setting/components/display_number_setting/display_number_setting_sheet.dart b/lib/features/record/components/setting/components/display_number_setting/display_number_setting_sheet.dart index 5cf33e33bf..7f83550e09 100644 --- a/lib/features/record/components/setting/components/display_number_setting/display_number_setting_sheet.dart +++ b/lib/features/record/components/setting/components/display_number_setting/display_number_setting_sheet.dart @@ -22,31 +22,22 @@ class DisplayNumberSettingSheet extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final begin = - useState(pillSheetGroup.displayNumberSetting?.beginPillNumber); + final begin = useState(pillSheetGroup.displayNumberSetting?.beginPillNumber); final end = useState(pillSheetGroup.displayNumberSetting?.endPillNumber); - final beginTextFieldController = - useTextEditingController(text: "${begin.value ?? 1}"); - final endTextFieldController = useTextEditingController( - text: - "${end.value ?? pillSheetGroup.sequentialEstimatedEndPillNumber}"); + final beginTextFieldController = useTextEditingController(text: "${begin.value ?? 1}"); + final endTextFieldController = useTextEditingController(text: "${end.value ?? pillSheetGroup.sequentialEstimatedEndPillNumber}"); - final beforePillSheetGroup = - ref.watch(beforePillSheetGroupProvider).valueOrNull; + final beforePillSheetGroup = ref.watch(beforePillSheetGroupProvider).valueOrNull; const estimatedKeyboardHeight = 216; const offset = 24; - final height = 1 - - ((estimatedKeyboardHeight - offset) / - MediaQuery.of(context).size.height); + final height = 1 - ((estimatedKeyboardHeight - offset) / MediaQuery.of(context).size.height); final batchFactory = ref.watch(batchFactoryProvider); final batchSetPillSheetGroup = ref.watch(batchSetPillSheetGroupProvider); - final batchSetPillSheetModifiedHistory = - ref.watch(batchSetPillSheetModifiedHistoryProvider); - final registerReminderLocalNotification = - ref.watch(registerReminderLocalNotificationProvider); + final batchSetPillSheetModifiedHistory = ref.watch(batchSetPillSheetModifiedHistoryProvider); + final registerReminderLocalNotification = ref.watch(registerReminderLocalNotificationProvider); return DraggableScrollableSheet( initialChildSize: height, @@ -84,8 +75,7 @@ class DisplayNumberSettingSheet extends HookConsumerWidget { await _submit( batchFactory: batchFactory, batchSetPillSheetGroup: batchSetPillSheetGroup, - batchSetPillSheetModifiedHistory: - batchSetPillSheetModifiedHistory, + batchSetPillSheetModifiedHistory: batchSetPillSheetModifiedHistory, begin: begin, end: end, ); @@ -114,8 +104,7 @@ class DisplayNumberSettingSheet extends HookConsumerWidget { children: [ Row( children: [ - SvgPicture.asset( - "images/begin_display_number_setting.svg"), + SvgPicture.asset("images/begin_display_number_setting.svg"), const SizedBox(width: 4), const Text( "服用日数の始まり", @@ -305,8 +294,7 @@ class DisplayNumberSettingSheet extends HookConsumerWidget { if (begin.value != pillSheetGroup.displayNumberSetting?.beginPillNumber) { batchSetPillSheetModifiedHistory( batch, - PillSheetModifiedHistoryServiceActionFactory - .createChangedBeginDisplayNumberAction( + PillSheetModifiedHistoryServiceActionFactory.createChangedBeginDisplayNumberAction( pillSheetGroupID: pillSheetGroup.id, beforeDisplayNumberSetting: pillSheetGroup.displayNumberSetting, afterDisplayNumberSetting: updatedDisplayNumberSetting, @@ -319,8 +307,7 @@ class DisplayNumberSettingSheet extends HookConsumerWidget { if (end.value != pillSheetGroup.displayNumberSetting?.endPillNumber) { batchSetPillSheetModifiedHistory( batch, - PillSheetModifiedHistoryServiceActionFactory - .createChangedEndDisplayNumberAction( + PillSheetModifiedHistoryServiceActionFactory.createChangedEndDisplayNumberAction( pillSheetGroupID: pillSheetGroup.id, beforeDisplayNumberSetting: pillSheetGroup.displayNumberSetting, afterDisplayNumberSetting: updatedDisplayNumberSetting, diff --git a/lib/features/record/components/setting/components/rest_duration/begin_manual_rest_duration.dart b/lib/features/record/components/setting/components/rest_duration/begin_manual_rest_duration.dart index ad4264b4a1..b7c5216415 100644 --- a/lib/features/record/components/setting/components/rest_duration/begin_manual_rest_duration.dart +++ b/lib/features/record/components/setting/components/rest_duration/begin_manual_rest_duration.dart @@ -25,8 +25,7 @@ class BeginManualRestDuration extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final beginRestDuration = ref.watch(beginRestDurationProvider); - final cancelReminderLocalNotification = - ref.watch(cancelReminderLocalNotificationProvider); + final cancelReminderLocalNotification = ref.watch(cancelReminderLocalNotificationProvider); void didBeginRestDuration() { ScaffoldMessenger.of(context).showSnackBar( @@ -44,9 +43,7 @@ class BeginManualRestDuration extends HookConsumerWidget { leading: const Icon(Icons.dark_mode_outlined), title: const Text("服用お休み開始"), onTap: () { - analytics.logEvent( - name: "begin_manual_rest_duration_pressed", - parameters: {"pill_sheet_id": activePillSheet.id}); + analytics.logEvent(name: "begin_manual_rest_duration_pressed", parameters: {"pill_sheet_id": activePillSheet.id}); if (activePillSheet.todayPillIsAlreadyTaken) { showInvalidAlreadyTakenPillDialog(context); diff --git a/lib/features/record/components/setting/components/rest_duration/change_manual_rest_duration.dart b/lib/features/record/components/setting/components/rest_duration/change_manual_rest_duration.dart index 3a2b64d88c..fbcfd36965 100644 --- a/lib/features/record/components/setting/components/rest_duration/change_manual_rest_duration.dart +++ b/lib/features/record/components/setting/components/rest_duration/change_manual_rest_duration.dart @@ -22,8 +22,7 @@ class ChangeManualRestDuration extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final changeRestDurationBeginDate = - ref.watch(changeRestDurationBeginDateProvider); + final changeRestDurationBeginDate = ref.watch(changeRestDurationBeginDateProvider); final changeRestDuration = ref.watch(changeRestDurationProvider); String format(DateTime dateTime) { @@ -31,8 +30,7 @@ class ChangeManualRestDuration extends HookConsumerWidget { } final begin = format(restDuration.beginDate); - final end = - restDuration.endDate != null ? format(restDuration.endDate!) : null; + final end = restDuration.endDate != null ? format(restDuration.endDate!) : null; void onChanged() { ScaffoldMessenger.of(context).showSnackBar( @@ -58,8 +56,7 @@ class ChangeManualRestDuration extends HookConsumerWidget { title: const Text("服用お休み開始日を編集"), subtitle: Text(begin), onTap: () async { - analytics - .logEvent(name: "change_manual_rest_duration_day", parameters: { + analytics.logEvent(name: "change_manual_rest_duration_day", parameters: { "rest_duration_id": restDuration.id, }); @@ -68,8 +65,7 @@ class ChangeManualRestDuration extends HookConsumerWidget { final dateTime = await showDatePicker( context: context, initialEntryMode: DatePickerEntryMode.calendarOnly, - initialDate: - pillSheetGroup.lastActiveRestDuration?.beginDate ?? today(), + initialDate: pillSheetGroup.lastActiveRestDuration?.beginDate ?? today(), firstDate: pillSheetGroup.pillSheets.first.beginingDate, lastDate: pillSheetGroup.availableRestDurationBeginDate, helpText: "服用お休み開始日を選択", @@ -109,8 +105,7 @@ class ChangeManualRestDuration extends HookConsumerWidget { title: const Text("服用お休み期間を編集"), subtitle: Text("$begin - $end"), onTap: () async { - analytics - .logEvent(name: "change_manual_rest_duration_range", parameters: { + analytics.logEvent(name: "change_manual_rest_duration_range", parameters: { "rest_duration_id": restDuration.id, }); diff --git a/lib/features/record/components/setting/components/rest_duration/end_manual_rest_duration.dart b/lib/features/record/components/setting/components/rest_duration/end_manual_rest_duration.dart index 6aab500a9c..8b2b441f56 100644 --- a/lib/features/record/components/setting/components/rest_duration/end_manual_rest_duration.dart +++ b/lib/features/record/components/setting/components/rest_duration/end_manual_rest_duration.dart @@ -24,8 +24,7 @@ class EndManualRestDuration extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final endRestDuration = ref.watch(endRestDurationProvider); - final registerReminderLocalNotification = - ref.watch(registerReminderLocalNotificationProvider); + final registerReminderLocalNotification = ref.watch(registerReminderLocalNotificationProvider); void didEndRestDuration(PillSheetGroup endedRestDurationPillSheetGroup) { Navigator.of(context).popUntil((route) => route.isFirst); diff --git a/lib/features/record/components/setting/components/rest_duration/invalid_already_taken_pill_dialog.dart b/lib/features/record/components/setting/components/rest_duration/invalid_already_taken_pill_dialog.dart index ce94da2827..337217cc33 100644 --- a/lib/features/record/components/setting/components/rest_duration/invalid_already_taken_pill_dialog.dart +++ b/lib/features/record/components/setting/components/rest_duration/invalid_already_taken_pill_dialog.dart @@ -12,13 +12,11 @@ class InvalidAlreadyTakenPillDialog extends StatelessWidget { @override Widget build(BuildContext context) { return AlertDialog( - contentPadding: - const EdgeInsets.only(left: 24, right: 24, top: 4, bottom: 24), + contentPadding: const EdgeInsets.only(left: 24, right: 24, top: 4, bottom: 24), actionsPadding: const EdgeInsets.only(left: 24, right: 24, bottom: 32), titlePadding: const EdgeInsets.only(top: 32), title: SvgPicture.asset("images/alert_24.svg", width: 24, height: 24), - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(20))), + shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(20))), content: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisSize: MainAxisSize.min, @@ -70,8 +68,7 @@ class InvalidAlreadyTakenPillDialog extends StatelessWidget { AppOutlinedButton( onPressed: () async { analytics.logEvent(name: "invalid_already_taken_pill_faq"); - launchUrl(Uri.parse( - "https://pilll.wraptas.site/467128e667ae4d6cbff4d61ee370cce5")); + launchUrl(Uri.parse("https://pilll.wraptas.site/467128e667ae4d6cbff4d61ee370cce5")); }, text: "服用お休み機能の使い方を見る", ), diff --git a/lib/features/record/components/setting/components/rest_duration/provider.dart b/lib/features/record/components/setting/components/rest_duration/provider.dart index da508fe85d..092d6ef57b 100644 --- a/lib/features/record/components/setting/components/rest_duration/provider.dart +++ b/lib/features/record/components/setting/components/rest_duration/provider.dart @@ -14,8 +14,7 @@ final beginRestDurationProvider = Provider.autoDispose( (ref) => BeginRestDuration( batchFactory: ref.watch(batchFactoryProvider), batchSetPillSheetGroup: ref.watch(batchSetPillSheetGroupProvider), - batchSetPillSheetModifiedHistory: - ref.watch(batchSetPillSheetModifiedHistoryProvider), + batchSetPillSheetModifiedHistory: ref.watch(batchSetPillSheetModifiedHistoryProvider), ), ); @@ -42,8 +41,7 @@ class BeginRestDuration { createdDate: now(), ); - final updatedPillSheet = - pillSheetGroup.targetBeginRestDurationPillSheet.copyWith( + final updatedPillSheet = pillSheetGroup.targetBeginRestDurationPillSheet.copyWith( restDurations: [ ...pillSheetGroup.targetBeginRestDurationPillSheet.restDurations, restDuration, @@ -54,8 +52,7 @@ class BeginRestDuration { batchSetPillSheetGroup(batch, updatedPillSheetGroup); batchSetPillSheetModifiedHistory( batch, - PillSheetModifiedHistoryServiceActionFactory - .createBeganRestDurationAction( + PillSheetModifiedHistoryServiceActionFactory.createBeganRestDurationAction( pillSheetGroupID: pillSheetGroup.id, before: pillSheetGroup.targetBeginRestDurationPillSheet, after: updatedPillSheet, @@ -73,8 +70,7 @@ final endRestDurationProvider = Provider.autoDispose( (ref) => EndRestDuration( batchFactory: ref.watch(batchFactoryProvider), batchSetPillSheetGroup: ref.watch(batchSetPillSheetGroupProvider), - batchSetPillSheetModifiedHistory: - ref.watch(batchSetPillSheetModifiedHistoryProvider), + batchSetPillSheetModifiedHistory: ref.watch(batchSetPillSheetModifiedHistoryProvider), ), ); @@ -110,24 +106,20 @@ class EndRestDuration { updatedPillSheets.add(updatedPillSheet); } else if (pillSheet.groupIndex > activePillSheet.groupIndex) { // activePillSheetよりも後のピルシートで、前のピルシートのbeginDateが更新され、estimatedEndTakenDateが変わっている場合も考慮する必要があるのでupdatedPillSheetsから1つ前のピルシートにアクセスする - final beforeUpdatedPillSheet = - updatedPillSheets[pillSheet.groupIndex - 1]; + final beforeUpdatedPillSheet = updatedPillSheets[pillSheet.groupIndex - 1]; updatedPillSheets.add(pillSheet.copyWith( - beginingDate: beforeUpdatedPillSheet.estimatedEndTakenDate - .add(const Duration(days: 1)), + beginingDate: beforeUpdatedPillSheet.estimatedEndTakenDate.add(const Duration(days: 1)), )); } else { updatedPillSheets.add(pillSheet); } } - final updatedPillSheetGroup = - pillSheetGroup.copyWith(pillSheets: updatedPillSheets); + final updatedPillSheetGroup = pillSheetGroup.copyWith(pillSheets: updatedPillSheets); batchSetPillSheetGroup(batch, updatedPillSheetGroup); batchSetPillSheetModifiedHistory( batch, - PillSheetModifiedHistoryServiceActionFactory - .createEndedRestDurationAction( + PillSheetModifiedHistoryServiceActionFactory.createEndedRestDurationAction( pillSheetGroupID: pillSheetGroup.id, before: activePillSheet, after: updatedPillSheet, @@ -147,8 +139,7 @@ final changeRestDurationBeginDateProvider = Provider.autoDispose( actionType: PillSheetModifiedActionType.changedRestDurationBeginDate, batchFactory: ref.watch(batchFactoryProvider), batchSetPillSheetGroup: ref.watch(batchSetPillSheetGroupProvider), - batchSetPillSheetModifiedHistory: - ref.watch(batchSetPillSheetModifiedHistoryProvider), + batchSetPillSheetModifiedHistory: ref.watch(batchSetPillSheetModifiedHistoryProvider), ), ); final changeRestDurationProvider = Provider.autoDispose( @@ -156,8 +147,7 @@ final changeRestDurationProvider = Provider.autoDispose( actionType: PillSheetModifiedActionType.changedRestDuration, batchFactory: ref.watch(batchFactoryProvider), batchSetPillSheetGroup: ref.watch(batchSetPillSheetGroupProvider), - batchSetPillSheetModifiedHistory: - ref.watch(batchSetPillSheetModifiedHistoryProvider), + batchSetPillSheetModifiedHistory: ref.watch(batchSetPillSheetModifiedHistoryProvider), ), ); @@ -179,14 +169,10 @@ class ChangeRestDuration { // restDuration.idが2024-03-28の実装時に追加されたものでnullableの可能性がある。 // idチェックをしているが後述の期間をチェックする処理でもほぼ問題ない // また、toRestDurationの場合はマッチするIDが無いのでどちらにしてもidではなく期間で絞る必要がある - if (pillSheet.restDurations - .map((e) => e.id) - .where((e) => e != null) - .contains(restDuration.id)) { + if (pillSheet.restDurations.map((e) => e.id).where((e) => e != null).contains(restDuration.id)) { return true; } - return !restDuration.beginDate.isBefore(pillSheet.beginingDate) && - !restDuration.beginDate.isAfter(pillSheet.estimatedEndTakenDate); + return !restDuration.beginDate.isBefore(pillSheet.beginingDate) && !restDuration.beginDate.isAfter(pillSheet.estimatedEndTakenDate); } Future call({ @@ -194,48 +180,34 @@ class ChangeRestDuration { required RestDuration toRestDuration, required PillSheetGroup pillSheetGroup, }) async { - final fromRestDurationPillSheetIndex = pillSheetGroup.pillSheets - .indexWhere((e) => _hasRestDuration(e, fromRestDuration)); + final fromRestDurationPillSheetIndex = pillSheetGroup.pillSheets.indexWhere((e) => _hasRestDuration(e, fromRestDuration)); if (fromRestDurationPillSheetIndex == -1) { throw AssertionError("fromRestDurationPillSheetIndex is not found"); } - final fromRestDurationPillSheet = - pillSheetGroup.pillSheets[fromRestDurationPillSheetIndex]; + final fromRestDurationPillSheet = pillSheetGroup.pillSheets[fromRestDurationPillSheetIndex]; if (fromRestDurationPillSheet.restDurations.isEmpty) { throw AssertionError("fromRestDurationPillSheet.restDurations is empty"); } - final fromRestDurationIndex = - fromRestDurationPillSheet.restDurations.indexOf(fromRestDuration); + final fromRestDurationIndex = fromRestDurationPillSheet.restDurations.indexOf(fromRestDuration); if (fromRestDurationIndex == -1) { throw AssertionError("fromRestDurationIndex is not found"); } - final updatedFromRestDurationPillSheet = fromRestDurationPillSheet.copyWith( - restDurations: [...fromRestDurationPillSheet.restDurations] - ..removeAt(fromRestDurationIndex)); + final updatedFromRestDurationPillSheet = fromRestDurationPillSheet.copyWith(restDurations: [...fromRestDurationPillSheet.restDurations]..removeAt(fromRestDurationIndex)); - final toRestDurationPillSheetIndex = pillSheetGroup.pillSheets - .indexWhere((e) => _hasRestDuration(e, toRestDuration)); + final toRestDurationPillSheetIndex = pillSheetGroup.pillSheets.indexWhere((e) => _hasRestDuration(e, toRestDuration)); if (toRestDurationPillSheetIndex == -1) { throw AssertionError("toRestDurationPillSheetIndex is not found"); } final PillSheet updatedToRestDurationPillSheet; - final toRestDurationPillSheet = - pillSheetGroup.pillSheets[toRestDurationPillSheetIndex]; + final toRestDurationPillSheet = pillSheetGroup.pillSheets[toRestDurationPillSheetIndex]; if (updatedFromRestDurationPillSheet.id == toRestDurationPillSheet.id) { // 変更前後のお休み期間対象のピルシートが一緒の場合はupdatedFromRestDurationPillSheetからコピーする - updatedToRestDurationPillSheet = - updatedFromRestDurationPillSheet.copyWith( - restDurations: [ - ...updatedFromRestDurationPillSheet.restDurations, - toRestDuration - ], + updatedToRestDurationPillSheet = updatedFromRestDurationPillSheet.copyWith( + restDurations: [...updatedFromRestDurationPillSheet.restDurations, toRestDuration], ); } else { updatedToRestDurationPillSheet = toRestDurationPillSheet.copyWith( - restDurations: [ - ...toRestDurationPillSheet.restDurations, - toRestDuration - ], + restDurations: [...toRestDurationPillSheet.restDurations, toRestDuration], ); } @@ -264,8 +236,7 @@ class ChangeRestDuration { /// このループ内でアップデートされた前のピルシートを用いてbeginingDateを算出するので、 /// [updatedBeginingDatePillSheets] から取得する - final beforePillSheet = - updatedBeginingDatePillSheets[pillSheet.groupIndex - 1]; + final beforePillSheet = updatedBeginingDatePillSheets[pillSheet.groupIndex - 1]; updatedBeginingDatePillSheets.add(pillSheet.copyWith( beginingDate: beforePillSheet.estimatedEndTakenDate.date().addDays(1), )); @@ -292,15 +263,13 @@ class ChangeRestDuration { } final batch = batchFactory.batch(); - final updatedPillSheetGroup = - pillSheetGroup.copyWith(pillSheets: updatedPillSheets); + final updatedPillSheetGroup = pillSheetGroup.copyWith(pillSheets: updatedPillSheets); batchSetPillSheetGroup(batch, updatedPillSheetGroup); switch (actionType) { case PillSheetModifiedActionType.changedRestDurationBeginDate: batchSetPillSheetModifiedHistory( batch, - PillSheetModifiedHistoryServiceActionFactory - .createChangedRestDurationBeginDateAction( + PillSheetModifiedHistoryServiceActionFactory.createChangedRestDurationBeginDateAction( pillSheetGroupID: pillSheetGroup.id, before: fromRestDurationPillSheet, after: updatedToRestDurationPillSheet, @@ -313,8 +282,7 @@ class ChangeRestDuration { case PillSheetModifiedActionType.changedRestDuration: batchSetPillSheetModifiedHistory( batch, - PillSheetModifiedHistoryServiceActionFactory - .createChangedRestDurationAction( + PillSheetModifiedHistoryServiceActionFactory.createChangedRestDurationAction( pillSheetGroupID: pillSheetGroup.id, before: fromRestDurationPillSheet, after: updatedToRestDurationPillSheet, diff --git a/lib/features/record/components/setting/sheet.dart b/lib/features/record/components/setting/sheet.dart index 78e9984d96..9dbb827d8d 100644 --- a/lib/features/record/components/setting/sheet.dart +++ b/lib/features/record/components/setting/sheet.dart @@ -94,8 +94,7 @@ class PillSheetSettingSheet extends HookConsumerWidget { } } -void showPillSheetSettingSheet( - BuildContext context, PillSheetSettingSheet sheet) { +void showPillSheetSettingSheet(BuildContext context, PillSheetSettingSheet sheet) { showModalBottomSheet( context: context, backgroundColor: Colors.transparent, diff --git a/lib/features/record/record_page.dart b/lib/features/record/record_page.dart index c85bc6684b..7808faa599 100644 --- a/lib/features/record/record_page.dart +++ b/lib/features/record/record_page.dart @@ -92,9 +92,7 @@ class RecordPageBody extends HookConsumerWidget { ), ), body: Builder(builder: (context) { - if (activePillSheet == null || - pillSheetGroup == null || - pillSheetGroup.isDeactived) { + if (activePillSheet == null || pillSheetGroup == null || pillSheetGroup.isDeactived) { return Column( children: [ Expanded( diff --git a/lib/features/record/util/request_in_app_review.dart b/lib/features/record/util/request_in_app_review.dart index f9399d451f..9640f0c373 100644 --- a/lib/features/record/util/request_in_app_review.dart +++ b/lib/features/record/util/request_in_app_review.dart @@ -5,12 +5,10 @@ import 'package:shared_preferences/shared_preferences.dart'; void requestInAppReview() async { final sharedPreferences = await SharedPreferences.getInstance(); - int count = - sharedPreferences.getInt(IntKey.totalCountOfActionForTakenPill) ?? 0; + int count = sharedPreferences.getInt(IntKey.totalCountOfActionForTakenPill) ?? 0; sharedPreferences.setInt(IntKey.totalCountOfActionForTakenPill, count + 1); - final isGoodAnswer = - sharedPreferences.getBool(BoolKey.isPreStoreReviewGoodAnswer) ?? false; + final isGoodAnswer = sharedPreferences.getBool(BoolKey.isPreStoreReviewGoodAnswer) ?? false; if (!isGoodAnswer) { return; } diff --git a/lib/features/release_note/release_note.dart b/lib/features/release_note/release_note.dart index 808e87b6dc..5b93a4fcf6 100644 --- a/lib/features/release_note/release_note.dart +++ b/lib/features/release_note/release_note.dart @@ -40,8 +40,7 @@ class ReleaseNote extends StatelessWidget { Align( alignment: Alignment.center, child: Container( - padding: - const EdgeInsets.only(top: 40, left: 40, right: 40), + padding: const EdgeInsets.only(top: 40, left: 40, right: 40), child: const Text( "表示モード服用日数(周期)が追加されました", style: TextStyle( @@ -113,7 +112,5 @@ void showReleaseNotePreDialog(BuildContext context) async { } void openReleaseNote() async { - launchUrl( - Uri.parse("https://pilll.wraptas.site/b265e214877f432f9e7f62807c280d57"), - mode: LaunchMode.inAppWebView); + launchUrl(Uri.parse("https://pilll.wraptas.site/b265e214877f432f9e7f62807c280d57"), mode: LaunchMode.inAppWebView); } diff --git a/lib/features/reminder_notification_customize_word/components/daily_taken_message_text_field.dart b/lib/features/reminder_notification_customize_word/components/daily_taken_message_text_field.dart index 9aed011c10..af9992145f 100644 --- a/lib/features/reminder_notification_customize_word/components/daily_taken_message_text_field.dart +++ b/lib/features/reminder_notification_customize_word/components/daily_taken_message_text_field.dart @@ -35,21 +35,13 @@ class DailyTakenMessageTextField extends StatelessWidget { counter: Row(children: [ const Text( "飲み忘れていない場合の通知文言を変更できます", - style: TextStyle( - fontFamily: FontFamily.japanese, - fontSize: 12, - fontWeight: FontWeight.w400, - color: TextColor.darkGray), + style: TextStyle(fontFamily: FontFamily.japanese, fontSize: 12, fontWeight: FontWeight.w400, color: TextColor.darkGray), ), const Spacer(), if (dailyTakenMessage.value.characters.isNotEmpty) Text( "${dailyTakenMessage.value.characters.length}/100", - style: const TextStyle( - fontFamily: FontFamily.japanese, - fontSize: 12, - fontWeight: FontWeight.w400, - color: TextColor.darkGray), + style: const TextStyle(fontFamily: FontFamily.japanese, fontSize: 12, fontWeight: FontWeight.w400, color: TextColor.darkGray), ), ]), ), diff --git a/lib/features/reminder_notification_customize_word/components/missed_taken_message_text_field.dart b/lib/features/reminder_notification_customize_word/components/missed_taken_message_text_field.dart index 027e8209bb..a8a338211e 100644 --- a/lib/features/reminder_notification_customize_word/components/missed_taken_message_text_field.dart +++ b/lib/features/reminder_notification_customize_word/components/missed_taken_message_text_field.dart @@ -35,21 +35,13 @@ class MissedTakenMessageTextField extends StatelessWidget { counter: Row(children: [ const Text( "飲み忘れてる場合の通知文言を変更できます", - style: TextStyle( - fontFamily: FontFamily.japanese, - fontSize: 12, - fontWeight: FontWeight.w400, - color: TextColor.darkGray), + style: TextStyle(fontFamily: FontFamily.japanese, fontSize: 12, fontWeight: FontWeight.w400, color: TextColor.darkGray), ), const Spacer(), if (missedTakenMessage.value.characters.isNotEmpty) Text( "${missedTakenMessage.value.characters.length}/100", - style: const TextStyle( - fontFamily: FontFamily.japanese, - fontSize: 12, - fontWeight: FontWeight.w400, - color: TextColor.darkGray), + style: const TextStyle(fontFamily: FontFamily.japanese, fontSize: 12, fontWeight: FontWeight.w400, color: TextColor.darkGray), ), ]), ), diff --git a/lib/features/reminder_notification_customize_word/components/word_text_field.dart b/lib/features/reminder_notification_customize_word/components/word_text_field.dart index 89fb0253c6..aaa851008c 100644 --- a/lib/features/reminder_notification_customize_word/components/word_text_field.dart +++ b/lib/features/reminder_notification_customize_word/components/word_text_field.dart @@ -28,30 +28,18 @@ class WordTextField extends StatelessWidget { counter: Row(children: [ const Text( "通知の先頭部分の変更ができます", - style: TextStyle( - fontFamily: FontFamily.japanese, - fontSize: 12, - fontWeight: FontWeight.w400, - color: TextColor.darkGray), + style: TextStyle(fontFamily: FontFamily.japanese, fontSize: 12, fontWeight: FontWeight.w400, color: TextColor.darkGray), ), const Spacer(), if (word.value.characters.isNotEmpty) Text( "${word.value.characters.length}/8", - style: const TextStyle( - fontFamily: FontFamily.japanese, - fontSize: 12, - fontWeight: FontWeight.w400, - color: TextColor.darkGray), + style: const TextStyle(fontFamily: FontFamily.japanese, fontSize: 12, fontWeight: FontWeight.w400, color: TextColor.darkGray), ), if (word.value.characters.isEmpty) const Text( "0文字以上入力してください", - style: TextStyle( - fontFamily: FontFamily.japanese, - fontSize: 12, - fontWeight: FontWeight.w400, - color: TextColor.danger), + style: TextStyle(fontFamily: FontFamily.japanese, fontSize: 12, fontWeight: FontWeight.w400, color: TextColor.danger), ), ]), ), diff --git a/lib/features/reminder_notification_customize_word/page.dart b/lib/features/reminder_notification_customize_word/page.dart index 3783a311fa..a8ffc364c4 100644 --- a/lib/features/reminder_notification_customize_word/page.dart +++ b/lib/features/reminder_notification_customize_word/page.dart @@ -25,42 +25,29 @@ class ReminderNotificationCustomizeWordPage extends HookConsumerWidget { final setting = ref.watch(settingProvider).requireValue; final word = useState(setting.reminderNotificationCustomization.word); - final dailyTakenMessage = - useState(setting.reminderNotificationCustomization.dailyTakenMessage); - final missedTakenMessage = - useState(setting.reminderNotificationCustomization.missedTakenMessage); - final wordTextFieldController = useTextEditingController( - text: setting.reminderNotificationCustomization.word); - final dailyTakenMessageTextFieldController = useTextEditingController( - text: setting.reminderNotificationCustomization.dailyTakenMessage); - final missedTakenMessageTextFieldController = useTextEditingController( - text: setting.reminderNotificationCustomization.missedTakenMessage); + final dailyTakenMessage = useState(setting.reminderNotificationCustomization.dailyTakenMessage); + final missedTakenMessage = useState(setting.reminderNotificationCustomization.missedTakenMessage); + final wordTextFieldController = useTextEditingController(text: setting.reminderNotificationCustomization.word); + final dailyTakenMessageTextFieldController = useTextEditingController(text: setting.reminderNotificationCustomization.dailyTakenMessage); + final missedTakenMessageTextFieldController = useTextEditingController(text: setting.reminderNotificationCustomization.missedTakenMessage); final wordFocusNode = useFocusNode(); final dailyTakenMessageFocusNode = useFocusNode(); final missedTakenMessageFocusNode = useFocusNode(); - final isInVisibleReminderDate = useState( - setting.reminderNotificationCustomization.isInVisibleReminderDate); - final isInVisiblePillNumber = useState( - setting.reminderNotificationCustomization.isInVisiblePillNumber); - final isInVisibleDescription = useState( - setting.reminderNotificationCustomization.isInVisibleDescription); + final isInVisibleReminderDate = useState(setting.reminderNotificationCustomization.isInVisibleReminderDate); + final isInVisiblePillNumber = useState(setting.reminderNotificationCustomization.isInVisiblePillNumber); + final isInVisibleDescription = useState(setting.reminderNotificationCustomization.isInVisibleDescription); - final registerReminderLocalNotification = - ref.watch(registerReminderLocalNotificationProvider); + final registerReminderLocalNotification = ref.watch(registerReminderLocalNotificationProvider); void wordSubmit() async { try { analytics.logEvent(name: "submit_rnc_word"); - var reminderNotificationCustomization = - setting.reminderNotificationCustomization; - reminderNotificationCustomization = - reminderNotificationCustomization.copyWith(word: word.value); + var reminderNotificationCustomization = setting.reminderNotificationCustomization; + reminderNotificationCustomization = reminderNotificationCustomization.copyWith(word: word.value); - await setSetting(setting.copyWith( - reminderNotificationCustomization: - reminderNotificationCustomization)); + await setSetting(setting.copyWith(reminderNotificationCustomization: reminderNotificationCustomization)); await registerReminderLocalNotification(); wordFocusNode.unfocus(); @@ -73,14 +60,10 @@ class ReminderNotificationCustomizeWordPage extends HookConsumerWidget { try { analytics.logEvent(name: "submit_rnc_daily_message"); - var reminderNotificationCustomization = - setting.reminderNotificationCustomization; - reminderNotificationCustomization = reminderNotificationCustomization - .copyWith(dailyTakenMessage: dailyTakenMessage.value); + var reminderNotificationCustomization = setting.reminderNotificationCustomization; + reminderNotificationCustomization = reminderNotificationCustomization.copyWith(dailyTakenMessage: dailyTakenMessage.value); - setSetting(setting.copyWith( - reminderNotificationCustomization: - reminderNotificationCustomization)); + setSetting(setting.copyWith(reminderNotificationCustomization: reminderNotificationCustomization)); registerReminderLocalNotification(); dailyTakenMessageFocusNode.unfocus(); @@ -93,14 +76,10 @@ class ReminderNotificationCustomizeWordPage extends HookConsumerWidget { try { analytics.logEvent(name: "submit_rnc_missed_message"); - var reminderNotificationCustomization = - setting.reminderNotificationCustomization; - reminderNotificationCustomization = reminderNotificationCustomization - .copyWith(missedTakenMessage: missedTakenMessage.value); + var reminderNotificationCustomization = setting.reminderNotificationCustomization; + reminderNotificationCustomization = reminderNotificationCustomization.copyWith(missedTakenMessage: missedTakenMessage.value); - setSetting(setting.copyWith( - reminderNotificationCustomization: - reminderNotificationCustomization)); + setSetting(setting.copyWith(reminderNotificationCustomization: reminderNotificationCustomization)); registerReminderLocalNotification(); missedTakenMessageFocusNode.unfocus(); @@ -131,8 +110,7 @@ class ReminderNotificationCustomizeWordPage extends HookConsumerWidget { child: ListView( children: [ Container( - padding: const EdgeInsets.symmetric( - vertical: 20, horizontal: 16), + padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -165,12 +143,9 @@ class ReminderNotificationCustomizeWordPage extends HookConsumerWidget { ReminderPushNotificationPreview( word: word.value, message: dailyTakenMessage.value, - isInVisibleReminderDate: - isInVisibleReminderDate.value, - isInvisiblePillNumber: - isInVisiblePillNumber.value, - isInvisibleDescription: - isInVisibleDescription.value, + isInVisibleReminderDate: isInVisibleReminderDate.value, + isInvisiblePillNumber: isInVisiblePillNumber.value, + isInvisibleDescription: isInVisibleDescription.value, ), ], ), @@ -191,12 +166,9 @@ class ReminderNotificationCustomizeWordPage extends HookConsumerWidget { ReminderPushNotificationPreview( word: word.value, message: missedTakenMessage.value, - isInVisibleReminderDate: - isInVisibleReminderDate.value, - isInvisiblePillNumber: - isInVisiblePillNumber.value, - isInvisibleDescription: - isInVisibleDescription.value, + isInVisibleReminderDate: isInVisibleReminderDate.value, + isInvisiblePillNumber: isInVisiblePillNumber.value, + isInvisibleDescription: isInVisibleDescription.value, ), ], ), @@ -238,15 +210,13 @@ class ReminderNotificationCustomizeWordPage extends HookConsumerWidget { ), DailyTakenMessageTextField( dailyTakenMessage: dailyTakenMessage, - textFieldController: - dailyTakenMessageTextFieldController, + textFieldController: dailyTakenMessageTextFieldController, focusNode: dailyTakenMessageFocusNode, ), const SizedBox(height: 10), MissedTakenMessageTextField( missedTakenMessage: missedTakenMessage, - textFieldController: - missedTakenMessageTextFieldController, + textFieldController: missedTakenMessageTextFieldController, focusNode: missedTakenMessageFocusNode, ), ], @@ -269,20 +239,17 @@ class ReminderNotificationCustomizeWordPage extends HookConsumerWidget { "日付を表示", !isInVisibleReminderDate.value, (value) async { - analytics.logEvent( - name: "change_reminder_notification_date"); + analytics.logEvent(name: "change_reminder_notification_date"); try { await _setIsInVisibleReminderDate( isInVisibleReminderDate: !value, setting: setting, setSetting: setSetting, - registerReminderLocalNotification: - registerReminderLocalNotification, + registerReminderLocalNotification: registerReminderLocalNotification, ); isInVisibleReminderDate.value = !value; } catch (error) { - if (context.mounted) - showErrorAlert(context, error); + if (context.mounted) showErrorAlert(context, error); } }, ), @@ -291,21 +258,17 @@ class ReminderNotificationCustomizeWordPage extends HookConsumerWidget { "番号を表示", !isInVisiblePillNumber.value, (value) async { - analytics.logEvent( - name: - "change_reminder_notification_number"); + analytics.logEvent(name: "change_reminder_notification_number"); try { await _setIsInVisiblePillNumber( isInVisiblePillNumber: !value, setting: setting, setSetting: setSetting, - registerReminderLocalNotification: - registerReminderLocalNotification, + registerReminderLocalNotification: registerReminderLocalNotification, ); isInVisiblePillNumber.value = !value; } catch (error) { - if (context.mounted) - showErrorAlert(context, error); + if (context.mounted) showErrorAlert(context, error); } }, ), @@ -314,20 +277,17 @@ class ReminderNotificationCustomizeWordPage extends HookConsumerWidget { "説明文の表示", !isInVisibleDescription.value, (value) async { - analytics.logEvent( - name: "change_reminder_notification_desc"); + analytics.logEvent(name: "change_reminder_notification_desc"); try { await _setIsInVisibleDescription( isInVisibleDescription: !value, setting: setting, setSetting: setSetting, - registerReminderLocalNotification: - registerReminderLocalNotification, + registerReminderLocalNotification: registerReminderLocalNotification, ); isInVisibleDescription.value = !value; } catch (error) { - if (context.mounted) - showErrorAlert(context, error); + if (context.mounted) showErrorAlert(context, error); } }, ), @@ -382,8 +342,7 @@ class ReminderNotificationCustomizeWordPage extends HookConsumerWidget { ); } - Widget _switchRow( - String title, bool initialValue, ValueChanged onChanged) { + Widget _switchRow(String title, bool initialValue, ValueChanged onChanged) { return Container( padding: const EdgeInsets.symmetric(vertical: 2), child: Row( @@ -411,16 +370,12 @@ class ReminderNotificationCustomizeWordPage extends HookConsumerWidget { required bool isInVisibleReminderDate, required Setting setting, required SetSetting setSetting, - required RegisterReminderLocalNotification - registerReminderLocalNotification, + required RegisterReminderLocalNotification registerReminderLocalNotification, }) async { - var reminderNotificationCustomization = - setting.reminderNotificationCustomization; - reminderNotificationCustomization = reminderNotificationCustomization - .copyWith(isInVisibleReminderDate: isInVisibleReminderDate); + var reminderNotificationCustomization = setting.reminderNotificationCustomization; + reminderNotificationCustomization = reminderNotificationCustomization.copyWith(isInVisibleReminderDate: isInVisibleReminderDate); - setSetting(setting.copyWith( - reminderNotificationCustomization: reminderNotificationCustomization)); + setSetting(setting.copyWith(reminderNotificationCustomization: reminderNotificationCustomization)); registerReminderLocalNotification(); } @@ -428,16 +383,12 @@ class ReminderNotificationCustomizeWordPage extends HookConsumerWidget { required bool isInVisiblePillNumber, required Setting setting, required SetSetting setSetting, - required RegisterReminderLocalNotification - registerReminderLocalNotification, + required RegisterReminderLocalNotification registerReminderLocalNotification, }) async { - var reminderNotificationCustomization = - setting.reminderNotificationCustomization; - reminderNotificationCustomization = reminderNotificationCustomization - .copyWith(isInVisiblePillNumber: isInVisiblePillNumber); + var reminderNotificationCustomization = setting.reminderNotificationCustomization; + reminderNotificationCustomization = reminderNotificationCustomization.copyWith(isInVisiblePillNumber: isInVisiblePillNumber); - setSetting(setting.copyWith( - reminderNotificationCustomization: reminderNotificationCustomization)); + setSetting(setting.copyWith(reminderNotificationCustomization: reminderNotificationCustomization)); registerReminderLocalNotification(); } @@ -445,26 +396,20 @@ class ReminderNotificationCustomizeWordPage extends HookConsumerWidget { required bool isInVisibleDescription, required Setting setting, required SetSetting setSetting, - required RegisterReminderLocalNotification - registerReminderLocalNotification, + required RegisterReminderLocalNotification registerReminderLocalNotification, }) async { - var reminderNotificationCustomization = - setting.reminderNotificationCustomization; - reminderNotificationCustomization = reminderNotificationCustomization - .copyWith(isInVisibleDescription: isInVisibleDescription); + var reminderNotificationCustomization = setting.reminderNotificationCustomization; + reminderNotificationCustomization = reminderNotificationCustomization.copyWith(isInVisibleDescription: isInVisibleDescription); - await setSetting(setting.copyWith( - reminderNotificationCustomization: reminderNotificationCustomization)); + await setSetting(setting.copyWith(reminderNotificationCustomization: reminderNotificationCustomization)); await registerReminderLocalNotification(); } } -extension ReminderNotificationCustomizeWordPageRoutes - on ReminderNotificationCustomizeWordPage { +extension ReminderNotificationCustomizeWordPageRoutes on ReminderNotificationCustomizeWordPage { static Route route() { return MaterialPageRoute( - settings: - const RouteSettings(name: "ReminderNotificationCustomizeWordPage"), + settings: const RouteSettings(name: "ReminderNotificationCustomizeWordPage"), builder: (_) => const ReminderNotificationCustomizeWordPage(), ); } diff --git a/lib/features/root/resolver/force_update.dart b/lib/features/root/resolver/force_update.dart index 91efda08a4..9c21171f5b 100644 --- a/lib/features/root/resolver/force_update.dart +++ b/lib/features/root/resolver/force_update.dart @@ -54,11 +54,7 @@ class ForceUpdate extends HookConsumerWidget { // For force update if (shouldForceUpdate.value) { Future.microtask(() async { - await showOKDialog(context, - title: "アプリをアップデートしてください", - message: - "お使いのアプリのバージョンのアップデートをお願いしております。$storeNameから最新バージョンにアップデートしてください", - ok: () async { + await showOKDialog(context, title: "アプリをアップデートしてください", message: "お使いのアプリのバージョンのアップデートをお願いしております。$storeNameから最新バージョンにアップデートしてください", ok: () async { await launchUrl( Uri.parse(forceUpdateStoreURL), mode: LaunchMode.externalApplication, diff --git a/lib/features/root/resolver/initial_setting_or_app_page.dart b/lib/features/root/resolver/initial_setting_or_app_page.dart index a16303cec3..4e0d2bba6f 100644 --- a/lib/features/root/resolver/initial_setting_or_app_page.dart +++ b/lib/features/root/resolver/initial_setting_or_app_page.dart @@ -12,8 +12,7 @@ import 'package:pilll/utils/shared_preference/keys.dart'; import 'package:flutter/material.dart'; // FIXME: test 時にboolSharedPreferencesProviderをそのまま使うとフリーズする。 => riverpod_generatorで書き換えたりしたのでもうしない可能性はある -final didEndInitialSettingProvider = Provider.autoDispose((ref) => - ref.watch(boolSharedPreferencesProvider(BoolKey.didEndInitialSetting))); +final didEndInitialSettingProvider = Provider.autoDispose((ref) => ref.watch(boolSharedPreferencesProvider(BoolKey.didEndInitialSetting))); enum InitialSettingOrAppPageScreenType { initialSetting, app } @@ -35,14 +34,12 @@ class InitialSettingOrAppPage extends HookConsumerWidget { // UserSetupPageでUserはできているのでfetchが終わり次第値は必ず入る。ここでwatchしないとInitialSetting -> Appへの遷移が成立しない final user = ref.watch(userProvider).valueOrNull; final error = useState(null); - final screenType = retrieveScreenType( - user: user, didEndInitialSetting: didEndInitialSetting.value); + final screenType = retrieveScreenType(user: user, didEndInitialSetting: didEndInitialSetting.value); useEffect(() { if (user != null) { if (user.setting == null) { - analytics.logEvent( - name: "uset_setting_is_null", parameters: {"uid": user.id}); + analytics.logEvent(name: "uset_setting_is_null", parameters: {"uid": user.id}); } } diff --git a/lib/features/root/resolver/migration20240819.dart b/lib/features/root/resolver/migration20240819.dart index 1290799978..7c602dcd7e 100644 --- a/lib/features/root/resolver/migration20240819.dart +++ b/lib/features/root/resolver/migration20240819.dart @@ -8,23 +8,19 @@ import 'package:pilll/provider/setting.dart'; import 'package:pilll/provider/typed_shared_preferences.dart'; import 'package:pilll/utils/shared_preference/keys.dart'; -final migration20240819Provider = Provider.autoDispose((ref) => - ref.watch(boolSharedPreferencesProvider(BoolKey.migration20240819))); -final migration20240819NotifierProvider = Provider.autoDispose((ref) => ref - .watch(boolSharedPreferencesProvider(BoolKey.migration20240819).notifier)); +final migration20240819Provider = Provider.autoDispose((ref) => ref.watch(boolSharedPreferencesProvider(BoolKey.migration20240819))); +final migration20240819NotifierProvider = Provider.autoDispose((ref) => ref.watch(boolSharedPreferencesProvider(BoolKey.migration20240819).notifier)); class Migration20240819 extends HookConsumerWidget { const Migration20240819({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { - final latestPillSheetGroup = - ref.watch(latestPillSheetGroupProvider).asData?.value; + final latestPillSheetGroup = ref.watch(latestPillSheetGroupProvider).asData?.value; final setting = ref.watch(settingProvider).asData?.value; final database = ref.watch(databaseProvider); final migration20240819 = ref.watch(migration20240819Provider); - final migration20240819Notifier = - ref.watch(migration20240819NotifierProvider); + final migration20240819Notifier = ref.watch(migration20240819NotifierProvider); useEffect(() { Future f() async { diff --git a/lib/features/root/resolver/pill_sheet_appearance_mode_migration.dart b/lib/features/root/resolver/pill_sheet_appearance_mode_migration.dart index b8ad5c5d4a..cd45a345ff 100644 --- a/lib/features/root/resolver/pill_sheet_appearance_mode_migration.dart +++ b/lib/features/root/resolver/pill_sheet_appearance_mode_migration.dart @@ -45,10 +45,7 @@ class PillSheetAppearanceModeMigrationResolver extends HookConsumerWidget { }); f(); return null; - }, [ - latestPillSheetGroup.asData?.value != null, - setting.asData?.value != null - ]); + }, [latestPillSheetGroup.asData?.value != null, setting.asData?.value != null]); if (resolved.value) { return builder(context); diff --git a/lib/features/root/resolver/show_paywall_on_app_launch.dart b/lib/features/root/resolver/show_paywall_on_app_launch.dart index a0a3e33201..aed833b57a 100644 --- a/lib/features/root/resolver/show_paywall_on_app_launch.dart +++ b/lib/features/root/resolver/show_paywall_on_app_launch.dart @@ -17,11 +17,8 @@ class ShowPaywallOnAppLaunch extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final remoteConfigParameter = ref.watch(remoteConfigParameterProvider); - final shownPaywallWhenAppFirstLaunch = ref.watch( - boolSharedPreferencesProvider(BoolKey.shownPaywallWhenAppFirstLaunch)); - final shownPaywallWhenAppFirstLaunchNotifier = ref.watch( - boolSharedPreferencesProvider(BoolKey.shownPaywallWhenAppFirstLaunch) - .notifier); + final shownPaywallWhenAppFirstLaunch = ref.watch(boolSharedPreferencesProvider(BoolKey.shownPaywallWhenAppFirstLaunch)); + final shownPaywallWhenAppFirstLaunchNotifier = ref.watch(boolSharedPreferencesProvider(BoolKey.shownPaywallWhenAppFirstLaunch).notifier); if (!remoteConfigParameter.isPaywallFirst) { return builder(context); } diff --git a/lib/features/root/resolver/sync_data.dart b/lib/features/root/resolver/sync_data.dart index be46fe8933..60d538c744 100644 --- a/lib/features/root/resolver/sync_data.dart +++ b/lib/features/root/resolver/sync_data.dart @@ -55,8 +55,7 @@ class SyncDataResolver extends HookConsumerWidget { return; } try { - syncActivePillSheetValue( - pillSheetGroup: latestPillSheetGroup.asData?.value); + syncActivePillSheetValue(pillSheetGroup: latestPillSheetGroup.asData?.value); } catch (error) { debugPrint(error.toString()); } diff --git a/lib/features/root/resolver/user_setup.dart b/lib/features/root/resolver/user_setup.dart index 0aac6cf64c..7406609aec 100644 --- a/lib/features/root/resolver/user_setup.dart +++ b/lib/features/root/resolver/user_setup.dart @@ -47,8 +47,7 @@ class UserSetup extends HookConsumerWidget { } } catch (e, st) { errorLogger.recordError(e, st); - error.value = LaunchException( - "起動時にエラーが発生しました\n${ErrorMessages.connection}\n詳細:", e); + error.value = LaunchException("起動時にエラーが発生しました\n${ErrorMessages.connection}\n詳細:", e); } // **** END: Do not break the sequence. **** } diff --git a/lib/features/root/root_page.dart b/lib/features/root/root_page.dart index bdd592a1b4..b4e94cb0b6 100644 --- a/lib/features/root/root_page.dart +++ b/lib/features/root/root_page.dart @@ -25,24 +25,19 @@ class RootPage extends HookConsumerWidget { userID: user.uid, builder: (_) => Stack( children: [ - UserStreamResolver( - stream: (user) => - analyticsDebugIsEnabled = user.analyticsDebugIsEnabled), + UserStreamResolver(stream: (user) => analyticsDebugIsEnabled = user.analyticsDebugIsEnabled), const SyncDataResolver(), const Migration20240819(), InitialSettingOrAppPage( initialSettingPageBuilder: (_) => ShowPaywallOnAppLaunch( builder: (_) => SkipInitialSetting( - initialSettingPageBuilder: (context) => - InitialSettingPillSheetGroupPageRoute.screen(), - homePageBuilder: (_) => - PillSheetAppearanceModeMigrationResolver( + initialSettingPageBuilder: (context) => InitialSettingPillSheetGroupPageRoute.screen(), + homePageBuilder: (_) => PillSheetAppearanceModeMigrationResolver( builder: (_) => const HomePage(), ), ), ), - homePageBuilder: (_) => - PillSheetAppearanceModeMigrationResolver( + homePageBuilder: (_) => PillSheetAppearanceModeMigrationResolver( builder: (_) => const HomePage(), ), ), diff --git a/lib/features/schedule_post/schedule_post_page.dart b/lib/features/schedule_post/schedule_post_page.dart index afd2b7aa24..5d5ffbfbf3 100644 --- a/lib/features/schedule_post/schedule_post_page.dart +++ b/lib/features/schedule_post/schedule_post_page.dart @@ -32,18 +32,11 @@ class SchedulePostPage extends HookConsumerWidget { const SchedulePostPage({super.key, required this.date}); @override Widget build(BuildContext context, WidgetRef ref) { - return AsyncValueGroup.group2( - ref.watch(userProvider), ref.watch(schedulesForDateProvider(date))) - .when( + return AsyncValueGroup.group2(ref.watch(userProvider), ref.watch(schedulesForDateProvider(date))).when( data: (data) => _SchedulePostPage( date: date, user: data.$1, - schedule: data.$2.firstOrNull ?? - Schedule( - title: "", - localNotification: null, - date: date, - createdDateTime: DateTime.now()), + schedule: data.$2.firstOrNull ?? Schedule(title: "", localNotification: null, date: date, createdDateTime: DateTime.now()), ), error: (error, _) => UniversalErrorPage( error: error, @@ -170,11 +163,9 @@ class _SchedulePostPage extends HookConsumerWidget { final navigator = Navigator.of(context); try { - final localNotificationID = - schedule.localNotification?.localNotificationID; + final localNotificationID = schedule.localNotification?.localNotificationID; if (localNotificationID != null) { - await localNotificationService.cancelNotification( - localNotificationID: localNotificationID); + await localNotificationService.cancelNotification(localNotificationID: localNotificationID); } final Schedule newSchedule; @@ -182,15 +173,11 @@ class _SchedulePostPage extends HookConsumerWidget { newSchedule = schedule.copyWith( title: title.value, localNotification: LocalNotification( - localNotificationID: Random().nextInt( - scheduleNotificationIdentifierOffset), - remindDateTime: DateTime( - date.year, date.month, date.day, 9), + localNotificationID: Random().nextInt(scheduleNotificationIdentifierOffset), + remindDateTime: DateTime(date.year, date.month, date.day, 9), ), ); - await localNotificationService - .scheduleCalendarScheduleNotification( - schedule: newSchedule); + await localNotificationService.scheduleCalendarScheduleNotification(schedule: newSchedule); } else { newSchedule = schedule.copyWith( title: title.value, @@ -198,11 +185,7 @@ class _SchedulePostPage extends HookConsumerWidget { ); } - await ref - .read(databaseProvider) - .schedulesReference() - .doc(newSchedule.id) - .set( + await ref.read(databaseProvider).schedulesReference().doc(newSchedule.id).set( newSchedule, SetOptions(merge: true), ); @@ -235,24 +218,15 @@ class _SchedulePostPage extends HookConsumerWidget { onPressed: () async { final navigator = Navigator.of(context); try { - final localNotificationID = schedule - .localNotification?.localNotificationID; + final localNotificationID = schedule.localNotification?.localNotificationID; if (localNotificationID != null) { - await localNotificationService - .cancelNotification( - localNotificationID: - localNotificationID); + await localNotificationService.cancelNotification(localNotificationID: localNotificationID); } - await ref - .read(databaseProvider) - .schedulesReference() - .doc(scheduleID) - .delete(); + await ref.read(databaseProvider).schedulesReference().doc(scheduleID).delete(); navigator.popUntil((route) => route.isFirst); } catch (error) { - if (context.mounted) - showErrorAlert(context, error); + if (context.mounted) showErrorAlert(context, error); } }, ), diff --git a/lib/features/settings/components/churn/churn_survey_complete_dialog.dart b/lib/features/settings/components/churn/churn_survey_complete_dialog.dart index de7239d5c5..4e292ee19c 100644 --- a/lib/features/settings/components/churn/churn_survey_complete_dialog.dart +++ b/lib/features/settings/components/churn/churn_survey_complete_dialog.dart @@ -12,8 +12,7 @@ class ChurnSurveyCompleteDialog extends StatelessWidget { @override Widget build(BuildContext context) { return AlertDialog( - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(20.0))), + shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(20.0))), title: const Text( "ご協力頂きありがとうございます", style: TextStyle( diff --git a/lib/features/settings/components/inquiry/inquiry.dart b/lib/features/settings/components/inquiry/inquiry.dart index 95f869f54a..9144dfa177 100644 --- a/lib/features/settings/components/inquiry/inquiry.dart +++ b/lib/features/settings/components/inquiry/inquiry.dart @@ -15,9 +15,7 @@ import '../../../../entity/user.codegen.dart'; void inquiry() { PackageInfo.fromPlatform().then((value) => debugInfo(", ")).then((info) { - launchUrl( - Uri.parse(Uri.encodeFull( - "https://docs.google.com/forms/d/e/1FAIpQLSddEpE641jIKEL9cxgiKaRytmBtsP7PXnDdXonEyE-n62JMWQ/viewform?usp=pp_url&entry.2066946565=$info")), + launchUrl(Uri.parse(Uri.encodeFull("https://docs.google.com/forms/d/e/1FAIpQLSddEpE641jIKEL9cxgiKaRytmBtsP7PXnDdXonEyE-n62JMWQ/viewform?usp=pp_url&entry.2066946565=$info")), mode: LaunchMode.inAppWebView); }); } @@ -26,8 +24,7 @@ Future debugInfo(String separator) async { final userID = auth.FirebaseAuth.instance.currentUser?.uid; if (userID == null) { final sharedPreferences = await SharedPreferences.getInstance(); - return Future.value( - "DEBUG INFO user is not found. lastest last login id ${sharedPreferences.getString(StringKey.lastSignInAnonymousUID)}"); + return Future.value("DEBUG INFO user is not found. lastest last login id ${sharedPreferences.getString(StringKey.lastSignInAnonymousUID)}"); } DatabaseConnection databaseConnection = DatabaseConnection(userID); @@ -44,10 +41,7 @@ Future debugInfo(String separator) async { Setting? setting; try { - setting = await databaseConnection - .userReference() - .get() - .then((event) => event.data()?.setting); + setting = await databaseConnection.userReference().get().then((event) => event.data()?.setting); } catch (_) {} PackageInfo? package; @@ -64,14 +58,10 @@ Future debugInfo(String separator) async { final Map activedPillSheetDebugInfo = {}; if (activePillSheet != null) { activedPillSheetDebugInfo["id"] = activePillSheet.id; - activedPillSheetDebugInfo["beginingDate"] = - activePillSheet.beginingDate.toIso8601String(); - activedPillSheetDebugInfo["lastTakenDate"] = - activePillSheet.lastTakenDate?.toIso8601String(); - activedPillSheetDebugInfo["createdAt"] = - activePillSheet.createdAt?.toIso8601String(); - activedPillSheetDebugInfo["deletedAt"] = - activePillSheet.deletedAt?.toIso8601String(); + activedPillSheetDebugInfo["beginingDate"] = activePillSheet.beginingDate.toIso8601String(); + activedPillSheetDebugInfo["lastTakenDate"] = activePillSheet.lastTakenDate?.toIso8601String(); + activedPillSheetDebugInfo["createdAt"] = activePillSheet.createdAt?.toIso8601String(); + activedPillSheetDebugInfo["deletedAt"] = activePillSheet.deletedAt?.toIso8601String(); } final contents = [ diff --git a/lib/features/settings/components/rows/about_churn.dart b/lib/features/settings/components/rows/about_churn.dart index 1134c80757..73ebec7a72 100644 --- a/lib/features/settings/components/rows/about_churn.dart +++ b/lib/features/settings/components/rows/about_churn.dart @@ -21,10 +21,7 @@ class AboutChurn extends HookConsumerWidget { name: "did_select_about_churn", ); - launchUrl( - Uri.parse( - "https://pilll.wraptas.site/b10fd76f1d2246d286ad5cff03f22940"), - mode: LaunchMode.inAppWebView); + launchUrl(Uri.parse("https://pilll.wraptas.site/b10fd76f1d2246d286ad5cff03f22940"), mode: LaunchMode.inAppWebView); }, ); } diff --git a/lib/features/settings/components/rows/account_link.dart b/lib/features/settings/components/rows/account_link.dart index 1eb57a4222..8136515fcb 100644 --- a/lib/features/settings/components/rows/account_link.dart +++ b/lib/features/settings/components/rows/account_link.dart @@ -25,8 +25,7 @@ class AccountLinkRow extends HookConsumerWidget { trailing: _subtitle(isAppleLinked || isGoogleLinked), onTap: () { analytics.logEvent(name: "did_select_setting_account_cooperation"); - Navigator.of(context) - .push(SettingAccountCooperationListPageRoute.route()); + Navigator.of(context).push(SettingAccountCooperationListPageRoute.route()); }, ); } diff --git a/lib/features/settings/components/rows/creating_new_pillsheet.dart b/lib/features/settings/components/rows/creating_new_pillsheet.dart index 4b22db8eb1..8dd6140244 100644 --- a/lib/features/settings/components/rows/creating_new_pillsheet.dart +++ b/lib/features/settings/components/rows/creating_new_pillsheet.dart @@ -54,8 +54,7 @@ class CreatingNewPillSheetRow extends HookConsumerWidget { if (isPremium || isTrial) { final messenger = ScaffoldMessenger.of(context); messenger.hideCurrentSnackBar(); - await setSetting( - setting.copyWith(isAutomaticallyCreatePillSheet: value)); + await setSetting(setting.copyWith(isAutomaticallyCreatePillSheet: value)); messenger.showSnackBar(SnackBar( duration: const Duration(seconds: 2), content: Text( diff --git a/lib/features/settings/components/rows/debug_row.dart b/lib/features/settings/components/rows/debug_row.dart index e386dcbdf5..448cfdc104 100644 --- a/lib/features/settings/components/rows/debug_row.dart +++ b/lib/features/settings/components/rows/debug_row.dart @@ -17,9 +17,7 @@ class DebugRow extends StatelessWidget { return Padding( padding: const EdgeInsets.only(left: 10, right: 10, bottom: 20, top: 20), child: GestureDetector( - child: const Center( - child: Text("COPY DEBUG INFO", - style: TextStyle(color: TextColor.primary))), + child: const Center(child: Text("COPY DEBUG INFO", style: TextStyle(color: TextColor.primary))), onTap: () async { Clipboard.setData(ClipboardData(text: await debugInfo("\n"))); }, diff --git a/lib/features/settings/components/rows/health_care.dart b/lib/features/settings/components/rows/health_care.dart index ef815bd5c4..9d3723c556 100644 --- a/lib/features/settings/components/rows/health_care.dart +++ b/lib/features/settings/components/rows/health_care.dart @@ -35,8 +35,7 @@ class HealthCareRow extends StatelessWidget { try { if (await healthKitRequestAuthorizationIsUnnecessary()) { - launchUrl(Uri.parse( - "https://pilll.wraptas.site/9f689858e2a34cf6bc7c08ab85a192cf")); + launchUrl(Uri.parse("https://pilll.wraptas.site/9f689858e2a34cf6bc7c08ab85a192cf")); } else { if (await shouldRequestForAccessToHealthKitData()) { await requestWriteMenstrualFlowHealthKitDataPermission(); diff --git a/lib/features/settings/components/rows/menstruation.dart b/lib/features/settings/components/rows/menstruation.dart index ed763c3f25..901408b87d 100644 --- a/lib/features/settings/components/rows/menstruation.dart +++ b/lib/features/settings/components/rows/menstruation.dart @@ -24,14 +24,10 @@ class MenstruationRow extends HookConsumerWidget { fontSize: 16, )), const SizedBox(width: 8), - if (_hasError) - SvgPicture.asset("images/alert_24.svg", width: 24, height: 24), + if (_hasError) SvgPicture.asset("images/alert_24.svg", width: 24, height: 24), ], ), - subtitle: _hasError - ? const Text( - "生理開始日のピル番号をご確認ください。現在選択しているピルシートタイプには存在しないピル番号が設定されています") - : null, + subtitle: _hasError ? const Text("生理開始日のピル番号をご確認ください。現在選択しているピルシートタイプには存在しないピル番号が設定されています") : null, onTap: () { analytics.logEvent( name: "did_select_changing_about_menstruation", @@ -46,9 +42,7 @@ class MenstruationRow extends HookConsumerWidget { return false; } - final totalCount = setting.pillSheetEnumTypes - .map((e) => e.totalCount) - .reduce((value, element) => value + element); + final totalCount = setting.pillSheetEnumTypes.map((e) => e.totalCount).reduce((value, element) => value + element); return totalCount < setting.pillNumberForFromMenstruation; } } diff --git a/lib/features/settings/components/rows/notification_in_rest_duration.dart b/lib/features/settings/components/rows/notification_in_rest_duration.dart index 83e76f2713..44e856705c 100644 --- a/lib/features/settings/components/rows/notification_in_rest_duration.dart +++ b/lib/features/settings/components/rows/notification_in_rest_duration.dart @@ -22,8 +22,7 @@ class NotificationInRestDuration extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final setSetting = ref.watch(setSettingProvider); - final registerReminderLocalNotification = - ref.watch(registerReminderLocalNotificationProvider); + final registerReminderLocalNotification = ref.watch(registerReminderLocalNotificationProvider); return SwitchListTile( title: Text("${pillSheet.pillSheetType.notTakenWord}期間の通知", @@ -32,8 +31,7 @@ class NotificationInRestDuration extends HookConsumerWidget { fontWeight: FontWeight.w300, fontSize: 16, )), - subtitle: Text( - "通知オフの場合は、${pillSheet.pillSheetType.notTakenWord}期間の服用記録も自動で付けられます", + subtitle: Text("通知オフの場合は、${pillSheet.pillSheetType.notTakenWord}期間の服用記録も自動で付けられます", style: const TextStyle( fontFamily: FontFamily.japanese, fontWeight: FontWeight.w300, diff --git a/lib/features/settings/components/rows/notification_time.dart b/lib/features/settings/components/rows/notification_time.dart index eed9b20cfa..e04e45e4b7 100644 --- a/lib/features/settings/components/rows/notification_time.dart +++ b/lib/features/settings/components/rows/notification_time.dart @@ -21,9 +21,7 @@ class NotificationTimeRow extends StatelessWidget { fontWeight: FontWeight.w300, fontSize: 16, )), - subtitle: Text(setting.reminderTimes - .map((e) => DateTimeFormatter.militaryTime(e.dateTime())) - .join(", ")), + subtitle: Text(setting.reminderTimes.map((e) => DateTimeFormatter.militaryTime(e.dateTime())).join(", ")), onTap: () { analytics.logEvent( name: "did_select_changing_reminder_times", diff --git a/lib/features/settings/components/rows/pill_sheet_remove.dart b/lib/features/settings/components/rows/pill_sheet_remove.dart index 9b7bbc1b22..510cec3269 100644 --- a/lib/features/settings/components/rows/pill_sheet_remove.dart +++ b/lib/features/settings/components/rows/pill_sheet_remove.dart @@ -25,8 +25,7 @@ class PillSheetRemoveRow extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final deletePillSheetGroup = ref.watch(deletePillSheetGroupProvider); - final cancelReminderLocalNotification = - ref.watch(cancelReminderLocalNotificationProvider); + final cancelReminderLocalNotification = ref.watch(cancelReminderLocalNotificationProvider); return ListTile( title: const Text("ピルシートをすべて破棄", style: TextStyle( @@ -88,13 +87,10 @@ class PillSheetRemoveRow extends HookConsumerWidget { text: "破棄する", onPressed: () async { try { - await deletePillSheetGroup( - latestPillSheetGroup: latestPillSheetGroup, - activePillSheet: activePillSheet); + await deletePillSheetGroup(latestPillSheetGroup: latestPillSheetGroup, activePillSheet: activePillSheet); await cancelReminderLocalNotification(); navigatorKey.currentState?.pop(); - ScaffoldMessenger.of(navigatorKey.currentContext!) - .showSnackBar( + ScaffoldMessenger.of(navigatorKey.currentContext!).showSnackBar( const SnackBar( duration: Duration(seconds: 2), content: Text("ピルシートを破棄しました"), diff --git a/lib/features/settings/components/rows/reminder_notification_customize_word.dart b/lib/features/settings/components/rows/reminder_notification_customize_word.dart index ec8dacc72a..0433e6571d 100644 --- a/lib/features/settings/components/rows/reminder_notification_customize_word.dart +++ b/lib/features/settings/components/rows/reminder_notification_customize_word.dart @@ -50,8 +50,7 @@ class ReminderNotificationCustomizeWord extends HookConsumerWidget { name: "did_notification_customize_word", ); if (isTrial || isPremium) { - Navigator.of(context) - .push(ReminderNotificationCustomizeWordPageRoutes.route()); + Navigator.of(context).push(ReminderNotificationCustomizeWordPageRoutes.route()); } else { showPremiumIntroductionSheet(context); } diff --git a/lib/features/settings/components/rows/today_pill_number.dart b/lib/features/settings/components/rows/today_pill_number.dart index 421577dc0e..2e447ec2cf 100644 --- a/lib/features/settings/components/rows/today_pill_number.dart +++ b/lib/features/settings/components/rows/today_pill_number.dart @@ -32,8 +32,7 @@ class TodayPllNumberRow extends HookConsumerWidget { ); } - void _onTap( - BuildContext context, Setting setting, PillSheet activePillSheet) { + void _onTap(BuildContext context, Setting setting, PillSheet activePillSheet) { analytics.logEvent( name: "did_select_changing_pill_number", ); diff --git a/lib/features/settings/components/rows/toggle_reminder_notification.dart b/lib/features/settings/components/rows/toggle_reminder_notification.dart index c905c649c2..0ec095eeea 100644 --- a/lib/features/settings/components/rows/toggle_reminder_notification.dart +++ b/lib/features/settings/components/rows/toggle_reminder_notification.dart @@ -19,10 +19,8 @@ class ToggleReminderNotification extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final setSetting = ref.watch(setSettingProvider); - final registerReminderLocalNotification = - ref.watch(registerReminderLocalNotificationProvider); - final cancelReminderLocalNotification = - ref.watch(cancelReminderLocalNotificationProvider); + final registerReminderLocalNotification = ref.watch(registerReminderLocalNotificationProvider); + final cancelReminderLocalNotification = ref.watch(cancelReminderLocalNotificationProvider); return SwitchListTile( title: const Text("ピルの服用通知", diff --git a/lib/features/settings/components/rows/update_from_132.dart b/lib/features/settings/components/rows/update_from_132.dart index 0158a645a4..c378915dad 100644 --- a/lib/features/settings/components/rows/update_from_132.dart +++ b/lib/features/settings/components/rows/update_from_132.dart @@ -21,10 +21,8 @@ class UpdateFrom132Row extends StatelessWidget { onTap: () { analytics.logEvent(name: "did_select_migrate_132", parameters: {}); SharedPreferences.getInstance().then((storage) { - final salvagedOldStartTakenDate = - storage.getString(StringKey.salvagedOldStartTakenDate); - final salvagedOldLastTakenDate = - storage.getString(StringKey.salvagedOldLastTakenDate); + final salvagedOldStartTakenDate = storage.getString(StringKey.salvagedOldStartTakenDate); + final salvagedOldLastTakenDate = storage.getString(StringKey.salvagedOldLastTakenDate); Navigator.of(context).push(InformationForBeforeMigrate132Route.route( salvagedOldStartTakenDate: salvagedOldStartTakenDate!, salvagedOldLastTakenDate: salvagedOldLastTakenDate!, diff --git a/lib/features/settings/information_for_before_major_update.dart b/lib/features/settings/information_for_before_major_update.dart index a314bf6811..2c68765cab 100644 --- a/lib/features/settings/information_for_before_major_update.dart +++ b/lib/features/settings/information_for_before_major_update.dart @@ -8,10 +8,7 @@ class InformationForBeforeMigrate132 extends StatelessWidget { final String salvagedOldStartTakenDate; final String salvagedOldLastTakenDate; - const InformationForBeforeMigrate132( - {super.key, - required this.salvagedOldStartTakenDate, - required this.salvagedOldLastTakenDate}); + const InformationForBeforeMigrate132({super.key, required this.salvagedOldStartTakenDate, required this.salvagedOldLastTakenDate}); int _latestPillNumber() { final last = DateTime.parse(salvagedOldLastTakenDate); @@ -133,14 +130,10 @@ class InformationForBeforeMigrate132 extends StatelessWidget { } } -extension InformationForBeforeMigrate132Route - on InformationForBeforeMigrate132 { - static Route route( - {required String salvagedOldStartTakenDate, - required String salvagedOldLastTakenDate}) { +extension InformationForBeforeMigrate132Route on InformationForBeforeMigrate132 { + static Route route({required String salvagedOldStartTakenDate, required String salvagedOldLastTakenDate}) { return MaterialPageRoute( - settings: - const RouteSettings(name: "InformationForBeforeMigrate132Route"), + settings: const RouteSettings(name: "InformationForBeforeMigrate132Route"), builder: (_) => InformationForBeforeMigrate132( salvagedOldStartTakenDate: salvagedOldStartTakenDate, salvagedOldLastTakenDate: salvagedOldLastTakenDate, diff --git a/lib/features/settings/menstruation/setting_menstruation_page.dart b/lib/features/settings/menstruation/setting_menstruation_page.dart index ff6e233310..b075e2f950 100644 --- a/lib/features/settings/menstruation/setting_menstruation_page.dart +++ b/lib/features/settings/menstruation/setting_menstruation_page.dart @@ -22,8 +22,7 @@ class SettingMenstruationPage extends HookConsumerWidget { pillSheetTypes: setting.pillSheetEnumTypes, appearanceMode: PillSheetAppearanceMode.sequential, selectedPillNumber: (pageIndex) { - final passedTotalCount = summarizedPillCountWithPillSheetTypesToIndex( - pillSheetTypes: setting.pillSheetEnumTypes, toIndex: pageIndex); + final passedTotalCount = summarizedPillCountWithPillSheetTypesToIndex(pillSheetTypes: setting.pillSheetEnumTypes, toIndex: pageIndex); if (passedTotalCount >= setting.pillNumberForFromMenstruation) { return setting.pillNumberForFromMenstruation; } @@ -38,10 +37,8 @@ class SettingMenstruationPage extends HookConsumerWidget { "number": fromMenstruation, "page": pageIndex, }); - final offset = summarizedPillCountWithPillSheetTypesToIndex( - pillSheetTypes: setting.pillSheetEnumTypes, toIndex: pageIndex); - final updated = setting.copyWith( - pillNumberForFromMenstruation: fromMenstruation + offset); + final offset = summarizedPillCountWithPillSheetTypesToIndex(pillSheetTypes: setting.pillSheetEnumTypes, toIndex: pageIndex); + final updated = setting.copyWith(pillNumberForFromMenstruation: fromMenstruation + offset); await setSetting(updated); }, ), @@ -49,20 +46,14 @@ class SettingMenstruationPage extends HookConsumerWidget { pillSheetTypes: setting.pillSheetEnumTypes, fromMenstruation: setting.pillNumberForFromMenstruation, fromMenstructionDidDecide: (serializedPillNumberIntoGroup) async { - analytics.logEvent( - name: "from_menstruation_initial_setting", - parameters: {"number": serializedPillNumberIntoGroup}); - final updated = setting.copyWith( - pillNumberForFromMenstruation: serializedPillNumberIntoGroup); + analytics.logEvent(name: "from_menstruation_initial_setting", parameters: {"number": serializedPillNumberIntoGroup}); + final updated = setting.copyWith(pillNumberForFromMenstruation: serializedPillNumberIntoGroup); await setSetting(updated); }, durationMenstruation: setting.durationMenstruation, durationMenstructionDidDecide: (durationMenstruation) { - analytics.logEvent( - name: "duration_menstruation_initial_setting", - parameters: {"number": durationMenstruation}); - final updated = - setting.copyWith(durationMenstruation: durationMenstruation); + analytics.logEvent(name: "duration_menstruation_initial_setting", parameters: {"number": durationMenstruation}); + final updated = setting.copyWith(durationMenstruation: durationMenstruation); setSetting(updated); }, ), diff --git a/lib/features/settings/provider.dart b/lib/features/settings/provider.dart index d8b83c2687..72c83ae8d2 100644 --- a/lib/features/settings/provider.dart +++ b/lib/features/settings/provider.dart @@ -2,7 +2,5 @@ import 'package:flutter_native_timezone/flutter_native_timezone.dart'; import 'package:pilll/native/health_care.dart'; import 'package:riverpod/riverpod.dart'; -final isHealthDataAvailableProvider = - FutureProvider((ref) => isHealthDataAvailable()); -final deviceTimezoneNameProvider = - FutureProvider((ref) => FlutterNativeTimezone.getLocalTimezone()); +final isHealthDataAvailableProvider = FutureProvider((ref) => isHealthDataAvailable()); +final deviceTimezoneNameProvider = FutureProvider((ref) => FlutterNativeTimezone.getLocalTimezone()); diff --git a/lib/features/settings/reminder_times_page.dart b/lib/features/settings/reminder_times_page.dart index c0bc8408ae..4efec36f5e 100644 --- a/lib/features/settings/reminder_times_page.dart +++ b/lib/features/settings/reminder_times_page.dart @@ -26,8 +26,7 @@ class ReminderTimesPage extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final setSetting = ref.watch(setSettingProvider); - final registerReminderLocalNotification = - ref.watch(registerReminderLocalNotificationProvider); + final registerReminderLocalNotification = ref.watch(registerReminderLocalNotificationProvider); return AsyncValueGroup.group2( ref.watch(settingProvider), @@ -131,11 +130,7 @@ class ReminderTimesPageBody extends StatelessWidget { color: PilllColors.border, ), ), - _component(context, - setting: setting, - reminderTime: reminderTime, - setSetting: setSetting, - number: offset + 1) + _component(context, setting: setting, reminderTime: reminderTime, setSetting: setSetting, number: offset + 1) ], ), ), @@ -165,8 +160,7 @@ class ReminderTimesPageBody extends StatelessWidget { Widget body = GestureDetector( onTap: () { analytics.logEvent(name: "show_modify_reminder_time"); - _showPicker(context, - setting: setting, setSetting: setSetting, index: number - 1); + _showPicker(context, setting: setting, setSetting: setSetting, index: number - 1); }, child: ListTile( title: Text("通知$number"), @@ -215,16 +209,14 @@ class ReminderTimesPageBody extends StatelessWidget { ); } - Widget _add(BuildContext context, - {required Setting setting, required SetSetting setSetting}) { + Widget _add(BuildContext context, {required Setting setting, required SetSetting setSetting}) { if (setting.reminderTimes.length >= ReminderTime.maximumCount) { return Container(); } return GestureDetector( onTap: () { analytics.logEvent(name: "pressed_add_reminder_time"); - _showPicker(context, - setSetting: setSetting, setting: setting, index: null); + _showPicker(context, setSetting: setSetting, setting: setting, index: null); }, child: SizedBox( height: 64, @@ -258,24 +250,20 @@ class ReminderTimesPageBody extends StatelessWidget { context: context, builder: (BuildContext context) { return TimePicker( - initialDateTime: isEditing - ? setting.reminderTimes[index].dateTime() - : const ReminderTime(hour: 20, minute: 0).dateTime(), + initialDateTime: isEditing ? setting.reminderTimes[index].dateTime() : const ReminderTime(hour: 20, minute: 0).dateTime(), done: (dateTime) { if (isEditing) { analytics.logEvent(name: "edited_reminder_time"); unawaited(_editReminderTime( index: index, - reminderTime: - ReminderTime(hour: dateTime.hour, minute: dateTime.minute), + reminderTime: ReminderTime(hour: dateTime.hour, minute: dateTime.minute), setting: setting, setSetting: setSetting, ).catchError((error) => showErrorAlert(context, error))); } else { analytics.logEvent(name: "added_reminder_time"); unawaited(_addReminderTimes( - reminderTime: - ReminderTime(hour: dateTime.hour, minute: dateTime.minute), + reminderTime: ReminderTime(hour: dateTime.hour, minute: dateTime.minute), setting: setting, setSetting: setSetting, ).catchError((error) => showErrorAlert(context, error))); @@ -295,8 +283,7 @@ class ReminderTimesPageBody extends StatelessWidget { }) async { List copied = [...setting.reminderTimes]; copied.add(reminderTime); - await _modifyReminderTimes( - setting: setting, reminderTimes: copied, setSetting: setSetting); + await _modifyReminderTimes(setting: setting, reminderTimes: copied, setSetting: setSetting); } Future _editReminderTime({ @@ -307,8 +294,7 @@ class ReminderTimesPageBody extends StatelessWidget { }) async { List copied = [...setting.reminderTimes]; copied[index] = reminderTime; - await _modifyReminderTimes( - setting: setting, reminderTimes: copied, setSetting: setSetting); + await _modifyReminderTimes(setting: setting, reminderTimes: copied, setSetting: setSetting); } Future _deleteReminderTimes({ @@ -318,8 +304,7 @@ class ReminderTimesPageBody extends StatelessWidget { }) async { List copied = [...setting.reminderTimes]; copied.removeAt(index); - await _modifyReminderTimes( - setting: setting, reminderTimes: copied, setSetting: setSetting); + await _modifyReminderTimes(setting: setting, reminderTimes: copied, setSetting: setSetting); } Future _modifyReminderTimes({ diff --git a/lib/features/settings/setting_account_list/components/delete_user_button.dart b/lib/features/settings/setting_account_list/components/delete_user_button.dart index 8f0eeecab0..0e2cbf8691 100644 --- a/lib/features/settings/setting_account_list/components/delete_user_button.dart +++ b/lib/features/settings/setting_account_list/components/delete_user_button.dart @@ -23,8 +23,7 @@ class DeleteUserButton extends HookConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final isAppleLinked = ref.watch(isAppleLinkedProvider); final isGoogleLinked = ref.watch(isGoogleLinkedProvider); - final cancelReminderLocalNotification = - ref.watch(cancelReminderLocalNotificationProvider); + final cancelReminderLocalNotification = ref.watch(cancelReminderLocalNotificationProvider); return Container( padding: const EdgeInsets.only(top: 54), child: AlertButton( @@ -105,9 +104,7 @@ class DeleteUserButton extends HookConsumerWidget { } navigator.pop(); // ignore: use_build_context_synchronously - await _delete(context, - isAppleLinked: isAppleLinked, - isGoogleLinked: isGoogleLinked); + await _delete(context, isAppleLinked: isAppleLinked, isGoogleLinked: isGoogleLinked); }, ), ], diff --git a/lib/features/settings/setting_account_list/setting_account_cooperation_list_page.dart b/lib/features/settings/setting_account_list/setting_account_cooperation_list_page.dart index db5e0a477e..4243d84e1d 100644 --- a/lib/features/settings/setting_account_list/setting_account_cooperation_list_page.dart +++ b/lib/features/settings/setting_account_list/setting_account_cooperation_list_page.dart @@ -36,8 +36,7 @@ class SettingAccountCooperationListPage extends HookConsumerWidget { icon: const Icon(Icons.arrow_back, color: Colors.black), onPressed: () => Navigator.of(context).pop(), ), - title: const Text('アカウント設定', - style: TextStyle(color: TextColor.main)), + title: const Text('アカウント設定', style: TextStyle(color: TextColor.main)), backgroundColor: PilllColors.white, ), body: ListView( @@ -88,8 +87,7 @@ class SettingAccountCooperationListPage extends HookConsumerWidget { try { final messenger = ScaffoldMessenger.of(context); final navigator = Navigator.of(context); - analytics.logEvent( - name: 'a_c_l_apple_long_press_result'); + analytics.logEvent(name: 'a_c_l_apple_long_press_result'); await appleReauthentification(); @@ -143,8 +141,7 @@ class SettingAccountCooperationListPage extends HookConsumerWidget { try { final messenger = ScaffoldMessenger.of(context); final navigator = Navigator.of(context); - analytics.logEvent( - name: 'a_c_l_google_long_press_result'); + analytics.logEvent(name: 'a_c_l_google_long_press_result'); await googleReauthentification(); @@ -192,8 +189,7 @@ class SettingAccountCooperationListPage extends HookConsumerWidget { } } -extension SettingAccountCooperationListPageRoute - on SettingAccountCooperationListPage { +extension SettingAccountCooperationListPageRoute on SettingAccountCooperationListPage { static Route route() { return MaterialPageRoute( settings: const RouteSettings(name: "SettingAccountCooperationListPage"), diff --git a/lib/features/settings/setting_page.dart b/lib/features/settings/setting_page.dart index e0032ac6e1..5640466f30 100644 --- a/lib/features/settings/setting_page.dart +++ b/lib/features/settings/setting_page.dart @@ -43,14 +43,7 @@ import 'package:url_launcher/url_launcher.dart'; import 'components/rows/about_churn.dart'; -enum SettingSection { - account, - premium, - pill, - notification, - menstruation, - other -} +enum SettingSection { account, premium, pill, notification, menstruation, other } class SettingPage extends HookConsumerWidget { const SettingPage({super.key}); @@ -67,9 +60,7 @@ class SettingPage extends HookConsumerWidget { ref.watch(isHealthDataAvailableProvider), ).when( data: (data) { - final userIsMigratedFrom132 = sharedPreferences - .containsKey(StringKey.salvagedOldStartTakenDate) && - sharedPreferences.containsKey(StringKey.salvagedOldLastTakenDate); + final userIsMigratedFrom132 = sharedPreferences.containsKey(StringKey.salvagedOldStartTakenDate) && sharedPreferences.containsKey(StringKey.salvagedOldLastTakenDate); return SettingPageBody( user: data.$1, setting: data.$2, @@ -126,8 +117,7 @@ class SettingPageBody extends StatelessWidget { return SettingSectionTitle( text: "アカウント", children: [ - const ListExplainRow( - text: "機種変更やスマホ紛失時など、データの引き継ぎ・復元には、アカウント登録が必要です。"), + const ListExplainRow(text: "機種変更やスマホ紛失時など、データの引き継ぎ・復元には、アカウント登録が必要です。"), const AccountLinkRow(), _separator(), ], @@ -145,13 +135,8 @@ class SettingPageBody extends StatelessWidget { fontSize: 16, )), onTap: () { - analytics.logEvent( - name: "did_select_about_trial", - parameters: {}); - launchUrl( - Uri.parse( - "https://pilll.wraptas.site/3abd690f501549c48f813fd310b5f242"), - mode: LaunchMode.inAppWebView); + analytics.logEvent(name: "did_select_about_trial", parameters: {}); + launchUrl(Uri.parse("https://pilll.wraptas.site/3abd690f501549c48f813fd310b5f242"), mode: LaunchMode.inAppWebView); }, ), _separator(), @@ -171,9 +156,7 @@ class SettingPageBody extends StatelessWidget { return SettingSectionTitle( text: "ピルシート", children: [ - if (activePillSheet != null && - pillSheetGroup != null && - !pillSheetGroup.isDeactived) ...[ + if (activePillSheet != null && pillSheetGroup != null && !pillSheetGroup.isDeactived) ...[ TodayPllNumberRow( setting: setting, pillSheetGroup: pillSheetGroup, @@ -203,10 +186,8 @@ class SettingPageBody extends StatelessWidget { _separator(), NotificationTimeRow(setting: setting), _separator(), - if (activePillSheet != null && - activePillSheet.pillSheetHasRestOrFakeDuration) ...[ - NotificationInRestDuration( - setting: setting, pillSheet: activePillSheet), + if (activePillSheet != null && activePillSheet.pillSheetHasRestOrFakeDuration) ...[ + NotificationInRestDuration(setting: setting, pillSheet: activePillSheet), _separator(), ], if (!user.isPremium) ...[ @@ -256,15 +237,13 @@ class SettingPageBody extends StatelessWidget { fontSize: 16, )), onTap: () async { - analytics.logEvent( - name: "tap_share_to_friend", parameters: {}); + analytics.logEvent(name: "tap_share_to_friend", parameters: {}); const text = ''' Pilll ピル服用に特化したピルリマインダーアプリ iOS: https://onl.sc/piiY1A6 Android: https://onl.sc/c9xnQUk'''; - Clipboard.setData( - const ClipboardData(text: text)); + Clipboard.setData(const ClipboardData(text: text)); ScaffoldMessenger.of(context).showSnackBar( const SnackBar( duration: Duration(seconds: 2), @@ -281,12 +260,8 @@ class SettingPageBody extends StatelessWidget { fontSize: 16, )), onTap: () { - analytics.logEvent( - name: "did_select_terms", parameters: {}); - launchUrl( - Uri.parse( - "https://bannzai.github.io/Pilll/Terms"), - mode: LaunchMode.inAppWebView); + analytics.logEvent(name: "did_select_terms", parameters: {}); + launchUrl(Uri.parse("https://bannzai.github.io/Pilll/Terms"), mode: LaunchMode.inAppWebView); }), _separator(), ListTile( @@ -297,13 +272,8 @@ class SettingPageBody extends StatelessWidget { fontSize: 16, )), onTap: () { - analytics.logEvent( - name: "did_select_privacy_policy", - parameters: {}); - launchUrl( - Uri.parse( - "https://bannzai.github.io/Pilll/PrivacyPolicy"), - mode: LaunchMode.inAppWebView); + analytics.logEvent(name: "did_select_privacy_policy", parameters: {}); + launchUrl(Uri.parse("https://bannzai.github.io/Pilll/PrivacyPolicy"), mode: LaunchMode.inAppWebView); }), _separator(), ListTile( @@ -314,12 +284,8 @@ class SettingPageBody extends StatelessWidget { fontSize: 16, )), onTap: () { - analytics.logEvent( - name: "did_select_faq", parameters: {}); - launchUrl( - Uri.parse( - "https://pilll.wraptas.site/bb1f49eeded64b57929b7a13e9224d69"), - mode: LaunchMode.inAppWebView); + analytics.logEvent(name: "did_select_faq", parameters: {}); + launchUrl(Uri.parse("https://pilll.wraptas.site/bb1f49eeded64b57929b7a13e9224d69"), mode: LaunchMode.inAppWebView); }), _separator(), ListTile( @@ -330,11 +296,8 @@ class SettingPageBody extends StatelessWidget { fontSize: 16, )), onTap: () { - analytics.logEvent( - name: "setting_did_select_release_note", - parameters: {}); - launchUrl(Uri.parse( - "https://pilll.wraptas.site/172cae6bced04bbabeab1d8acad91a61")); + analytics.logEvent(name: "setting_did_select_release_note", parameters: {}); + launchUrl(Uri.parse("https://pilll.wraptas.site/172cae6bced04bbabeab1d8acad91a61")); }), _separator(), ListTile( @@ -345,8 +308,7 @@ class SettingPageBody extends StatelessWidget { fontSize: 16, )), onTap: () { - analytics.logEvent( - name: "did_select_inquiry", parameters: {}); + analytics.logEvent(name: "did_select_inquiry", parameters: {}); inquiry(); }), if (Environment.isDevelopment) ...[ diff --git a/lib/features/settings/timezone_setting_dialog.dart b/lib/features/settings/timezone_setting_dialog.dart index 4baf965d2a..78351205d5 100644 --- a/lib/features/settings/timezone_setting_dialog.dart +++ b/lib/features/settings/timezone_setting_dialog.dart @@ -24,10 +24,8 @@ class TimezoneSettingDialog extends HookConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final setSetting = ref.watch(setSettingProvider); return AlertDialog( - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(20.0))), - contentPadding: - const EdgeInsets.only(left: 24, right: 24, top: 32, bottom: 20), + shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(20.0))), + contentPadding: const EdgeInsets.only(left: 24, right: 24, top: 32, bottom: 20), actionsPadding: const EdgeInsets.only(left: 24, right: 24), title: Text( "端末のタイムゾーン($deviceTimezoneName)と同期しますか?", @@ -76,8 +74,7 @@ class TimezoneSettingDialog extends HookConsumerWidget { final navigator = Navigator.of(context); try { - await setSetting( - setting.copyWith(timezoneDatabaseName: deviceTimezoneName)); + await setSetting(setting.copyWith(timezoneDatabaseName: deviceTimezoneName)); onDone(deviceTimezoneName); } catch (error) { if (context.mounted) showErrorAlert(context, error); diff --git a/lib/features/settings/today_pill_number/setting_today_pill_number_page.dart b/lib/features/settings/today_pill_number/setting_today_pill_number_page.dart index 6a4b3eba63..78b187476d 100644 --- a/lib/features/settings/today_pill_number/setting_today_pill_number_page.dart +++ b/lib/features/settings/today_pill_number/setting_today_pill_number_page.dart @@ -25,12 +25,10 @@ class SettingTodayPillNumberPage extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final pillNumberInPillSheetState = useState(_pillNumberInPillSheet( - activePillSheet: activePillSheet, pillSheetGroup: pillSheetGroup)); + final pillNumberInPillSheetState = useState(_pillNumberInPillSheet(activePillSheet: activePillSheet, pillSheetGroup: pillSheetGroup)); final pillSheetPageIndexState = useState(activePillSheet.groupIndex); final changePillNumber = ref.watch(changePillNumberProvider); - final registerReminderLocalNotification = - ref.watch(registerReminderLocalNotificationProvider); + final registerReminderLocalNotification = ref.watch(registerReminderLocalNotificationProvider); final navigator = Navigator.of(context); return Scaffold( @@ -66,20 +64,16 @@ class SettingTodayPillNumberPage extends HookConsumerWidget { const SizedBox(height: 56), Center( child: SettingTodayPillNumberPillSheetList( - pillSheetTypes: pillSheetGroup.pillSheets - .map((e) => e.pillSheetType) - .toList(), + pillSheetTypes: pillSheetGroup.pillSheets.map((e) => e.pillSheetType).toList(), selectedTodayPillNumberIntoPillSheet: (pageIndex) { if (pillSheetPageIndexState.value != pageIndex) { return null; } return pillNumberInPillSheetState.value; }, - markSelected: - (pillSheetPageIndex, pillNumberInPillSheet) { + markSelected: (pillSheetPageIndex, pillNumberInPillSheet) { pillSheetPageIndexState.value = pillSheetPageIndex; - pillNumberInPillSheetState.value = - pillNumberInPillSheet; + pillNumberInPillSheetState.value = pillNumberInPillSheet; }), ), const SizedBox(height: 20), @@ -98,8 +92,7 @@ class SettingTodayPillNumberPage extends HookConsumerWidget { pillSheetGroup: pillSheetGroup, activePillSheet: activePillSheet, pillSheetPageIndex: pillSheetPageIndexState.value, - pillNumberInPillSheet: - pillNumberInPillSheetState.value); + pillNumberInPillSheet: pillNumberInPillSheetState.value); await registerReminderLocalNotification(); navigator.pop(); @@ -126,10 +119,8 @@ class SettingTodayPillNumberPage extends HookConsumerWidget { required PillSheet activePillSheet, required PillSheetGroup pillSheetGroup, }) { - final pillSheetTypes = - pillSheetGroup.pillSheets.map((e) => e.pillSheetType).toList(); - final passedTotalCount = summarizedPillCountWithPillSheetTypesToIndex( - pillSheetTypes: pillSheetTypes, toIndex: activePillSheet.groupIndex); + final pillSheetTypes = pillSheetGroup.pillSheets.map((e) => e.pillSheetType).toList(); + final passedTotalCount = summarizedPillCountWithPillSheetTypesToIndex(pillSheetTypes: pillSheetTypes, toIndex: activePillSheet.groupIndex); if (passedTotalCount >= activePillSheet.todayPillNumber) { return activePillSheet.todayPillNumber; } diff --git a/lib/features/settings/today_pill_number/setting_today_pill_number_pill_sheet_list.dart b/lib/features/settings/today_pill_number/setting_today_pill_number_pill_sheet_list.dart index 98f294f9b8..8d599c2d12 100644 --- a/lib/features/settings/today_pill_number/setting_today_pill_number_pill_sheet_list.dart +++ b/lib/features/settings/today_pill_number/setting_today_pill_number_pill_sheet_list.dart @@ -21,16 +21,13 @@ class SettingTodayPillNumberPillSheetList extends HookConsumerWidget { }); @override Widget build(BuildContext context, WidgetRef ref) { - final pageController = usePageController( - viewportFraction: (PillSheetViewLayout.width + 20) / - MediaQuery.of(context).size.width); + final pageController = usePageController(viewportFraction: (PillSheetViewLayout.width + 20) / MediaQuery.of(context).size.width); return Column( children: [ SizedBox( height: PillSheetViewLayout.calcHeight( - PillSheetViewLayout.mostLargePillSheetType(pillSheetTypes) - .numberOfLineInPillSheet, + PillSheetViewLayout.mostLargePillSheetType(pillSheetTypes).numberOfLineInPillSheet, true, ), child: PageView( @@ -51,15 +48,12 @@ class SettingTodayPillNumberPillSheetList extends HookConsumerWidget { // 設定で TodayPillNumber だけPillSheetに依存しており、そのためにコードを書くのはコスト高だと思いやめた appearanceMode: PillSheetAppearanceMode.number, pillSheetTypes: pillSheetTypes, - selectedPillNumberIntoPillSheet: - selectedTodayPillNumberIntoPillSheet(pageIndex), + selectedPillNumberIntoPillSheet: selectedTodayPillNumberIntoPillSheet(pageIndex), markSelected: (pageIndex, number) { - analytics.logEvent( - name: "selected_today_number_setting", - parameters: { - "pill_number": number, - "page": pageIndex, - }); + analytics.logEvent(name: "selected_today_number_setting", parameters: { + "pill_number": number, + "page": pageIndex, + }); markSelected(pageIndex, number); }, ), diff --git a/lib/features/sign_in/sign_in_sheet.dart b/lib/features/sign_in/sign_in_sheet.dart index 9930bc0fda..25feb422e2 100644 --- a/lib/features/sign_in/sign_in_sheet.dart +++ b/lib/features/sign_in/sign_in_sheet.dart @@ -277,9 +277,7 @@ class SignInSheet extends HookConsumerWidget { Future _handleApple(LinkApple linkApple) { if (_isLoginMode) { analytics.logEvent(name: "signin_sheet_sign_in_apple"); - return signInWithApple().then((value) => value == null - ? SignInWithAppleState.cancel - : SignInWithAppleState.determined); + return signInWithApple().then((value) => value == null ? SignInWithAppleState.cancel : SignInWithAppleState.determined); } else { analytics.logEvent(name: "signin_sheet_link_with_apple"); return callLinkWithApple(linkApple); @@ -289,9 +287,7 @@ class SignInSheet extends HookConsumerWidget { Future _handleGoogle(LinkGoogle linkGoogle) { if (_isLoginMode) { analytics.logEvent(name: "signin_sheet_sign_in_google"); - return signInWithGoogle().then((value) => value == null - ? SignInWithGoogleState.cancel - : SignInWithGoogleState.determined); + return signInWithGoogle().then((value) => value == null ? SignInWithGoogleState.cancel : SignInWithGoogleState.determined); } else { analytics.logEvent(name: "signin_sheet_link_with_google"); return callLinkWithGoogle(linkGoogle); @@ -299,8 +295,7 @@ class SignInSheet extends HookConsumerWidget { } } -void showSignInSheet(BuildContext context, SignInSheetStateContext stateContext, - Function(LinkAccountType)? onSignIn) { +void showSignInSheet(BuildContext context, SignInSheetStateContext stateContext, Function(LinkAccountType)? onSignIn) { analytics.setCurrentScreen(screenName: "SigninSheet"); showModalBottomSheet( context: context, diff --git a/lib/features/store_review/pre_store_review_modal.dart b/lib/features/store_review/pre_store_review_modal.dart index 9c311a2b3a..7f7a5b091e 100644 --- a/lib/features/store_review/pre_store_review_modal.dart +++ b/lib/features/store_review/pre_store_review_modal.dart @@ -44,13 +44,9 @@ class PreStoreReviewModal extends HookConsumerWidget { Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - _goodOrBad( - target: PreStoreReviewModalSelection.good, - selection: selection), + _goodOrBad(target: PreStoreReviewModalSelection.good, selection: selection), const SizedBox(width: 16), - _goodOrBad( - target: PreStoreReviewModalSelection.bad, - selection: selection), + _goodOrBad(target: PreStoreReviewModalSelection.bad, selection: selection), ], ), if (selectionValue != null) ...[ @@ -59,15 +55,11 @@ class PreStoreReviewModal extends HookConsumerWidget { onPressed: () async { switch (selectionValue) { case PreStoreReviewModalSelection.good: - analytics.logEvent( - name: "submit_pre_store_review_modal_good"); - ref - .read(sharedPreferencesProvider) - .setBool(BoolKey.isPreStoreReviewGoodAnswer, true); + analytics.logEvent(name: "submit_pre_store_review_modal_good"); + ref.read(sharedPreferencesProvider).setBool(BoolKey.isPreStoreReviewGoodAnswer, true); break; case PreStoreReviewModalSelection.bad: - analytics.logEvent( - name: "submit_pre_store_review_modal_bad"); + analytics.logEvent(name: "submit_pre_store_review_modal_bad"); break; } @@ -86,9 +78,7 @@ class PreStoreReviewModal extends HookConsumerWidget { ); } - Widget _goodOrBad( - {required PreStoreReviewModalSelection target, - required ValueNotifier selection}) { + Widget _goodOrBad({required PreStoreReviewModalSelection target, required ValueNotifier selection}) { final isSelected = target == selection.value; return GestureDetector( onTap: () { @@ -108,9 +98,7 @@ class PreStoreReviewModal extends HookConsumerWidget { Container( padding: const EdgeInsets.all(20), decoration: BoxDecoration( - color: isSelected - ? PilllColors.primary.withOpacity(0.08) - : PilllColors.white, + color: isSelected ? PilllColors.primary.withOpacity(0.08) : PilllColors.white, border: Border.all( width: isSelected ? 2 : 1, color: isSelected ? PilllColors.primary : PilllColors.border, @@ -120,23 +108,15 @@ class PreStoreReviewModal extends HookConsumerWidget { child: Row( children: [ SvgPicture.asset( - target == PreStoreReviewModalSelection.good - ? "images/laugh.svg" - : "images/angry.svg", + target == PreStoreReviewModalSelection.good ? "images/laugh.svg" : "images/angry.svg", colorFilter: ColorFilter.mode( isSelected ? PilllColors.primary : Colors.grey, BlendMode.srcIn, ), ), const SizedBox(height: 16), - Text( - target == PreStoreReviewModalSelection.good - ? "満足している" - : "満足では無い", - style: const TextStyle( - color: PilllColors.primary, - fontWeight: FontWeight.bold, - fontFamily: FontFamily.japanese)), + Text(target == PreStoreReviewModalSelection.good ? "満足している" : "満足では無い", + style: const TextStyle(color: PilllColors.primary, fontWeight: FontWeight.bold, fontFamily: FontFamily.japanese)), ], ), ), @@ -192,12 +172,10 @@ class _ThanksDialog extends StatelessWidget { final String uri; switch (goodOrBad) { case PreStoreReviewModalSelection.good: - uri = - "https://docs.google.com/forms/d/e/1FAIpQLScljawYCa-f13D94TvJXOoBQ_6lLBtwSpML5c55Zr115ukgeQ/viewform"; + uri = "https://docs.google.com/forms/d/e/1FAIpQLScljawYCa-f13D94TvJXOoBQ_6lLBtwSpML5c55Zr115ukgeQ/viewform"; break; case PreStoreReviewModalSelection.bad: - uri = - "https://docs.google.com/forms/d/e/1FAIpQLScdNJ5VsiWCNLk7LvSUJpb8ps0DHFnsvXVH8KbPWp9XDtuVMw/viewform"; + uri = "https://docs.google.com/forms/d/e/1FAIpQLScdNJ5VsiWCNLk7LvSUJpb8ps0DHFnsvXVH8KbPWp9XDtuVMw/viewform"; break; } await Navigator.of(context).push( @@ -208,8 +186,7 @@ class _ThanksDialog extends StatelessWidget { ); // ignore: use_build_context_synchronously - await showDialog( - context: context, builder: (_) => const _CompleteDialog()); + await showDialog(context: context, builder: (_) => const _CompleteDialog()); navigator.pop(); }, ), @@ -230,8 +207,7 @@ class _CompleteDialog extends StatelessWidget { @override Widget build(BuildContext context) { return AlertDialog( - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(20.0))), + shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(20.0))), title: const Text( "ご協力頂きありがとうございます", style: TextStyle( @@ -260,8 +236,7 @@ class _CompleteDialog extends StatelessWidget { AlertButton( text: "閉じる", onPressed: () async { - analytics.logEvent( - name: "close_pre_store_review_modal_complete_dialog"); + analytics.logEvent(name: "close_pre_store_review_modal_complete_dialog"); Navigator.of(context).pop(); }, ), diff --git a/lib/main.dev.dart b/lib/main.dev.dart index a794e4fc64..3935928548 100644 --- a/lib/main.dev.dart +++ b/lib/main.dev.dart @@ -11,16 +11,14 @@ Future main() async { if (!Environment.isDevelopment) { throw AssertionError("This method should not call out of development"); } - (await SharedPreferences.getInstance()) - .setBool(BoolKey.didEndInitialSetting, false); + (await SharedPreferences.getInstance()).setBool(BoolKey.didEndInitialSetting, false); await FirebaseAuth.instance.currentUser?.delete(); }; Environment.signOutUser = () async { if (!Environment.isDevelopment) { throw AssertionError("This method should not call out of development"); } - (await SharedPreferences.getInstance()) - .setBool(BoolKey.didEndInitialSetting, false); + (await SharedPreferences.getInstance()).setBool(BoolKey.didEndInitialSetting, false); await CancelReminderLocalNotification().call(); await FirebaseAuth.instance.signOut(); }; diff --git a/lib/native/channel.dart b/lib/native/channel.dart index 9c0f67913c..672ed791b0 100644 --- a/lib/native/channel.dart +++ b/lib/native/channel.dart @@ -33,22 +33,15 @@ void definedChannel() { final pillSheetGroup = await quickRecordTakePill(database); syncActivePillSheetValue(pillSheetGroup: pillSheetGroup); - final cancelReminderLocalNotification = - CancelReminderLocalNotification(); + final cancelReminderLocalNotification = CancelReminderLocalNotification(); // エンティティの変更があった場合にdatabaseの読み込みで最新の状態を取得するために、Future.microtaskで更新を待ってから処理を始める // hour,minute,番号を基準にIDを決定しているので、時間変更や番号変更時にそれまで登録されていたIDを特定するのが不可能なので全てキャンセルする - await ( - Future.microtask(() => null), - cancelReminderLocalNotification() - ).wait; + await (Future.microtask(() => null), cancelReminderLocalNotification()).wait; final activePillSheet = pillSheetGroup?.activePillSheet; final user = (await database.userReference().get()).data(); final setting = user?.setting; - if (pillSheetGroup != null && - activePillSheet != null && - user != null && - setting != null) { + if (pillSheetGroup != null && activePillSheet != null && user != null && setting != null) { await RegisterReminderLocalNotification.run( pillSheetGroup: pillSheetGroup, activePillSheet: activePillSheet, @@ -72,8 +65,7 @@ void definedChannel() { return salvagedOldStartTakenDate(call.arguments); case "analytics": final name = call.arguments["name"] as String; - final parameters = - Map.from(call.arguments["parameters"]); + final parameters = Map.from(call.arguments["parameters"]); analytics.logEvent(name: name, parameters: parameters); break; default: diff --git a/lib/native/health_care.dart b/lib/native/health_care.dart index 0f8ef67985..8bdaa8157a 100644 --- a/lib/native/health_care.dart +++ b/lib/native/health_care.dart @@ -22,8 +22,7 @@ Future healthKitRequestAuthorizationIsUnnecessary() async { throw const FormatException("ヘルスケアに対応していない端末ではご利用できません"); } - final result = await methodChannel - .invokeMethod("healthKitRequestAuthorizationIsUnnecessary"); + final result = await methodChannel.invokeMethod("healthKitRequestAuthorizationIsUnnecessary"); return result["healthKitRequestAuthorizationIsUnnecessary"] == true; } @@ -38,8 +37,7 @@ Future healthKitAuthorizationStatusIsSharingAuthorized() async { throw const FormatException("設定アプリよりヘルスケアを有効にしてください"); } - final result = await methodChannel - .invokeMethod("healthKitAuthorizationStatusIsSharingAuthorized"); + final result = await methodChannel.invokeMethod("healthKitAuthorizationStatusIsSharingAuthorized"); return result["healthKitAuthorizationStatusIsSharingAuthorized"] == true; } @@ -108,8 +106,7 @@ Future addMenstruationFlowHealthKitData( } } - dynamic response = - await methodChannel.invokeMethod("addMenstruationFlowHealthKitData", { + dynamic response = await methodChannel.invokeMethod("addMenstruationFlowHealthKitData", { "menstruation": json, }); @@ -145,8 +142,7 @@ Future updateOrAddMenstruationFlowHealthKitData( } } - dynamic response = await methodChannel - .invokeMethod("updateOrAddMenstruationFlowHealthKitData", { + dynamic response = await methodChannel.invokeMethod("updateOrAddMenstruationFlowHealthKitData", { "menstruation": json, }); @@ -182,8 +178,7 @@ Future deleteMenstruationFlowHealthKitData( } } - dynamic response = - await methodChannel.invokeMethod("deleteMenstrualFlowHealthKitData", { + dynamic response = await methodChannel.invokeMethod("deleteMenstrualFlowHealthKitData", { "menstruation": json, }); diff --git a/lib/native/legacy.dart b/lib/native/legacy.dart index dc9f5394f1..6a9673b7ea 100644 --- a/lib/native/legacy.dart +++ b/lib/native/legacy.dart @@ -18,8 +18,7 @@ Future salvagedOldStartTakenDate(dynamic arguments) async { return Future.value(); } - final salvagedOldStartTakenDateRawValue = - typedDic["salvagedOldStartTakenDate"]; + final salvagedOldStartTakenDateRawValue = typedDic["salvagedOldStartTakenDate"]; if (salvagedOldStartTakenDateRawValue == null) { return Future.value(); } @@ -33,14 +32,11 @@ Future salvagedOldStartTakenDate(dynamic arguments) async { if (!salvagedOldLastTakenDateRawValue.contains("/")) { return Future.value(); } - final formattedStartTakenDate = - salvagedOldStartTakenDateRawValue.replaceAll("/", "-"); - final formattedSalvagedOldLastTakenDate = - salvagedOldLastTakenDateRawValue.replaceAll("/", "-"); + final formattedStartTakenDate = salvagedOldStartTakenDateRawValue.replaceAll("/", "-"); + final formattedSalvagedOldLastTakenDate = salvagedOldLastTakenDateRawValue.replaceAll("/", "-"); return SharedPreferences.getInstance().then((storage) { storage.setString("salvagedOldStartTakenDate", formattedStartTakenDate); - storage.setString( - "salvagedOldLastTakenDate", formattedSalvagedOldLastTakenDate); + storage.setString("salvagedOldLastTakenDate", formattedSalvagedOldLastTakenDate); }); } diff --git a/lib/native/pill.dart b/lib/native/pill.dart index c2a0688234..d4398d9ae8 100644 --- a/lib/native/pill.dart +++ b/lib/native/pill.dart @@ -27,8 +27,7 @@ Future quickRecordTakePill(DatabaseConnection database) async { final takePill = TakePill( batchFactory: batchFactory, - batchSetPillSheetModifiedHistory: - BatchSetPillSheetModifiedHistory(database), + batchSetPillSheetModifiedHistory: BatchSetPillSheetModifiedHistory(database), batchSetPillSheetGroup: BatchSetPillSheetGroup(database), ); final updatedPillSheetGroup = await takePill( diff --git a/lib/native/present_share_to_sns_for_reward_premium_trial.dart b/lib/native/present_share_to_sns_for_reward_premium_trial.dart index 2df0fbf75b..3a4e38bbc2 100644 --- a/lib/native/present_share_to_sns_for_reward_premium_trial.dart +++ b/lib/native/present_share_to_sns_for_reward_premium_trial.dart @@ -25,9 +25,7 @@ Future presentShareToSNSForPremiumTrialReward( ShareToSNSKind shareToSNSKind, VoidCallback completionHandler, ) async { - final result = await methodChannel.invokeMethod( - "presentShareToSNSForPremiumTrialReward", - {"shareToSNSKind": shareToSNSKind.rawValue}); + final result = await methodChannel.invokeMethod("presentShareToSNSForPremiumTrialReward", {"shareToSNSKind": shareToSNSKind.rawValue}); if (result["result"] == "success") { completionHandler(); return; diff --git a/lib/native/widget.dart b/lib/native/widget.dart index c1dcc29ec3..8cfa40ec70 100644 --- a/lib/native/widget.dart +++ b/lib/native/widget.dart @@ -13,14 +13,10 @@ Future syncActivePillSheetValue({ }) async { try { final map = { - "pillSheetLastTakenDate": pillSheetGroup - ?.activePillSheet?.lastTakenDate?.millisecondsSinceEpoch, - "pillSheetTodayPillNumber": - pillSheetGroup?.activePillSheet?.todayPillNumber, - "pillSheetGroupTodayPillNumber": - pillSheetGroup?.sequentialTodayPillNumber, - "pillSheetEndDisplayPillNumber": - pillSheetGroup?.displayNumberSetting?.endPillNumber, + "pillSheetLastTakenDate": pillSheetGroup?.activePillSheet?.lastTakenDate?.millisecondsSinceEpoch, + "pillSheetTodayPillNumber": pillSheetGroup?.activePillSheet?.todayPillNumber, + "pillSheetGroupTodayPillNumber": pillSheetGroup?.sequentialTodayPillNumber, + "pillSheetEndDisplayPillNumber": pillSheetGroup?.displayNumberSetting?.endPillNumber, "pillSheetValueLastUpdateDateTime": DateTime.now().millisecondsSinceEpoch, }; for (final element in map.entries) { @@ -36,8 +32,7 @@ Future syncSetting({ required Setting? setting, }) async { try { - await HomeWidget.saveWidgetData("settingPillSheetAppearanceMode", - setting?.pillSheetAppearanceMode.name); + await HomeWidget.saveWidgetData("settingPillSheetAppearanceMode", setting?.pillSheetAppearanceMode.name); await updateWidget(); } catch (error) { debugPrint(error.toString()); @@ -48,8 +43,7 @@ Future syncUserStatus({ required User? user, }) async { try { - await HomeWidget.saveWidgetData( - "userIsPremiumOrTrial", user?.premiumOrTrial); + await HomeWidget.saveWidgetData("userIsPremiumOrTrial", user?.premiumOrTrial); await updateWidget(); } catch (error) { debugPrint(error.toString()); diff --git a/lib/provider/auth.dart b/lib/provider/auth.dart index 9479ed36b5..5c4422c0c6 100644 --- a/lib/provider/auth.dart +++ b/lib/provider/auth.dart @@ -23,27 +23,20 @@ final firebaseSignInOrCurrentUserProvider = FutureProvider((ref) async { ); if (currentUser != null) { - analytics.logEvent( - name: "cached_current_user_exists", - parameters: _logginParameters(currentUser)); + analytics.logEvent(name: "cached_current_user_exists", parameters: _logginParameters(currentUser)); return currentUser; } else { analytics.logEvent(name: "cached_current_user_not_exists"); - final anonymousUserCredential = - await FirebaseAuth.instance.signInAnonymously(); - analytics.logEvent( - name: "signin_anonymously", - parameters: _logginParameters(anonymousUserCredential.user)); + final anonymousUserCredential = await FirebaseAuth.instance.signInAnonymously(); + analytics.logEvent(name: "signin_anonymously", parameters: _logginParameters(anonymousUserCredential.user)); final sharedPreferences = await SharedPreferences.getInstance(); - final existsUID = - sharedPreferences.getString(StringKey.lastSignInAnonymousUID); + final existsUID = sharedPreferences.getString(StringKey.lastSignInAnonymousUID); if (existsUID == null || existsUID.isEmpty) { final user = anonymousUserCredential.user; if (user != null) { - await sharedPreferences.setString( - StringKey.lastSignInAnonymousUID, user.uid); + await sharedPreferences.setString(StringKey.lastSignInAnonymousUID, user.uid); } } @@ -51,8 +44,7 @@ final firebaseSignInOrCurrentUserProvider = FutureProvider((ref) async { } }); -final isLinkedProvider = Provider((ref) => - ref.watch(isAppleLinkedProvider) || ref.watch(isGoogleLinkedProvider)); +final isLinkedProvider = Provider((ref) => ref.watch(isAppleLinkedProvider) || ref.watch(isGoogleLinkedProvider)); Map _logginParameters(User? currentUser) { if (currentUser == null) { @@ -62,11 +54,7 @@ Map _logginParameters(User? currentUser) { return { "uid": currentUser.uid, "isAnonymous": currentUser.isAnonymous, - "hasGoogleProviderData": currentUser.providerData - .where((element) => element.providerId == googleProviderID) - .isNotEmpty, - "hasAppleProviderData": currentUser.providerData - .where((element) => element.providerId == AppleAuthProvider.PROVIDER_ID) - .isNotEmpty, + "hasGoogleProviderData": currentUser.providerData.where((element) => element.providerId == googleProviderID).isNotEmpty, + "hasAppleProviderData": currentUser.providerData.where((element) => element.providerId == AppleAuthProvider.PROVIDER_ID).isNotEmpty, }; } diff --git a/lib/provider/auth.g.dart b/lib/provider/auth.g.dart index f985e80c8e..86e34ec090 100644 --- a/lib/provider/auth.g.dart +++ b/lib/provider/auth.g.dart @@ -13,9 +13,7 @@ String _$firebaseUserStateHash() => r'c50e10f43818ea992e82df756275ee8f6fcf5b73'; final firebaseUserStateProvider = StreamProvider.internal( firebaseUserState, name: r'firebaseUserStateProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$firebaseUserStateHash, + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') ? null : _$firebaseUserStateHash, dependencies: const [], allTransitiveDependencies: const {}, ); diff --git a/lib/provider/change_pill_number.dart b/lib/provider/change_pill_number.dart index bdea683368..447123795f 100644 --- a/lib/provider/change_pill_number.dart +++ b/lib/provider/change_pill_number.dart @@ -13,8 +13,7 @@ import 'package:pilll/utils/datetime/day.dart'; final changePillNumberProvider = Provider.autoDispose( (ref) => ChangePillNumber( batchFactory: ref.watch(batchFactoryProvider), - batchSetPillSheetModifiedHistory: - ref.watch(batchSetPillSheetModifiedHistoryProvider), + batchSetPillSheetModifiedHistory: ref.watch(batchSetPillSheetModifiedHistoryProvider), batchSetPillSheetGroup: ref.watch(batchSetPillSheetGroupProvider), ), ); @@ -39,16 +38,13 @@ class ChangePillNumber { }) async { final batch = batchFactory.batch(); - final pillSheetTypes = - pillSheetGroup.pillSheets.map((e) => e.pillSheetType).toList(); - final nextSerializedPillNumber = - summarizedPillCountWithPillSheetTypesToIndex( - pillSheetTypes: pillSheetTypes, - toIndex: pillSheetPageIndex, - ) + - pillNumberInPillSheet; - final firstPilSheetBeginDate = - today().subtract(Duration(days: nextSerializedPillNumber - 1)); + final pillSheetTypes = pillSheetGroup.pillSheets.map((e) => e.pillSheetType).toList(); + final nextSerializedPillNumber = summarizedPillCountWithPillSheetTypesToIndex( + pillSheetTypes: pillSheetTypes, + toIndex: pillSheetPageIndex, + ) + + pillNumberInPillSheet; + final firstPilSheetBeginDate = today().subtract(Duration(days: nextSerializedPillNumber - 1)); final List updatedPillSheets = []; pillSheetGroup.pillSheets.asMap().keys.forEach((index) { @@ -58,8 +54,7 @@ class ChangePillNumber { if (index == 0) { beginDate = firstPilSheetBeginDate; } else { - final passedTotalCount = summarizedPillCountWithPillSheetTypesToIndex( - pillSheetTypes: pillSheetTypes, toIndex: index); + final passedTotalCount = summarizedPillCountWithPillSheetTypesToIndex(pillSheetTypes: pillSheetTypes, toIndex: index); beginDate = firstPilSheetBeginDate.addDays(passedTotalCount); } @@ -67,8 +62,7 @@ class ChangePillNumber { if (pillSheetPageIndex == index) { lastTakenDate = beginDate.addDays(pillNumberInPillSheet - 2); } else if (pillSheetPageIndex > index) { - lastTakenDate = - beginDate.addDays(pillSheet.pillSheetType.totalCount - 1); + lastTakenDate = beginDate.addDays(pillSheet.pillSheetType.totalCount - 1); } else { // state.selectedPillMarkNumberIntoPillSheet < index lastTakenDate = null; @@ -82,10 +76,8 @@ class ChangePillNumber { updatedPillSheets.add(updatedPillSheet); }); - final updatedPillSheetGroup = - pillSheetGroup.copyWith(pillSheets: updatedPillSheets); - final history = PillSheetModifiedHistoryServiceActionFactory - .createChangedPillNumberAction( + final updatedPillSheetGroup = pillSheetGroup.copyWith(pillSheets: updatedPillSheets); + final history = PillSheetModifiedHistoryServiceActionFactory.createChangedPillNumberAction( pillSheetGroupID: pillSheetGroup.id, before: activePillSheet, after: updatedPillSheets[pillSheetPageIndex], diff --git a/lib/provider/database.dart b/lib/provider/database.dart index 7a94a07c41..1d92a07007 100644 --- a/lib/provider/database.dart +++ b/lib/provider/database.dart @@ -20,8 +20,7 @@ part 'database.g.dart'; DatabaseConnection database(DatabaseRef ref) { final stream = ref.watch(firebaseUserStateProvider); // 初回起動の時には.userChanges()のstreamは流れてこないので、currentUserのidを使う - final uid = stream.asData?.value?.uid ?? - firebase.FirebaseAuth.instance.currentUser?.uid; + final uid = stream.asData?.value?.uid ?? firebase.FirebaseAuth.instance.currentUser?.uid; debugPrint("[DEBUG] database uid is $uid"); return DatabaseConnection(uid); } @@ -30,17 +29,12 @@ abstract class _CollectionPath { static const String users = "users"; static String settings(String userID) => "$users/$userID/settings"; static String diaries(String userID) => "$users/$userID/diaries"; - static String pillSheetGroups(String userID) => - "$users/$userID/pill_sheet_groups"; + static String pillSheetGroups(String userID) => "$users/$userID/pill_sheet_groups"; static String userPrivates(String userID) => "$users/$userID/privates"; static String menstruations(String userID) => "$users/$userID/menstruations"; - static String pillSheetModifiedHistories(String userID) => - "$users/$userID/pill_sheet_modified_histories"; - static String schedule( - {required String userID, required String scheduleID}) => - "$users/$userID/schedules/$scheduleID"; - static String schedules({required String userID}) => - "$users/$userID/schedules"; + static String pillSheetModifiedHistories(String userID) => "$users/$userID/pill_sheet_modified_histories"; + static String schedule({required String userID, required String scheduleID}) => "$users/$userID/schedules/$scheduleID"; + static String schedules({required String userID}) => "$users/$userID/schedules"; static String pilllAds() => "globals/pilll_ads"; } @@ -49,150 +43,86 @@ class DatabaseConnection { String get userID => _userID!; final String? _userID; - final FromFirestore _userFromFirestore = (snapshot, options) => - User.fromJson(snapshot.data()!..putIfAbsent("id", () => snapshot.id)); + final FromFirestore _userFromFirestore = (snapshot, options) => User.fromJson(snapshot.data()!..putIfAbsent("id", () => snapshot.id)); final ToFirestore _userToFirestore = (user, options) => user.toJson(); - DocumentReference userReference() => FirebaseFirestore.instance - .collection(_CollectionPath.users) - .doc(userID) - .withConverter( + DocumentReference userReference() => FirebaseFirestore.instance.collection(_CollectionPath.users).doc(userID).withConverter( fromFirestore: _userFromFirestore, toFirestore: _userToFirestore, ); - DocumentReference userRawReference() => - FirebaseFirestore.instance.collection(_CollectionPath.users).doc(userID); - - final FromFirestore _diarySettingFromFirestore = - (snapshot, options) => DiarySetting.fromJson(snapshot.data()!); - final ToFirestore _diarySettingToFirestore = - (diarySetting, options) => diarySetting.toJson(); - DocumentReference diarySettingReference() => - FirebaseFirestore.instance - .collection(_CollectionPath.settings(userID)) - .doc("diary") - .withConverter( - fromFirestore: _diarySettingFromFirestore, - toFirestore: _diarySettingToFirestore, - ); + DocumentReference userRawReference() => FirebaseFirestore.instance.collection(_CollectionPath.users).doc(userID); + + final FromFirestore _diarySettingFromFirestore = (snapshot, options) => DiarySetting.fromJson(snapshot.data()!); + final ToFirestore _diarySettingToFirestore = (diarySetting, options) => diarySetting.toJson(); + DocumentReference diarySettingReference() => FirebaseFirestore.instance.collection(_CollectionPath.settings(userID)).doc("diary").withConverter( + fromFirestore: _diarySettingFromFirestore, + toFirestore: _diarySettingToFirestore, + ); - final FromFirestore _diaryFromFirestore = - (snapshot, options) => Diary.fromJson(snapshot.data()!); - final ToFirestore _diaryToFirestore = - (diary, options) => diary.toJson(); - CollectionReference diariesReference() => FirebaseFirestore.instance - .collection(_CollectionPath.diaries(userID)) - .withConverter( + final FromFirestore _diaryFromFirestore = (snapshot, options) => Diary.fromJson(snapshot.data()!); + final ToFirestore _diaryToFirestore = (diary, options) => diary.toJson(); + CollectionReference diariesReference() => FirebaseFirestore.instance.collection(_CollectionPath.diaries(userID)).withConverter( + fromFirestore: _diaryFromFirestore, + toFirestore: _diaryToFirestore, + ); + DocumentReference diaryReference(Diary diary) => FirebaseFirestore.instance.collection(_CollectionPath.diaries(userID)).doc(diary.id).withConverter( fromFirestore: _diaryFromFirestore, toFirestore: _diaryToFirestore, ); - DocumentReference diaryReference(Diary diary) => - FirebaseFirestore.instance - .collection(_CollectionPath.diaries(userID)) - .doc(diary.id) - .withConverter( - fromFirestore: _diaryFromFirestore, - toFirestore: _diaryToFirestore, - ); - DocumentReference userPrivateRawReference() => FirebaseFirestore.instance - .collection(_CollectionPath.userPrivates(userID)) - .doc(userID); - - final FromFirestore _menstruationFromFirestore = - (snapshot, options) => Menstruation.fromJson( - snapshot.data()!..putIfAbsent("id", () => snapshot.id)); - final ToFirestore _menstruationToFirestore = - (menstruation, options) => menstruation.toJson(); - CollectionReference menstruationsReference() => - FirebaseFirestore.instance - .collection(_CollectionPath.menstruations(userID)) - .withConverter( - fromFirestore: _menstruationFromFirestore, - toFirestore: _menstruationToFirestore, - ); - DocumentReference menstruationReference( - String? menstruationID) => - FirebaseFirestore.instance - .collection(_CollectionPath.menstruations(userID)) - .doc(menstruationID) - .withConverter( - fromFirestore: _menstruationFromFirestore, - toFirestore: _menstruationToFirestore, - ); + DocumentReference userPrivateRawReference() => FirebaseFirestore.instance.collection(_CollectionPath.userPrivates(userID)).doc(userID); - final FromFirestore - _pillSheetModifiedHistoryFromFirestore = (snapshot, options) => - PillSheetModifiedHistory.fromJson( - snapshot.data()!..putIfAbsent("id", () => snapshot.id)); - final ToFirestore - _pillSheetModifiedHistoryToFirestore = - (history, options) => history.toJson(); - CollectionReference - pillSheetModifiedHistoriesReference() => FirebaseFirestore.instance - .collection(_CollectionPath.pillSheetModifiedHistories(userID)) - .withConverter( - fromFirestore: _pillSheetModifiedHistoryFromFirestore, - toFirestore: _pillSheetModifiedHistoryToFirestore, - ); - DocumentReference pillSheetModifiedHistoryReference( - {required String? pillSheetModifiedHistoryID}) => - FirebaseFirestore.instance - .collection(_CollectionPath.pillSheetModifiedHistories(userID)) - .doc(pillSheetModifiedHistoryID) - .withConverter( + final FromFirestore _menstruationFromFirestore = (snapshot, options) => Menstruation.fromJson(snapshot.data()!..putIfAbsent("id", () => snapshot.id)); + final ToFirestore _menstruationToFirestore = (menstruation, options) => menstruation.toJson(); + CollectionReference menstruationsReference() => FirebaseFirestore.instance.collection(_CollectionPath.menstruations(userID)).withConverter( + fromFirestore: _menstruationFromFirestore, + toFirestore: _menstruationToFirestore, + ); + DocumentReference menstruationReference(String? menstruationID) => FirebaseFirestore.instance.collection(_CollectionPath.menstruations(userID)).doc(menstruationID).withConverter( + fromFirestore: _menstruationFromFirestore, + toFirestore: _menstruationToFirestore, + ); + + final FromFirestore _pillSheetModifiedHistoryFromFirestore = + (snapshot, options) => PillSheetModifiedHistory.fromJson(snapshot.data()!..putIfAbsent("id", () => snapshot.id)); + final ToFirestore _pillSheetModifiedHistoryToFirestore = (history, options) => history.toJson(); + CollectionReference pillSheetModifiedHistoriesReference() => FirebaseFirestore.instance.collection(_CollectionPath.pillSheetModifiedHistories(userID)).withConverter( + fromFirestore: _pillSheetModifiedHistoryFromFirestore, + toFirestore: _pillSheetModifiedHistoryToFirestore, + ); + DocumentReference pillSheetModifiedHistoryReference({required String? pillSheetModifiedHistoryID}) => + FirebaseFirestore.instance.collection(_CollectionPath.pillSheetModifiedHistories(userID)).doc(pillSheetModifiedHistoryID).withConverter( fromFirestore: _pillSheetModifiedHistoryFromFirestore, toFirestore: _pillSheetModifiedHistoryToFirestore, ); - final FromFirestore _pillSheetGroupFromFirestore = - (snapshot, options) => PillSheetGroup.fromJson( - snapshot.data()!..putIfAbsent("id", () => snapshot.id)); - final ToFirestore _pillSheetGroupToFirestore = - (pillSheetGroup, options) => pillSheetGroup.toJson(); - CollectionReference pillSheetGroupsReference() => - FirebaseFirestore.instance - .collection(_CollectionPath.pillSheetGroups(userID)) - .withConverter( - fromFirestore: _pillSheetGroupFromFirestore, - toFirestore: _pillSheetGroupToFirestore, - ); + final FromFirestore _pillSheetGroupFromFirestore = (snapshot, options) => PillSheetGroup.fromJson(snapshot.data()!..putIfAbsent("id", () => snapshot.id)); + final ToFirestore _pillSheetGroupToFirestore = (pillSheetGroup, options) => pillSheetGroup.toJson(); + CollectionReference pillSheetGroupsReference() => FirebaseFirestore.instance.collection(_CollectionPath.pillSheetGroups(userID)).withConverter( + fromFirestore: _pillSheetGroupFromFirestore, + toFirestore: _pillSheetGroupToFirestore, + ); - DocumentReference pillSheetGroupReference( - String? pillSheetGroupID) => - FirebaseFirestore.instance - .collection(_CollectionPath.pillSheetGroups(userID)) - .doc(pillSheetGroupID) - .withConverter( + DocumentReference pillSheetGroupReference(String? pillSheetGroupID) => + FirebaseFirestore.instance.collection(_CollectionPath.pillSheetGroups(userID)).doc(pillSheetGroupID).withConverter( fromFirestore: _pillSheetGroupFromFirestore, toFirestore: _pillSheetGroupToFirestore, ); - final FromFirestore _scheduleFromFirestore = (snapshot, options) => - Schedule.fromJson(snapshot.data()!..putIfAbsent("id", () => snapshot.id)); - final ToFirestore _scheduleToFirestore = - (schedule, options) => schedule.toJson(); - CollectionReference schedulesReference() => - FirebaseFirestore.instance - .collection(_CollectionPath.schedules(userID: userID)) - .withConverter( - fromFirestore: _scheduleFromFirestore, - toFirestore: _scheduleToFirestore, - ); - DocumentReference scheduleReference(String scheduleID) => - FirebaseFirestore.instance - .doc(_CollectionPath.schedule(userID: userID, scheduleID: scheduleID)) - .withConverter( - fromFirestore: _scheduleFromFirestore, - toFirestore: _scheduleToFirestore, - ); + final FromFirestore _scheduleFromFirestore = (snapshot, options) => Schedule.fromJson(snapshot.data()!..putIfAbsent("id", () => snapshot.id)); + final ToFirestore _scheduleToFirestore = (schedule, options) => schedule.toJson(); + CollectionReference schedulesReference() => FirebaseFirestore.instance.collection(_CollectionPath.schedules(userID: userID)).withConverter( + fromFirestore: _scheduleFromFirestore, + toFirestore: _scheduleToFirestore, + ); + DocumentReference scheduleReference(String scheduleID) => FirebaseFirestore.instance.doc(_CollectionPath.schedule(userID: userID, scheduleID: scheduleID)).withConverter( + fromFirestore: _scheduleFromFirestore, + toFirestore: _scheduleToFirestore, + ); - DocumentReference pilllAds() => - FirebaseFirestore.instance.doc(_CollectionPath.pilllAds()).withConverter( - fromFirestore: (snapshot, options) => snapshot.data() == null - ? null - : PilllAds.fromJson(snapshot.data()!), - toFirestore: (_, __) => throw UnimplementedError(), - ); + DocumentReference pilllAds() => FirebaseFirestore.instance.doc(_CollectionPath.pilllAds()).withConverter( + fromFirestore: (snapshot, options) => snapshot.data() == null ? null : PilllAds.fromJson(snapshot.data()!), + toFirestore: (_, __) => throw UnimplementedError(), + ); Future transaction(TransactionHandler transactionHandler) { return FirebaseFirestore.instance.runTransaction(transactionHandler); diff --git a/lib/provider/database.g.dart b/lib/provider/database.g.dart index 7f3a698981..cbbc6947ea 100644 --- a/lib/provider/database.g.dart +++ b/lib/provider/database.g.dart @@ -13,13 +13,9 @@ String _$databaseHash() => r'53bd867abd95fdb4edf15dcc60ae4af5424e11e2'; final databaseProvider = Provider.internal( database, name: r'databaseProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') ? null : _$databaseHash, + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') ? null : _$databaseHash, dependencies: [firebaseUserStateProvider], - allTransitiveDependencies: { - firebaseUserStateProvider, - ...?firebaseUserStateProvider.allTransitiveDependencies - }, + allTransitiveDependencies: {firebaseUserStateProvider, ...?firebaseUserStateProvider.allTransitiveDependencies}, ); typedef DatabaseRef = ProviderRef; diff --git a/lib/provider/delete_pill_sheet.dart b/lib/provider/delete_pill_sheet.dart index 88e6c22148..8bd44c5a24 100644 --- a/lib/provider/delete_pill_sheet.dart +++ b/lib/provider/delete_pill_sheet.dart @@ -20,21 +20,16 @@ class DeletePillSheetGroup { final BatchSetPillSheetModifiedHistory batchSetPillSheetModifiedHistory; final BatchSetPillSheetGroup batchSetPillSheetGroup; - DeletePillSheetGroup(this.batchFactory, this.batchSetPillSheetModifiedHistory, - this.batchSetPillSheetGroup); + DeletePillSheetGroup(this.batchFactory, this.batchSetPillSheetModifiedHistory, this.batchSetPillSheetGroup); Future call({ required PillSheetGroup latestPillSheetGroup, required PillSheet activePillSheet, }) async { final batch = batchFactory.batch(); - final updatedPillSheet = - activePillSheet.copyWith(deletedAt: DateTime.now()); - final updatedPillSheetGroup = latestPillSheetGroup - .replaced(updatedPillSheet) - .copyWith(deletedAt: DateTime.now()); - final history = PillSheetModifiedHistoryServiceActionFactory - .createDeletedPillSheetAction( + final updatedPillSheet = activePillSheet.copyWith(deletedAt: DateTime.now()); + final updatedPillSheetGroup = latestPillSheetGroup.replaced(updatedPillSheet).copyWith(deletedAt: DateTime.now()); + final history = PillSheetModifiedHistoryServiceActionFactory.createDeletedPillSheetAction( pillSheetGroupID: latestPillSheetGroup.id, pillSheetIDs: latestPillSheetGroup.pillSheetIDs, beforePillSheetGroup: latestPillSheetGroup, diff --git a/lib/provider/diary.dart b/lib/provider/diary.dart index f0cf7e618d..efbc1b1f21 100644 --- a/lib/provider/diary.dart +++ b/lib/provider/diary.dart @@ -17,8 +17,7 @@ final diaryForTodayProvider = StreamProvider((ref) { .snapshots() .map((event) => event.docs.map((e) => e.data()).toList().lastOrNull); }); -final diariesForMonthProvider = - StreamProvider.family((ref, DateTime dateForMonth) { +final diariesForMonthProvider = StreamProvider.family((ref, DateTime dateForMonth) { final range = MonthDateTimeRange.monthRange(dateForMonth: dateForMonth); return ref .watch(databaseProvider) @@ -37,9 +36,7 @@ final diariesFor90Days = StreamProvider.family((ref, DateTime base) { return ref .watch(databaseProvider) .diariesReference() - .where(DiaryFirestoreKey.date, - isLessThanOrEqualTo: DateTime(base.year, base.month, 90), - isGreaterThanOrEqualTo: DateTime(base.year, base.month, -90)) + .where(DiaryFirestoreKey.date, isLessThanOrEqualTo: DateTime(base.year, base.month, 90), isGreaterThanOrEqualTo: DateTime(base.year, base.month, -90)) .orderBy(DiaryFirestoreKey.date) .snapshots() .map((event) => event.docs.map((e) => e.data()).toList()) @@ -53,29 +50,21 @@ List _sortedDiaries(List diaries) { } final diaryProvider = Provider.family((ref, DateTime date) { - return ref - .watch(diariesForMonthProvider(date)) - .asData - ?.value - .firstWhereOrNull((element) => element.date == date); + return ref.watch(diariesForMonthProvider(date)).asData?.value.firstWhereOrNull((element) => element.date == date); }); -final setDiaryProvider = - Provider((ref) => SetDiary(ref.watch(databaseProvider))); +final setDiaryProvider = Provider((ref) => SetDiary(ref.watch(databaseProvider))); class SetDiary { final DatabaseConnection databaseConnection; SetDiary(this.databaseConnection); Future call(Diary diary) async { - await databaseConnection - .diaryReference(diary) - .set(diary, SetOptions(merge: true)); + await databaseConnection.diaryReference(diary).set(diary, SetOptions(merge: true)); } } -final deleteDiaryProvider = - Provider((ref) => DeleteDiary(ref.watch(databaseProvider))); +final deleteDiaryProvider = Provider((ref) => DeleteDiary(ref.watch(databaseProvider))); class DeleteDiary { final DatabaseConnection databaseConnection; diff --git a/lib/provider/diary_setting.dart b/lib/provider/diary_setting.dart index 0803b6fc11..4a5c19f5b2 100644 --- a/lib/provider/diary_setting.dart +++ b/lib/provider/diary_setting.dart @@ -2,8 +2,4 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:pilll/provider/database.dart'; import 'package:pilll/entity/diary_setting.codegen.dart'; -final diarySettingProvider = StreamProvider((ref) => ref - .watch(databaseProvider) - .diarySettingReference() - .snapshots() - .map((event) => event.data())); +final diarySettingProvider = StreamProvider((ref) => ref.watch(databaseProvider).diarySettingReference().snapshots().map((event) => event.data())); diff --git a/lib/provider/force_update.dart b/lib/provider/force_update.dart index 5a2832e6bd..53d8d7d3a7 100644 --- a/lib/provider/force_update.dart +++ b/lib/provider/force_update.dart @@ -16,8 +16,7 @@ class CheckForceUpdate { final config = Config.fromJson(doc.data() as Map); final packageVersion = await Version.fromPackage(); - final forceUpdate = packageVersion - .isLessThan(Version.parse(config.minimumSupportedAppVersion)); + final forceUpdate = packageVersion.isLessThan(Version.parse(config.minimumSupportedAppVersion)); if (forceUpdate) { analytics.logEvent( name: "screen_type_force_update", diff --git a/lib/provider/locale.dart b/lib/provider/locale.dart index a07d41fb11..fa9503f057 100644 --- a/lib/provider/locale.dart +++ b/lib/provider/locale.dart @@ -3,5 +3,4 @@ import 'dart:io'; import 'package:riverpod/riverpod.dart'; final localeNameProvider = Provider.autoDispose((_) => Platform.localeName); -final isJaLocaleProvider = - Provider.autoDispose((ref) => Platform.localeName.contains("_JP")); +final isJaLocaleProvider = Provider.autoDispose((ref) => Platform.localeName.contains("_JP")); diff --git a/lib/provider/menstruation.dart b/lib/provider/menstruation.dart index 9f797d01cd..2d9c056c93 100644 --- a/lib/provider/menstruation.dart +++ b/lib/provider/menstruation.dart @@ -15,39 +15,27 @@ final allMenstruationProvider = StreamProvider>((ref) => ref .orderBy(MenstruationFirestoreKey.beginDate, descending: true) .snapshots() .map((event) => event.docs.map((doc) => doc.data()).toList()) - .map((value) => - value.where((element) => element.deletedAt == null).toList())); -final latestMenstruationProvider = Provider((ref) => ref - .watch(allMenstruationProvider) - .whenData((menstruations) => menstruations.firstOrNull)); + .map((value) => value.where((element) => element.deletedAt == null).toList())); +final latestMenstruationProvider = Provider((ref) => ref.watch(allMenstruationProvider).whenData((menstruations) => menstruations.firstOrNull)); -final beginMenstruationProvider = - Provider((ref) => BeginMenstruation(ref.watch(databaseProvider))); +final beginMenstruationProvider = Provider((ref) => BeginMenstruation(ref.watch(databaseProvider))); class BeginMenstruation { final DatabaseConnection databaseConnection; BeginMenstruation(this.databaseConnection); Future call(DateTime begin, DateTime end) async { - var menstruation = - Menstruation(beginDate: begin, endDate: end, createdAt: now()); + var menstruation = Menstruation(beginDate: begin, endDate: end, createdAt: now()); if (await _canHealthkitDataSave()) { - final healthKitSampleDataUUID = - await addMenstruationFlowHealthKitData(menstruation); - menstruation = menstruation.copyWith( - healthKitSampleDataUUID: healthKitSampleDataUUID); + final healthKitSampleDataUUID = await addMenstruationFlowHealthKitData(menstruation); + menstruation = menstruation.copyWith(healthKitSampleDataUUID: healthKitSampleDataUUID); } - return await databaseConnection - .menstruationsReference() - .add(menstruation) - .then((event) => event.get()) - .then((value) => value.data()!); + return await databaseConnection.menstruationsReference().add(menstruation).then((event) => event.get()).then((value) => value.data()!); } } -final setMenstruationProvider = - Provider((ref) => SetMenstruation(ref.watch(databaseProvider))); +final setMenstruationProvider = Provider((ref) => SetMenstruation(ref.watch(databaseProvider))); class SetMenstruation { final DatabaseConnection databaseConnection; @@ -56,37 +44,29 @@ class SetMenstruation { var mutableMenstruation = menstruation; if (mutableMenstruation.id == null) { if (await _canHealthkitDataSave()) { - final healthKitSampleDataUUID = - await addMenstruationFlowHealthKitData(mutableMenstruation); - mutableMenstruation = mutableMenstruation.copyWith( - healthKitSampleDataUUID: healthKitSampleDataUUID); + final healthKitSampleDataUUID = await addMenstruationFlowHealthKitData(mutableMenstruation); + mutableMenstruation = mutableMenstruation.copyWith(healthKitSampleDataUUID: healthKitSampleDataUUID); } } else { if (await _healthKitDateDidSave(menstruation: mutableMenstruation)) { - final healthKitSampleDataUUID = - await updateOrAddMenstruationFlowHealthKitData(mutableMenstruation); - mutableMenstruation = mutableMenstruation.copyWith( - healthKitSampleDataUUID: healthKitSampleDataUUID); + final healthKitSampleDataUUID = await updateOrAddMenstruationFlowHealthKitData(mutableMenstruation); + mutableMenstruation = mutableMenstruation.copyWith(healthKitSampleDataUUID: healthKitSampleDataUUID); } } - final doc = - databaseConnection.menstruationReference(mutableMenstruation.id); + final doc = databaseConnection.menstruationReference(mutableMenstruation.id); await doc.set(mutableMenstruation, SetOptions(merge: true)); return mutableMenstruation.copyWith(id: doc.id); } } -final deleteMenstruationProvider = - Provider((ref) => DeleteMenstruation(ref.watch(databaseProvider))); +final deleteMenstruationProvider = Provider((ref) => DeleteMenstruation(ref.watch(databaseProvider))); class DeleteMenstruation { final DatabaseConnection databaseConnection; DeleteMenstruation(this.databaseConnection); Future call(Menstruation menstruation) async { - await databaseConnection - .menstruationReference(menstruation.id) - .update({MenstruationFirestoreKey.deletedAt: now()}); + await databaseConnection.menstruationReference(menstruation.id).update({MenstruationFirestoreKey.deletedAt: now()}); // DBに書き込んでからヘルスケアの削除を行う。DBに書き込んでからヘルスケアの更新に失敗しても大した問題では無い // また、ヘルスケアの削除はヘルスケアアプリの方で実行できてしまうためデータが存在しておらずエラーになることが度々発生するため後に実行する if (await _healthKitDateDidSave(menstruation: menstruation)) { diff --git a/lib/provider/pill_sheet_group.dart b/lib/provider/pill_sheet_group.dart index 5ee4fccc5b..569748f151 100644 --- a/lib/provider/pill_sheet_group.dart +++ b/lib/provider/pill_sheet_group.dart @@ -15,48 +15,27 @@ PillSheetGroup? _filter(QuerySnapshot snapshot) { } // 最新のピルシートグループを取得する。ピルシートグループが初期設定で作られないパターンもあるのでNullable -Future fetchLatestPillSheetGroup( - DatabaseConnection databaseConnection) async { - return (await databaseConnection - .pillSheetGroupsReference() - .orderBy(PillSheetGroupFirestoreKeys.createdAt) - .limitToLast(1) - .get()) - .docs - .lastOrNull - ?.data(); +Future fetchLatestPillSheetGroup(DatabaseConnection databaseConnection) async { + return (await databaseConnection.pillSheetGroupsReference().orderBy(PillSheetGroupFirestoreKeys.createdAt).limitToLast(1).get()).docs.lastOrNull?.data(); } // 最新のピルシートグループの.activePillSheetを取得する。 @Riverpod(dependencies: [latestPillSheetGroup]) AsyncValue activePillSheet(ActivePillSheetRef ref) { - return ref - .watch(latestPillSheetGroupProvider) - .whenData((value) => value?.activePillSheet); + return ref.watch(latestPillSheetGroupProvider).whenData((value) => value?.activePillSheet); } @Riverpod(dependencies: [database]) Stream latestPillSheetGroup(LatestPillSheetGroupRef ref) { // 最新のピルシートグループを取得する。ピルシートグループが初期設定で作られないパターンもあるのでNullable - return ref - .watch(databaseProvider) - .pillSheetGroupsReference() - .orderBy(PillSheetGroupFirestoreKeys.createdAt) - .limitToLast(1) - .snapshots(includeMetadataChanges: true) - .map(((event) => _filter(event))); + return ref.watch(databaseProvider).pillSheetGroupsReference().orderBy(PillSheetGroupFirestoreKeys.createdAt).limitToLast(1).snapshots(includeMetadataChanges: true).map(((event) => _filter(event))); } // 一つ前のピルシートグループを取得する。破棄されたピルシートグループは現在含んでいるが含めないようにしても良い。インデックスを作成する必要があるので避けている @Riverpod(dependencies: [database]) -Future beforePillSheetGroup( - BeforePillSheetGroupRef ref) async { +Future beforePillSheetGroup(BeforePillSheetGroupRef ref) async { final database = ref.watch(databaseProvider); - final snapshot = await database - .pillSheetGroupsReference() - .orderBy(PillSheetGroupFirestoreKeys.createdAt) - .limitToLast(2) - .get(); + final snapshot = await database.pillSheetGroupsReference().orderBy(PillSheetGroupFirestoreKeys.createdAt).limitToLast(2).get(); if (snapshot.docs.isEmpty) { return null; @@ -97,8 +76,6 @@ class SetPillSheetGroup { SetPillSheetGroup(this.databaseConnection); Future call(PillSheetGroup pillSheetGroup) async { - await databaseConnection - .pillSheetGroupReference(pillSheetGroup.id) - .set(pillSheetGroup, SetOptions(merge: true)); + await databaseConnection.pillSheetGroupReference(pillSheetGroup.id).set(pillSheetGroup, SetOptions(merge: true)); } } diff --git a/lib/provider/pill_sheet_group.g.dart b/lib/provider/pill_sheet_group.g.dart index 35a11de948..f2f9a0f429 100644 --- a/lib/provider/pill_sheet_group.g.dart +++ b/lib/provider/pill_sheet_group.g.dart @@ -10,98 +10,64 @@ String _$activePillSheetHash() => r'd97b98bec663ae25286aba1eed3305df7766dd7c'; /// See also [activePillSheet]. @ProviderFor(activePillSheet) -final activePillSheetProvider = - AutoDisposeProvider>.internal( +final activePillSheetProvider = AutoDisposeProvider>.internal( activePillSheet, name: r'activePillSheetProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$activePillSheetHash, + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') ? null : _$activePillSheetHash, dependencies: [latestPillSheetGroupProvider], - allTransitiveDependencies: { - latestPillSheetGroupProvider, - ...?latestPillSheetGroupProvider.allTransitiveDependencies - }, + allTransitiveDependencies: {latestPillSheetGroupProvider, ...?latestPillSheetGroupProvider.allTransitiveDependencies}, ); typedef ActivePillSheetRef = AutoDisposeProviderRef>; -String _$latestPillSheetGroupHash() => - r'adbedcc318008da31341d1d1f7484b1594464365'; +String _$latestPillSheetGroupHash() => r'adbedcc318008da31341d1d1f7484b1594464365'; /// See also [latestPillSheetGroup]. @ProviderFor(latestPillSheetGroup) -final latestPillSheetGroupProvider = - AutoDisposeStreamProvider.internal( +final latestPillSheetGroupProvider = AutoDisposeStreamProvider.internal( latestPillSheetGroup, name: r'latestPillSheetGroupProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$latestPillSheetGroupHash, + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') ? null : _$latestPillSheetGroupHash, dependencies: [databaseProvider], - allTransitiveDependencies: { - databaseProvider, - ...?databaseProvider.allTransitiveDependencies - }, + allTransitiveDependencies: {databaseProvider, ...?databaseProvider.allTransitiveDependencies}, ); typedef LatestPillSheetGroupRef = AutoDisposeStreamProviderRef; -String _$beforePillSheetGroupHash() => - r'8cd3b068ebd5024ff92e229b4f1620a5a621d11f'; +String _$beforePillSheetGroupHash() => r'8cd3b068ebd5024ff92e229b4f1620a5a621d11f'; /// See also [beforePillSheetGroup]. @ProviderFor(beforePillSheetGroup) -final beforePillSheetGroupProvider = - AutoDisposeFutureProvider.internal( +final beforePillSheetGroupProvider = AutoDisposeFutureProvider.internal( beforePillSheetGroup, name: r'beforePillSheetGroupProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$beforePillSheetGroupHash, + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') ? null : _$beforePillSheetGroupHash, dependencies: [databaseProvider], - allTransitiveDependencies: { - databaseProvider, - ...?databaseProvider.allTransitiveDependencies - }, + allTransitiveDependencies: {databaseProvider, ...?databaseProvider.allTransitiveDependencies}, ); typedef BeforePillSheetGroupRef = AutoDisposeFutureProviderRef; -String _$batchSetPillSheetGroupHash() => - r'69769ffb3eb87ea3fe0d7b0eada4f447fa9fd0d4'; +String _$batchSetPillSheetGroupHash() => r'69769ffb3eb87ea3fe0d7b0eada4f447fa9fd0d4'; /// See also [batchSetPillSheetGroup]. @ProviderFor(batchSetPillSheetGroup) -final batchSetPillSheetGroupProvider = - AutoDisposeProvider.internal( +final batchSetPillSheetGroupProvider = AutoDisposeProvider.internal( batchSetPillSheetGroup, name: r'batchSetPillSheetGroupProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$batchSetPillSheetGroupHash, + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') ? null : _$batchSetPillSheetGroupHash, dependencies: [databaseProvider], - allTransitiveDependencies: { - databaseProvider, - ...?databaseProvider.allTransitiveDependencies - }, + allTransitiveDependencies: {databaseProvider, ...?databaseProvider.allTransitiveDependencies}, ); -typedef BatchSetPillSheetGroupRef - = AutoDisposeProviderRef; +typedef BatchSetPillSheetGroupRef = AutoDisposeProviderRef; String _$setPillSheetGroupHash() => r'c8f16da419ae0bd4ad77f2d95070189c3a748f4c'; /// See also [setPillSheetGroup]. @ProviderFor(setPillSheetGroup) -final setPillSheetGroupProvider = - AutoDisposeProvider.internal( +final setPillSheetGroupProvider = AutoDisposeProvider.internal( setPillSheetGroup, name: r'setPillSheetGroupProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$setPillSheetGroupHash, + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') ? null : _$setPillSheetGroupHash, dependencies: [databaseProvider], - allTransitiveDependencies: { - databaseProvider, - ...?databaseProvider.allTransitiveDependencies - }, + allTransitiveDependencies: {databaseProvider, ...?databaseProvider.allTransitiveDependencies}, ); typedef SetPillSheetGroupRef = AutoDisposeProviderRef; diff --git a/lib/provider/pill_sheet_modified_history.dart b/lib/provider/pill_sheet_modified_history.dart index 166eb45048..902eb70285 100644 --- a/lib/provider/pill_sheet_modified_history.dart +++ b/lib/provider/pill_sheet_modified_history.dart @@ -7,20 +7,16 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'pill_sheet_modified_history.g.dart'; @Riverpod(dependencies: [database]) -Stream> pillSheetModifiedHistoriesWithLimit( - PillSheetModifiedHistoriesWithLimitRef ref, - {required int limit}) { +Stream> pillSheetModifiedHistoriesWithLimit(PillSheetModifiedHistoriesWithLimitRef ref, {required int limit}) { return ref .watch(databaseProvider) .pillSheetModifiedHistoriesReference() .where( PillSheetModifiedHistoryFirestoreKeys.estimatedEventCausingDate, isLessThanOrEqualTo: today().add(const Duration(days: 1)), - isGreaterThanOrEqualTo: today().subtract(const Duration( - days: PillSheetModifiedHistoryServiceActionFactory.limitDays)), + isGreaterThanOrEqualTo: today().subtract(const Duration(days: PillSheetModifiedHistoryServiceActionFactory.limitDays)), ) - .orderBy(PillSheetModifiedHistoryFirestoreKeys.estimatedEventCausingDate, - descending: true) + .orderBy(PillSheetModifiedHistoryFirestoreKeys.estimatedEventCausingDate, descending: true) .limit(limit) .snapshots() .map((reference) => reference.docs) @@ -46,40 +42,30 @@ Stream> pillSheetModifiedHistoriesWithRange( isLessThanOrEqualTo: end.endOfDay(), isGreaterThanOrEqualTo: begin.date(), ) - .orderBy(PillSheetModifiedHistoryFirestoreKeys.estimatedEventCausingDate, - descending: true) + .orderBy(PillSheetModifiedHistoryFirestoreKeys.estimatedEventCausingDate, descending: true) .snapshots() .map((reference) => reference.docs) .map((docs) => docs.map((doc) => doc.data()).toList()); } -final batchSetPillSheetModifiedHistoryProvider = Provider( - (ref) => BatchSetPillSheetModifiedHistory(ref.watch(databaseProvider))); +final batchSetPillSheetModifiedHistoryProvider = Provider((ref) => BatchSetPillSheetModifiedHistory(ref.watch(databaseProvider))); class BatchSetPillSheetModifiedHistory { final DatabaseConnection databaseConnection; BatchSetPillSheetModifiedHistory(this.databaseConnection); void call(WriteBatch batch, PillSheetModifiedHistory history) async { - batch.set( - databaseConnection.pillSheetModifiedHistoryReference( - pillSheetModifiedHistoryID: null), - history, - SetOptions(merge: true)); + batch.set(databaseConnection.pillSheetModifiedHistoryReference(pillSheetModifiedHistoryID: null), history, SetOptions(merge: true)); } } -final setPillSheetModifiedHistoryProvider = - Provider((ref) => SetPillSheetModifiedHistory(ref.watch(databaseProvider))); +final setPillSheetModifiedHistoryProvider = Provider((ref) => SetPillSheetModifiedHistory(ref.watch(databaseProvider))); class SetPillSheetModifiedHistory { final DatabaseConnection databaseConnection; SetPillSheetModifiedHistory(this.databaseConnection); Future call(PillSheetModifiedHistory history) async { - await databaseConnection - .pillSheetModifiedHistoryReference( - pillSheetModifiedHistoryID: history.id) - .set(history, SetOptions(merge: true)); + await databaseConnection.pillSheetModifiedHistoryReference(pillSheetModifiedHistoryID: history.id).set(history, SetOptions(merge: true)); } } diff --git a/lib/provider/pill_sheet_modified_history.g.dart b/lib/provider/pill_sheet_modified_history.g.dart index 02fdc8fbd8..377c2a8993 100644 --- a/lib/provider/pill_sheet_modified_history.g.dart +++ b/lib/provider/pill_sheet_modified_history.g.dart @@ -6,8 +6,7 @@ part of 'pill_sheet_modified_history.dart'; // RiverpodGenerator // ************************************************************************** -String _$pillSheetModifiedHistoriesWithLimitHash() => - r'6ce11b768ad4c04c8dd52a6e5dd007d84f8ebca9'; +String _$pillSheetModifiedHistoriesWithLimitHash() => r'6ce11b768ad4c04c8dd52a6e5dd007d84f8ebca9'; /// Copied from Dart SDK class _SystemHash { @@ -32,12 +31,10 @@ class _SystemHash { /// See also [pillSheetModifiedHistoriesWithLimit]. @ProviderFor(pillSheetModifiedHistoriesWithLimit) -const pillSheetModifiedHistoriesWithLimitProvider = - PillSheetModifiedHistoriesWithLimitFamily(); +const pillSheetModifiedHistoriesWithLimitProvider = PillSheetModifiedHistoriesWithLimitFamily(); /// See also [pillSheetModifiedHistoriesWithLimit]. -class PillSheetModifiedHistoriesWithLimitFamily - extends Family>> { +class PillSheetModifiedHistoriesWithLimitFamily extends Family>> { /// See also [pillSheetModifiedHistoriesWithLimit]. const PillSheetModifiedHistoriesWithLimitFamily(); @@ -59,30 +56,22 @@ class PillSheetModifiedHistoriesWithLimitFamily ); } - static final Iterable _dependencies = [ - databaseProvider - ]; + static final Iterable _dependencies = [databaseProvider]; @override Iterable? get dependencies => _dependencies; - static final Iterable _allTransitiveDependencies = - { - databaseProvider, - ...?databaseProvider.allTransitiveDependencies - }; + static final Iterable _allTransitiveDependencies = {databaseProvider, ...?databaseProvider.allTransitiveDependencies}; @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; + Iterable? get allTransitiveDependencies => _allTransitiveDependencies; @override String? get name => r'pillSheetModifiedHistoriesWithLimitProvider'; } /// See also [pillSheetModifiedHistoriesWithLimit]. -class PillSheetModifiedHistoriesWithLimitProvider - extends AutoDisposeStreamProvider> { +class PillSheetModifiedHistoriesWithLimitProvider extends AutoDisposeStreamProvider> { /// See also [pillSheetModifiedHistoriesWithLimit]. PillSheetModifiedHistoriesWithLimitProvider({ required int limit, @@ -93,13 +82,9 @@ class PillSheetModifiedHistoriesWithLimitProvider ), from: pillSheetModifiedHistoriesWithLimitProvider, name: r'pillSheetModifiedHistoriesWithLimitProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$pillSheetModifiedHistoriesWithLimitHash, + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') ? null : _$pillSheetModifiedHistoriesWithLimitHash, dependencies: PillSheetModifiedHistoriesWithLimitFamily._dependencies, - allTransitiveDependencies: PillSheetModifiedHistoriesWithLimitFamily - ._allTransitiveDependencies, + allTransitiveDependencies: PillSheetModifiedHistoriesWithLimitFamily._allTransitiveDependencies, limit: limit, ); @@ -117,9 +102,7 @@ class PillSheetModifiedHistoriesWithLimitProvider @override Override overrideWith( - Stream> Function( - PillSheetModifiedHistoriesWithLimitRef provider) - create, + Stream> Function(PillSheetModifiedHistoriesWithLimitRef provider) create, ) { return ProviderOverride( origin: this, @@ -136,15 +119,13 @@ class PillSheetModifiedHistoriesWithLimitProvider } @override - AutoDisposeStreamProviderElement> - createElement() { + AutoDisposeStreamProviderElement> createElement() { return _PillSheetModifiedHistoriesWithLimitProviderElement(this); } @override bool operator ==(Object other) { - return other is PillSheetModifiedHistoriesWithLimitProvider && - other.limit == limit; + return other is PillSheetModifiedHistoriesWithLimitProvider && other.limit == limit; } @override @@ -156,33 +137,26 @@ class PillSheetModifiedHistoriesWithLimitProvider } } -mixin PillSheetModifiedHistoriesWithLimitRef - on AutoDisposeStreamProviderRef> { +mixin PillSheetModifiedHistoriesWithLimitRef on AutoDisposeStreamProviderRef> { /// The parameter `limit` of this provider. int get limit; } -class _PillSheetModifiedHistoriesWithLimitProviderElement - extends AutoDisposeStreamProviderElement> - with PillSheetModifiedHistoriesWithLimitRef { +class _PillSheetModifiedHistoriesWithLimitProviderElement extends AutoDisposeStreamProviderElement> with PillSheetModifiedHistoriesWithLimitRef { _PillSheetModifiedHistoriesWithLimitProviderElement(super.provider); @override - int get limit => - (origin as PillSheetModifiedHistoriesWithLimitProvider).limit; + int get limit => (origin as PillSheetModifiedHistoriesWithLimitProvider).limit; } -String _$pillSheetModifiedHistoriesWithRangeHash() => - r'ea775de86dd0b2b2bb7879a0fb01e3978df3836d'; +String _$pillSheetModifiedHistoriesWithRangeHash() => r'ea775de86dd0b2b2bb7879a0fb01e3978df3836d'; /// See also [pillSheetModifiedHistoriesWithRange]. @ProviderFor(pillSheetModifiedHistoriesWithRange) -const pillSheetModifiedHistoriesWithRangeProvider = - PillSheetModifiedHistoriesWithRangeFamily(); +const pillSheetModifiedHistoriesWithRangeProvider = PillSheetModifiedHistoriesWithRangeFamily(); /// See also [pillSheetModifiedHistoriesWithRange]. -class PillSheetModifiedHistoriesWithRangeFamily - extends Family>> { +class PillSheetModifiedHistoriesWithRangeFamily extends Family>> { /// See also [pillSheetModifiedHistoriesWithRange]. const PillSheetModifiedHistoriesWithRangeFamily(); @@ -207,30 +181,22 @@ class PillSheetModifiedHistoriesWithRangeFamily ); } - static final Iterable _dependencies = [ - databaseProvider - ]; + static final Iterable _dependencies = [databaseProvider]; @override Iterable? get dependencies => _dependencies; - static final Iterable _allTransitiveDependencies = - { - databaseProvider, - ...?databaseProvider.allTransitiveDependencies - }; + static final Iterable _allTransitiveDependencies = {databaseProvider, ...?databaseProvider.allTransitiveDependencies}; @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; + Iterable? get allTransitiveDependencies => _allTransitiveDependencies; @override String? get name => r'pillSheetModifiedHistoriesWithRangeProvider'; } /// See also [pillSheetModifiedHistoriesWithRange]. -class PillSheetModifiedHistoriesWithRangeProvider - extends StreamProvider> { +class PillSheetModifiedHistoriesWithRangeProvider extends StreamProvider> { /// See also [pillSheetModifiedHistoriesWithRange]. PillSheetModifiedHistoriesWithRangeProvider({ required DateTime begin, @@ -243,13 +209,9 @@ class PillSheetModifiedHistoriesWithRangeProvider ), from: pillSheetModifiedHistoriesWithRangeProvider, name: r'pillSheetModifiedHistoriesWithRangeProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$pillSheetModifiedHistoriesWithRangeHash, + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') ? null : _$pillSheetModifiedHistoriesWithRangeHash, dependencies: PillSheetModifiedHistoriesWithRangeFamily._dependencies, - allTransitiveDependencies: PillSheetModifiedHistoriesWithRangeFamily - ._allTransitiveDependencies, + allTransitiveDependencies: PillSheetModifiedHistoriesWithRangeFamily._allTransitiveDependencies, begin: begin, end: end, ); @@ -270,9 +232,7 @@ class PillSheetModifiedHistoriesWithRangeProvider @override Override overrideWith( - Stream> Function( - PillSheetModifiedHistoriesWithRangeRef provider) - create, + Stream> Function(PillSheetModifiedHistoriesWithRangeRef provider) create, ) { return ProviderOverride( origin: this, @@ -296,9 +256,7 @@ class PillSheetModifiedHistoriesWithRangeProvider @override bool operator ==(Object other) { - return other is PillSheetModifiedHistoriesWithRangeProvider && - other.begin == begin && - other.end == end; + return other is PillSheetModifiedHistoriesWithRangeProvider && other.begin == begin && other.end == end; } @override @@ -311,8 +269,7 @@ class PillSheetModifiedHistoriesWithRangeProvider } } -mixin PillSheetModifiedHistoriesWithRangeRef - on StreamProviderRef> { +mixin PillSheetModifiedHistoriesWithRangeRef on StreamProviderRef> { /// The parameter `begin` of this provider. DateTime get begin; @@ -320,17 +277,13 @@ mixin PillSheetModifiedHistoriesWithRangeRef DateTime get end; } -class _PillSheetModifiedHistoriesWithRangeProviderElement - extends StreamProviderElement> - with PillSheetModifiedHistoriesWithRangeRef { +class _PillSheetModifiedHistoriesWithRangeProviderElement extends StreamProviderElement> with PillSheetModifiedHistoriesWithRangeRef { _PillSheetModifiedHistoriesWithRangeProviderElement(super.provider); @override - DateTime get begin => - (origin as PillSheetModifiedHistoriesWithRangeProvider).begin; + DateTime get begin => (origin as PillSheetModifiedHistoriesWithRangeProvider).begin; @override - DateTime get end => - (origin as PillSheetModifiedHistoriesWithRangeProvider).end; + DateTime get end => (origin as PillSheetModifiedHistoriesWithRangeProvider).end; } // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member diff --git a/lib/provider/pilll_ads.dart b/lib/provider/pilll_ads.dart index d7d39d6ba0..730c56736e 100644 --- a/lib/provider/pilll_ads.dart +++ b/lib/provider/pilll_ads.dart @@ -1,8 +1,4 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:pilll/provider/database.dart'; -final pilllAdsProvider = StreamProvider((ref) => ref - .watch(databaseProvider) - .pilllAds() - .snapshots() - .map((event) => event.data())); +final pilllAdsProvider = StreamProvider((ref) => ref.watch(databaseProvider).pilllAds().snapshots().map((event) => event.data())); diff --git a/lib/provider/purchase.dart b/lib/provider/purchase.dart index b50801e001..ce92b62074 100644 --- a/lib/provider/purchase.dart +++ b/lib/provider/purchase.dart @@ -29,12 +29,9 @@ extension OfferingTypeFunction on OfferingType { } final _purchaseServiceProvider = Provider((ref) => PurchaseService()); -final purchaseOfferingsProvider = FutureProvider( - (ref) => ref.watch(_purchaseServiceProvider).fetchOfferings()); -final currentOfferingTypeProvider = - Provider.family.autoDispose((ref, User user) { - final isOverDiscountDeadline = ref.watch(isOverDiscountDeadlineProvider( - discountEntitlementDeadlineDate: user.discountEntitlementDeadlineDate)); +final purchaseOfferingsProvider = FutureProvider((ref) => ref.watch(_purchaseServiceProvider).fetchOfferings()); +final currentOfferingTypeProvider = Provider.family.autoDispose((ref, User user) { + final isOverDiscountDeadline = ref.watch(isOverDiscountDeadlineProvider(discountEntitlementDeadlineDate: user.discountEntitlementDeadlineDate)); if (!user.hasDiscountEntitlement) { return OfferingType.premium; } @@ -44,42 +41,29 @@ final currentOfferingTypeProvider = return OfferingType.limited; } }); -final currentOfferingPackagesProvider = - Provider.family.autoDispose, User>((ref, User user) { +final currentOfferingPackagesProvider = Provider.family.autoDispose, User>((ref, User user) { final currentOfferingType = ref.watch(currentOfferingTypeProvider(user)); - final offering = ref - .watch(purchaseOfferingsProvider) - .valueOrNull - ?.all[currentOfferingType.identifier]; + final offering = ref.watch(purchaseOfferingsProvider).valueOrNull?.all[currentOfferingType.identifier]; if (offering != null) { return offering.availablePackages; } return []; }); final annualPackageProvider = Provider.family.autoDispose((ref, User user) { - final currentOfferingPackages = - ref.watch(currentOfferingPackagesProvider(user)); - return currentOfferingPackages - .firstWhere((element) => element.packageType == PackageType.annual); + final currentOfferingPackages = ref.watch(currentOfferingPackagesProvider(user)); + return currentOfferingPackages.firstWhere((element) => element.packageType == PackageType.annual); }); final monthlyPackageProvider = Provider.family.autoDispose((ref, User user) { - final currentOfferingPackages = - ref.watch(currentOfferingPackagesProvider(user)); - return currentOfferingPackages - .firstWhere((element) => element.packageType == PackageType.monthly); + final currentOfferingPackages = ref.watch(currentOfferingPackagesProvider(user)); + return currentOfferingPackages.firstWhere((element) => element.packageType == PackageType.monthly); }); -final monthlyPremiumPackageProvider = - Provider.family.autoDispose((ref, User user) { +final monthlyPremiumPackageProvider = Provider.family.autoDispose((ref, User user) { const premiumPackageOfferingType = OfferingType.premium; - final offering = ref - .watch(purchaseOfferingsProvider) - .valueOrNull - ?.all[premiumPackageOfferingType.identifier]; + final offering = ref.watch(purchaseOfferingsProvider).valueOrNull?.all[premiumPackageOfferingType.identifier]; if (offering == null) { return null; } - return offering.availablePackages - .firstWhere((element) => element.packageType == PackageType.monthly); + return offering.availablePackages.firstWhere((element) => element.packageType == PackageType.monthly); }); final purchaseProvider = Provider((ref) => Purchase()); @@ -91,8 +75,7 @@ class Purchase { Future call(Package package) async { try { final purchaserInfo = await Purchases.purchasePackage(package); - final premiumEntitlement = - purchaserInfo.entitlements.all[premiumEntitlements]; + final premiumEntitlement = purchaserInfo.entitlements.all[premiumEntitlements]; if (premiumEntitlement == null) { throw AssertionError("unexpected premium entitlements is not exists"); } @@ -102,11 +85,7 @@ class Purchase { await callUpdatePurchaseInfo(purchaserInfo); return Future.value(true); } on PlatformException catch (exception, stack) { - analytics.logEvent(name: "catched_purchase_exception", parameters: { - "code": exception.code, - "details": exception.details.toString(), - "message": exception.message - }); + analytics.logEvent(name: "catched_purchase_exception", parameters: {"code": exception.code, "details": exception.details.toString(), "message": exception.message}); final newException = mapToDisplayedException(exception); if (newException == null) { return Future.value(false); @@ -143,9 +122,7 @@ Future callUpdatePurchaseInfo(CustomerInfo info) async { analytics.logEvent(name: "start_update_purchase_info"); final uid = firebase_auth.FirebaseAuth.instance.currentUser?.uid; if (uid == null) { - errorLogger.recordError( - "unexpected uid is not found when purchase info is update", - StackTrace.current); + errorLogger.recordError("unexpected uid is not found when purchase info is update", StackTrace.current); return; } @@ -171,17 +148,13 @@ Future syncPurchaseInfo() async { analytics.logEvent(name: "start_sync_purchase_info"); final uid = firebase_auth.FirebaseAuth.instance.currentUser?.uid; if (uid == null) { - errorLogger.recordError( - "unexpected uid is not found when purchase info to sync", - StackTrace.current); + errorLogger.recordError("unexpected uid is not found when purchase info to sync", StackTrace.current); return; } final purchaserInfo = await Purchases.getCustomerInfo(); - final premiumEntitlement = - purchaserInfo.entitlements.all[premiumEntitlements]; - final isActivated = - premiumEntitlement == null ? false : premiumEntitlement.isActive; + final premiumEntitlement = purchaserInfo.entitlements.all[premiumEntitlements]; + final isActivated = premiumEntitlement == null ? false : premiumEntitlement.isActive; try { final syncPurchaseInfo = SyncPurchaseInfo(DatabaseConnection(uid)); @@ -194,10 +167,8 @@ Future syncPurchaseInfo() async { } Future initializePurchase(String uid) async { - await Purchases.setLogLevel( - Environment.isDevelopment ? LogLevel.debug : LogLevel.info); - Purchases.configure( - PurchasesConfiguration(Secret.revenueCatPublicAPIKey)..appUserID = uid); + await Purchases.setLogLevel(Environment.isDevelopment ? LogLevel.debug : LogLevel.info); + Purchases.configure(PurchasesConfiguration(Secret.revenueCatPublicAPIKey)..appUserID = uid); Purchases.addCustomerInfoUpdateListener(callUpdatePurchaseInfo); await syncPurchaseInfo(); } diff --git a/lib/provider/remote_config_parameter.g.dart b/lib/provider/remote_config_parameter.g.dart index 23b5681931..fe35d3279f 100644 --- a/lib/provider/remote_config_parameter.g.dart +++ b/lib/provider/remote_config_parameter.g.dart @@ -6,23 +6,18 @@ part of 'remote_config_parameter.dart'; // RiverpodGenerator // ************************************************************************** -String _$remoteConfigParameterHash() => - r'23c34d845e8be5bcee7eee2cadff31080abe2f6c'; +String _$remoteConfigParameterHash() => r'23c34d845e8be5bcee7eee2cadff31080abe2f6c'; /// See also [remoteConfigParameter]. @ProviderFor(remoteConfigParameter) -final remoteConfigParameterProvider = - AutoDisposeProvider.internal( +final remoteConfigParameterProvider = AutoDisposeProvider.internal( remoteConfigParameter, name: r'remoteConfigParameterProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$remoteConfigParameterHash, + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') ? null : _$remoteConfigParameterHash, dependencies: null, allTransitiveDependencies: null, ); -typedef RemoteConfigParameterRef - = AutoDisposeProviderRef; +typedef RemoteConfigParameterRef = AutoDisposeProviderRef; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member diff --git a/lib/provider/revert_take_pill.dart b/lib/provider/revert_take_pill.dart index c875071fe4..9361d80ea0 100644 --- a/lib/provider/revert_take_pill.dart +++ b/lib/provider/revert_take_pill.dart @@ -11,8 +11,7 @@ import 'package:riverpod/riverpod.dart'; final revertTakePillProvider = Provider.autoDispose( (ref) => RevertTakePill( batchFactory: ref.watch(batchFactoryProvider), - batchSetPillSheetModifiedHistory: - ref.watch(batchSetPillSheetModifiedHistoryProvider), + batchSetPillSheetModifiedHistory: ref.watch(batchSetPillSheetModifiedHistoryProvider), batchSetPillSheetGroup: ref.watch(batchSetPillSheetGroupProvider), ), ); @@ -42,10 +41,7 @@ class RevertTakePill { } final targetPillSheet = pillSheetGroup.pillSheets[pageIndex]; - final revertDate = targetPillSheet - .displayPillTakeDate(targetRevertPillNumberIntoPillSheet) - .subtract(const Duration(days: 1)) - .date(); + final revertDate = targetPillSheet.displayPillTakeDate(targetRevertPillNumberIntoPillSheet).subtract(const Duration(days: 1)).date(); debugPrint("revertDate: $revertDate"); final updatedPillSheets = pillSheetGroup.pillSheets.map((pillSheet) { @@ -66,27 +62,17 @@ class RevertTakePill { if (revertDate.isBefore(pillSheet.beginingDate)) { // reset pill sheet when back to one before pill sheet - return pillSheet.copyWith( - lastTakenDate: - pillSheet.beginingDate.subtract(const Duration(days: 1)).date(), - restDurations: []); + return pillSheet.copyWith(lastTakenDate: pillSheet.beginingDate.subtract(const Duration(days: 1)).date(), restDurations: []); } else { // Revert対象の日付よりも後ろにある休薬期間のデータは消す - final remainingResetDurations = pillSheet.restDurations - .where((restDuration) => - restDuration.beginDate.date().isBefore(revertDate)) - .toList(); - return pillSheet.copyWith( - lastTakenDate: revertDate, restDurations: remainingResetDurations); + final remainingResetDurations = pillSheet.restDurations.where((restDuration) => restDuration.beginDate.date().isBefore(revertDate)).toList(); + return pillSheet.copyWith(lastTakenDate: revertDate, restDurations: remainingResetDurations); } }).toList(); - final updatedPillSheetGroup = - pillSheetGroup.copyWith(pillSheets: updatedPillSheets); + final updatedPillSheetGroup = pillSheetGroup.copyWith(pillSheets: updatedPillSheets); final updatedIndexses = pillSheetGroup.pillSheets.asMap().keys.where( - (index) => - pillSheetGroup.pillSheets[index] != - updatedPillSheetGroup.pillSheets[index], + (index) => pillSheetGroup.pillSheets[index] != updatedPillSheetGroup.pillSheets[index], ); if (updatedIndexses.isEmpty) { @@ -98,8 +84,7 @@ class RevertTakePill { final before = pillSheetGroup.pillSheets[updatedIndexses.last]; final after = updatedPillSheetGroup.pillSheets[updatedIndexses.first]; - final history = PillSheetModifiedHistoryServiceActionFactory - .createRevertTakenPillAction( + final history = PillSheetModifiedHistoryServiceActionFactory.createRevertTakenPillAction( pillSheetGroupID: pillSheetGroup.id, before: before, after: after, diff --git a/lib/provider/schedule.dart b/lib/provider/schedule.dart index b8072554e2..dfce604f38 100644 --- a/lib/provider/schedule.dart +++ b/lib/provider/schedule.dart @@ -17,8 +17,7 @@ final schedulesForDateProvider = StreamProvider.family((ref, DateTime date) { .map((event) => event.docs.map((e) => e.data()).toList()); }); -final schedulesForMonthProvider = - StreamProvider.family((ref, DateTime dateForMonth) { +final schedulesForMonthProvider = StreamProvider.family((ref, DateTime dateForMonth) { final range = MonthDateTimeRange.monthRange(dateForMonth: dateForMonth); return ref .watch(databaseProvider) @@ -36,9 +35,7 @@ final schedules90Days = StreamProvider.family((ref, DateTime base) { return ref .watch(databaseProvider) .schedulesReference() - .where(ScheduleFirestoreKey.date, - isLessThanOrEqualTo: DateTime(base.year, base.month, 90), - isGreaterThanOrEqualTo: DateTime(base.year, base.month, -90)) + .where(ScheduleFirestoreKey.date, isLessThanOrEqualTo: DateTime(base.year, base.month, 90), isGreaterThanOrEqualTo: DateTime(base.year, base.month, -90)) .orderBy(ScheduleFirestoreKey.date) .snapshots() .map((event) => event.docs.map((e) => e.data()).toList()); diff --git a/lib/provider/setting.dart b/lib/provider/setting.dart index 4ba0309e81..26110b6fb3 100644 --- a/lib/provider/setting.dart +++ b/lib/provider/setting.dart @@ -4,30 +4,20 @@ import 'package:pilll/entity/setting.codegen.dart'; import 'package:pilll/entity/user.codegen.dart'; import 'package:riverpod/riverpod.dart'; -final settingProvider = StreamProvider((ref) => ref - .watch(databaseProvider) - .userReference() - .snapshots() - .map((event) => event.data()?.setting) - .where((data) => data != null) - .cast()); +final settingProvider = StreamProvider((ref) => ref.watch(databaseProvider).userReference().snapshots().map((event) => event.data()?.setting).where((data) => data != null).cast()); -final setSettingProvider = - Provider((ref) => SetSetting(ref.watch(databaseProvider))); +final setSettingProvider = Provider((ref) => SetSetting(ref.watch(databaseProvider))); class SetSetting { final DatabaseConnection databaseConnection; SetSetting(this.databaseConnection); Future call(Setting setting) async { - await databaseConnection.userRawReference().set( - {UserFirestoreFieldKeys.settings: setting.toJson()}, - SetOptions(merge: true)); + await databaseConnection.userRawReference().set({UserFirestoreFieldKeys.settings: setting.toJson()}, SetOptions(merge: true)); } } -final batchSetSettingProvider = - Provider((ref) => BatchSetSetting(ref.watch(databaseProvider))); +final batchSetSettingProvider = Provider((ref) => BatchSetSetting(ref.watch(databaseProvider))); class BatchSetSetting { final DatabaseConnection databaseConnection; diff --git a/lib/provider/shared_preferences.dart b/lib/provider/shared_preferences.dart index f01c088e7b..3c7683db4d 100644 --- a/lib/provider/shared_preferences.dart +++ b/lib/provider/shared_preferences.dart @@ -11,11 +11,9 @@ SharedPreferences sharedPreferences(SharedPreferencesRef ref) { throw UnimplementedError("sharedPreferencesProvider is not implemented"); } -final shouldShowMigrationInformationProvider = - FutureProvider.autoDispose((ref) { +final shouldShowMigrationInformationProvider = FutureProvider.autoDispose((ref) { final sharedPreferences = ref.watch(sharedPreferencesProvider); - final migrateFrom132IsShown = - ref.watch(boolSharedPreferencesProvider(BoolKey.migrateFrom132IsShown)); + final migrateFrom132IsShown = ref.watch(boolSharedPreferencesProvider(BoolKey.migrateFrom132IsShown)); if (migrateFrom132IsShown.value ?? false) { return false; } diff --git a/lib/provider/shared_preferences.g.dart b/lib/provider/shared_preferences.g.dart index 8332b5df1d..9cc50d4157 100644 --- a/lib/provider/shared_preferences.g.dart +++ b/lib/provider/shared_preferences.g.dart @@ -13,9 +13,7 @@ String _$sharedPreferencesHash() => r'bb2b6a0d99f4353a7bbeda161fd752d31bb0617b'; final sharedPreferencesProvider = Provider.internal( sharedPreferences, name: r'sharedPreferencesProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$sharedPreferencesHash, + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') ? null : _$sharedPreferencesHash, dependencies: const [], allTransitiveDependencies: const {}, ); diff --git a/lib/provider/take_pill.dart b/lib/provider/take_pill.dart index c13c7519e2..9e26cc4d4b 100644 --- a/lib/provider/take_pill.dart +++ b/lib/provider/take_pill.dart @@ -13,8 +13,7 @@ import 'package:riverpod/riverpod.dart'; final takePillProvider = Provider.autoDispose( (ref) => TakePill( batchFactory: ref.watch(batchFactoryProvider), - batchSetPillSheetModifiedHistory: - ref.watch(batchSetPillSheetModifiedHistoryProvider), + batchSetPillSheetModifiedHistory: ref.watch(batchSetPillSheetModifiedHistoryProvider), batchSetPillSheetGroup: ref.watch(batchSetPillSheetGroupProvider), ), ); @@ -52,8 +51,7 @@ class TakePill { // takenDateよりも予測するピルシートの最終服用日よりも小さい場合は、そのピルシートの最終日で予測する最終服用日を記録する if (takenDate.isAfter(pillSheet.estimatedEndTakenDate)) { - return pillSheet.copyWith( - lastTakenDate: pillSheet.estimatedEndTakenDate); + return pillSheet.copyWith(lastTakenDate: pillSheet.estimatedEndTakenDate); } // takenDateがピルシートの開始日に満たない場合は、記録の対象になっていないので早期リターン @@ -65,10 +63,8 @@ class TakePill { return pillSheet.copyWith(lastTakenDate: takenDate); }).toList(); - final updatedPillSheetGroup = - pillSheetGroup.copyWith(pillSheets: updatedPillSheets); - final updatedIndexses = - pillSheetGroup.pillSheets.asMap().keys.where((index) { + final updatedPillSheetGroup = pillSheetGroup.copyWith(pillSheets: updatedPillSheets); + final updatedIndexses = pillSheetGroup.pillSheets.asMap().keys.where((index) { final updatedPillSheet = updatedPillSheetGroup.pillSheets[index]; if (pillSheetGroup.pillSheets[index] == updatedPillSheet) { return false; @@ -80,9 +76,7 @@ class TakePill { if (updatedIndexses.isEmpty) { // NOTE: prevent error for unit test if (Firebase.apps.isNotEmpty) { - errorLogger.recordError( - const FormatException("unexpected updatedIndexes is empty"), - StackTrace.current); + errorLogger.recordError(const FormatException("unexpected updatedIndexes is empty"), StackTrace.current); } return null; } @@ -92,8 +86,7 @@ class TakePill { final before = pillSheetGroup.pillSheets[updatedIndexses.first]; final after = updatedPillSheetGroup.pillSheets[updatedIndexses.last]; - final history = - PillSheetModifiedHistoryServiceActionFactory.createTakenPillAction( + final history = PillSheetModifiedHistoryServiceActionFactory.createTakenPillAction( pillSheetGroupID: pillSheetGroup.id, before: before, after: after, diff --git a/lib/provider/tick.g.dart b/lib/provider/tick.g.dart index efc99856cf..d0118d63fa 100644 --- a/lib/provider/tick.g.dart +++ b/lib/provider/tick.g.dart @@ -13,8 +13,7 @@ String _$tickHash() => r'686abe45d9c3fcc30740691654bd6533752d671e'; final tickProvider = AutoDisposeNotifierProvider.internal( Tick.new, name: r'tickProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') ? null : _$tickHash, + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') ? null : _$tickHash, dependencies: null, allTransitiveDependencies: null, ); diff --git a/lib/provider/typed_shared_preferences.dart b/lib/provider/typed_shared_preferences.dart index 90f0ff5cad..6ebd0498f4 100644 --- a/lib/provider/typed_shared_preferences.dart +++ b/lib/provider/typed_shared_preferences.dart @@ -15,8 +15,7 @@ class SharedPreferencesState { @Riverpod(keepAlive: true, dependencies: [sharedPreferences]) class BoolSharedPreferences extends _$BoolSharedPreferences { @override - SharedPreferencesState build(String key) => SharedPreferencesState( - key, ref.read(sharedPreferencesProvider).getBool(key)); + SharedPreferencesState build(String key) => SharedPreferencesState(key, ref.read(sharedPreferencesProvider).getBool(key)); Future set(bool value) async { await ref.read(sharedPreferencesProvider).setBool(state.key, value); @@ -27,8 +26,7 @@ class BoolSharedPreferences extends _$BoolSharedPreferences { @Riverpod(keepAlive: true, dependencies: [sharedPreferences]) class IntSharedPreferences extends _$IntSharedPreferences { @override - SharedPreferencesState build(String key) => SharedPreferencesState( - key, ref.read(sharedPreferencesProvider).getInt(key)); + SharedPreferencesState build(String key) => SharedPreferencesState(key, ref.read(sharedPreferencesProvider).getInt(key)); Future set(int value) async { await ref.read(sharedPreferencesProvider).setInt(state.key, value); @@ -39,8 +37,7 @@ class IntSharedPreferences extends _$IntSharedPreferences { @Riverpod(keepAlive: true, dependencies: [sharedPreferences]) class StringSharedPreferences extends _$StringSharedPreferences { @override - SharedPreferencesState build(String key) => SharedPreferencesState( - key, ref.read(sharedPreferencesProvider).getString(key)); + SharedPreferencesState build(String key) => SharedPreferencesState(key, ref.read(sharedPreferencesProvider).getString(key)); Future set(String value) async { await ref.read(sharedPreferencesProvider).setString(state.key, value); diff --git a/lib/provider/typed_shared_preferences.g.dart b/lib/provider/typed_shared_preferences.g.dart index af7e04b18f..4a0ead3900 100644 --- a/lib/provider/typed_shared_preferences.g.dart +++ b/lib/provider/typed_shared_preferences.g.dart @@ -6,8 +6,7 @@ part of 'typed_shared_preferences.dart'; // RiverpodGenerator // ************************************************************************** -String _$boolSharedPreferencesHash() => - r'74722005ae3dc56ee882744e65c2518f169318a9'; +String _$boolSharedPreferencesHash() => r'74722005ae3dc56ee882744e65c2518f169318a9'; /// Copied from Dart SDK class _SystemHash { @@ -30,8 +29,7 @@ class _SystemHash { } } -abstract class _$BoolSharedPreferences - extends BuildlessNotifier> { +abstract class _$BoolSharedPreferences extends BuildlessNotifier> { late final String key; SharedPreferencesState build( @@ -44,8 +42,7 @@ abstract class _$BoolSharedPreferences const boolSharedPreferencesProvider = BoolSharedPreferencesFamily(); /// See also [BoolSharedPreferences]. -class BoolSharedPreferencesFamily - extends Family> { +class BoolSharedPreferencesFamily extends Family> { /// See also [BoolSharedPreferences]. const BoolSharedPreferencesFamily(); @@ -67,30 +64,22 @@ class BoolSharedPreferencesFamily ); } - static final Iterable _dependencies = [ - sharedPreferencesProvider - ]; + static final Iterable _dependencies = [sharedPreferencesProvider]; @override Iterable? get dependencies => _dependencies; - static final Iterable _allTransitiveDependencies = - { - sharedPreferencesProvider, - ...?sharedPreferencesProvider.allTransitiveDependencies - }; + static final Iterable _allTransitiveDependencies = {sharedPreferencesProvider, ...?sharedPreferencesProvider.allTransitiveDependencies}; @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; + Iterable? get allTransitiveDependencies => _allTransitiveDependencies; @override String? get name => r'boolSharedPreferencesProvider'; } /// See also [BoolSharedPreferences]. -class BoolSharedPreferencesProvider extends NotifierProviderImpl< - BoolSharedPreferences, SharedPreferencesState> { +class BoolSharedPreferencesProvider extends NotifierProviderImpl> { /// See also [BoolSharedPreferences]. BoolSharedPreferencesProvider( String key, @@ -98,13 +87,9 @@ class BoolSharedPreferencesProvider extends NotifierProviderImpl< () => BoolSharedPreferences()..key = key, from: boolSharedPreferencesProvider, name: r'boolSharedPreferencesProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$boolSharedPreferencesHash, + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') ? null : _$boolSharedPreferencesHash, dependencies: BoolSharedPreferencesFamily._dependencies, - allTransitiveDependencies: - BoolSharedPreferencesFamily._allTransitiveDependencies, + allTransitiveDependencies: BoolSharedPreferencesFamily._allTransitiveDependencies, key: key, ); @@ -146,8 +131,7 @@ class BoolSharedPreferencesProvider extends NotifierProviderImpl< } @override - NotifierProviderElement> - createElement() { + NotifierProviderElement> createElement() { return _BoolSharedPreferencesProviderElement(this); } @@ -165,26 +149,21 @@ class BoolSharedPreferencesProvider extends NotifierProviderImpl< } } -mixin BoolSharedPreferencesRef - on NotifierProviderRef> { +mixin BoolSharedPreferencesRef on NotifierProviderRef> { /// The parameter `key` of this provider. String get key; } -class _BoolSharedPreferencesProviderElement extends NotifierProviderElement< - BoolSharedPreferences, - SharedPreferencesState> with BoolSharedPreferencesRef { +class _BoolSharedPreferencesProviderElement extends NotifierProviderElement> with BoolSharedPreferencesRef { _BoolSharedPreferencesProviderElement(super.provider); @override String get key => (origin as BoolSharedPreferencesProvider).key; } -String _$intSharedPreferencesHash() => - r'ae66140077df3922444c17579c2b5483ed6c21b8'; +String _$intSharedPreferencesHash() => r'ae66140077df3922444c17579c2b5483ed6c21b8'; -abstract class _$IntSharedPreferences - extends BuildlessNotifier> { +abstract class _$IntSharedPreferences extends BuildlessNotifier> { late final String key; SharedPreferencesState build( @@ -219,30 +198,22 @@ class IntSharedPreferencesFamily extends Family> { ); } - static final Iterable _dependencies = [ - sharedPreferencesProvider - ]; + static final Iterable _dependencies = [sharedPreferencesProvider]; @override Iterable? get dependencies => _dependencies; - static final Iterable _allTransitiveDependencies = - { - sharedPreferencesProvider, - ...?sharedPreferencesProvider.allTransitiveDependencies - }; + static final Iterable _allTransitiveDependencies = {sharedPreferencesProvider, ...?sharedPreferencesProvider.allTransitiveDependencies}; @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; + Iterable? get allTransitiveDependencies => _allTransitiveDependencies; @override String? get name => r'intSharedPreferencesProvider'; } /// See also [IntSharedPreferences]. -class IntSharedPreferencesProvider extends NotifierProviderImpl< - IntSharedPreferences, SharedPreferencesState> { +class IntSharedPreferencesProvider extends NotifierProviderImpl> { /// See also [IntSharedPreferences]. IntSharedPreferencesProvider( String key, @@ -250,13 +221,9 @@ class IntSharedPreferencesProvider extends NotifierProviderImpl< () => IntSharedPreferences()..key = key, from: intSharedPreferencesProvider, name: r'intSharedPreferencesProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$intSharedPreferencesHash, + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') ? null : _$intSharedPreferencesHash, dependencies: IntSharedPreferencesFamily._dependencies, - allTransitiveDependencies: - IntSharedPreferencesFamily._allTransitiveDependencies, + allTransitiveDependencies: IntSharedPreferencesFamily._allTransitiveDependencies, key: key, ); @@ -298,8 +265,7 @@ class IntSharedPreferencesProvider extends NotifierProviderImpl< } @override - NotifierProviderElement> - createElement() { + NotifierProviderElement> createElement() { return _IntSharedPreferencesProviderElement(this); } @@ -317,26 +283,21 @@ class IntSharedPreferencesProvider extends NotifierProviderImpl< } } -mixin IntSharedPreferencesRef - on NotifierProviderRef> { +mixin IntSharedPreferencesRef on NotifierProviderRef> { /// The parameter `key` of this provider. String get key; } -class _IntSharedPreferencesProviderElement extends NotifierProviderElement< - IntSharedPreferences, - SharedPreferencesState> with IntSharedPreferencesRef { +class _IntSharedPreferencesProviderElement extends NotifierProviderElement> with IntSharedPreferencesRef { _IntSharedPreferencesProviderElement(super.provider); @override String get key => (origin as IntSharedPreferencesProvider).key; } -String _$stringSharedPreferencesHash() => - r'3dbe38b126b12544017f8538c33ea459704cf110'; +String _$stringSharedPreferencesHash() => r'3dbe38b126b12544017f8538c33ea459704cf110'; -abstract class _$StringSharedPreferences - extends BuildlessNotifier> { +abstract class _$StringSharedPreferences extends BuildlessNotifier> { late final String key; SharedPreferencesState build( @@ -349,8 +310,7 @@ abstract class _$StringSharedPreferences const stringSharedPreferencesProvider = StringSharedPreferencesFamily(); /// See also [StringSharedPreferences]. -class StringSharedPreferencesFamily - extends Family> { +class StringSharedPreferencesFamily extends Family> { /// See also [StringSharedPreferences]. const StringSharedPreferencesFamily(); @@ -372,30 +332,22 @@ class StringSharedPreferencesFamily ); } - static final Iterable _dependencies = [ - sharedPreferencesProvider - ]; + static final Iterable _dependencies = [sharedPreferencesProvider]; @override Iterable? get dependencies => _dependencies; - static final Iterable _allTransitiveDependencies = - { - sharedPreferencesProvider, - ...?sharedPreferencesProvider.allTransitiveDependencies - }; + static final Iterable _allTransitiveDependencies = {sharedPreferencesProvider, ...?sharedPreferencesProvider.allTransitiveDependencies}; @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; + Iterable? get allTransitiveDependencies => _allTransitiveDependencies; @override String? get name => r'stringSharedPreferencesProvider'; } /// See also [StringSharedPreferences]. -class StringSharedPreferencesProvider extends NotifierProviderImpl< - StringSharedPreferences, SharedPreferencesState> { +class StringSharedPreferencesProvider extends NotifierProviderImpl> { /// See also [StringSharedPreferences]. StringSharedPreferencesProvider( String key, @@ -403,13 +355,9 @@ class StringSharedPreferencesProvider extends NotifierProviderImpl< () => StringSharedPreferences()..key = key, from: stringSharedPreferencesProvider, name: r'stringSharedPreferencesProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$stringSharedPreferencesHash, + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') ? null : _$stringSharedPreferencesHash, dependencies: StringSharedPreferencesFamily._dependencies, - allTransitiveDependencies: - StringSharedPreferencesFamily._allTransitiveDependencies, + allTransitiveDependencies: StringSharedPreferencesFamily._allTransitiveDependencies, key: key, ); @@ -451,8 +399,7 @@ class StringSharedPreferencesProvider extends NotifierProviderImpl< } @override - NotifierProviderElement> createElement() { + NotifierProviderElement> createElement() { return _StringSharedPreferencesProviderElement(this); } @@ -470,15 +417,12 @@ class StringSharedPreferencesProvider extends NotifierProviderImpl< } } -mixin StringSharedPreferencesRef - on NotifierProviderRef> { +mixin StringSharedPreferencesRef on NotifierProviderRef> { /// The parameter `key` of this provider. String get key; } -class _StringSharedPreferencesProviderElement extends NotifierProviderElement< - StringSharedPreferences, - SharedPreferencesState> with StringSharedPreferencesRef { +class _StringSharedPreferencesProviderElement extends NotifierProviderElement> with StringSharedPreferencesRef { _StringSharedPreferencesProviderElement(super.provider); @override diff --git a/lib/provider/user.dart b/lib/provider/user.dart index 81c281ef16..e637da88d3 100644 --- a/lib/provider/user.dart +++ b/lib/provider/user.dart @@ -17,11 +17,7 @@ import 'package:package_info_plus/package_info_plus.dart'; import 'package:riverpod/riverpod.dart'; import 'package:shared_preferences/shared_preferences.dart'; -final userProvider = StreamProvider((ref) => ref - .watch(databaseProvider) - .userReference() - .snapshots() - .map((event) => event.data()!)); +final userProvider = StreamProvider((ref) => ref.watch(databaseProvider).userReference().snapshots().map((event) => event.data()!)); class UpdatePurchaseInfo { final DatabaseConnection databaseConnection; @@ -35,27 +31,17 @@ class UpdatePurchaseInfo { required List activeSubscriptions, required String? originalPurchaseDate, }) async { - await databaseConnection.userRawReference().set({ - if (isActivated != null) UserFirestoreFieldKeys.isPremium: isActivated, - UserFirestoreFieldKeys.purchaseAppID: purchaseAppID - }, SetOptions(merge: true)); + await databaseConnection + .userRawReference() + .set({if (isActivated != null) UserFirestoreFieldKeys.isPremium: isActivated, UserFirestoreFieldKeys.purchaseAppID: purchaseAppID}, SetOptions(merge: true)); final privates = { - if (premiumPlanIdentifier != null) - UserPrivateFirestoreFieldKeys.latestPremiumPlanIdentifier: - premiumPlanIdentifier, - if (originalPurchaseDate != null) - UserPrivateFirestoreFieldKeys.originalPurchaseDate: - originalPurchaseDate, - if (activeSubscriptions.isNotEmpty) - UserPrivateFirestoreFieldKeys.activeSubscriptions: activeSubscriptions, - if (entitlementIdentifier != null) - UserPrivateFirestoreFieldKeys.entitlementIdentifier: - entitlementIdentifier, + if (premiumPlanIdentifier != null) UserPrivateFirestoreFieldKeys.latestPremiumPlanIdentifier: premiumPlanIdentifier, + if (originalPurchaseDate != null) UserPrivateFirestoreFieldKeys.originalPurchaseDate: originalPurchaseDate, + if (activeSubscriptions.isNotEmpty) UserPrivateFirestoreFieldKeys.activeSubscriptions: activeSubscriptions, + if (entitlementIdentifier != null) UserPrivateFirestoreFieldKeys.entitlementIdentifier: entitlementIdentifier, }; if (privates.isNotEmpty) { - await databaseConnection - .userPrivateRawReference() - .set({...privates}, SetOptions(merge: true)); + await databaseConnection.userPrivateRawReference().set({...privates}, SetOptions(merge: true)); } } } @@ -73,8 +59,7 @@ class SyncPurchaseInfo { } } -final fetchOrCreateUserProvider = - Provider((ref) => FetchOrCreateUser(ref.watch(databaseProvider))); +final fetchOrCreateUserProvider = Provider((ref) => FetchOrCreateUser(ref.watch(databaseProvider))); class FetchOrCreateUser { final DatabaseConnection databaseConnection; @@ -86,8 +71,7 @@ class FetchOrCreateUser { if (error is UserNotFound) { return _create(uid).then((_) => _fetch(uid)); } - throw FormatException( - "Create user error: $error, stackTrace: ${StackTrace.current.toString()}"); + throw FormatException("Create user error: $error, stackTrace: ${StackTrace.current.toString()}"); }); return user; } @@ -106,12 +90,10 @@ class FetchOrCreateUser { Future _create(String uid) async { debugPrint("#create $uid"); final sharedPreferences = await SharedPreferences.getInstance(); - final anonymousUserID = - sharedPreferences.getString(StringKey.lastSignInAnonymousUID); + final anonymousUserID = sharedPreferences.getString(StringKey.lastSignInAnonymousUID); return databaseConnection.userRawReference().set( { - if (anonymousUserID != null) - UserFirestoreFieldKeys.anonymousUserID: anonymousUserID, + if (anonymousUserID != null) UserFirestoreFieldKeys.anonymousUserID: anonymousUserID, UserFirestoreFieldKeys.userIDWhenCreateUser: uid, }, SetOptions(merge: true), @@ -119,8 +101,7 @@ class FetchOrCreateUser { } } -final linkAppleProvider = - Provider((ref) => LinkApple(ref.watch(databaseProvider))); +final linkAppleProvider = Provider((ref) => LinkApple(ref.watch(databaseProvider))); class LinkApple { final DatabaseConnection databaseConnection; @@ -137,8 +118,7 @@ class LinkApple { } } -final linkGoogleProvider = - Provider((ref) => LinkGoogle(ref.watch(databaseProvider))); +final linkGoogleProvider = Provider((ref) => LinkGoogle(ref.watch(databaseProvider))); class LinkGoogle { final DatabaseConnection databaseConnection; @@ -155,8 +135,7 @@ class LinkGoogle { } } -final registerRemotePushNotificationTokenProvider = Provider( - (ref) => RegisterRemotePushNotificationToken(ref.watch(databaseProvider))); +final registerRemotePushNotificationTokenProvider = Provider((ref) => RegisterRemotePushNotificationToken(ref.watch(databaseProvider))); class RegisterRemotePushNotificationToken { final DatabaseConnection databaseConnection; @@ -171,8 +150,7 @@ class RegisterRemotePushNotificationToken { } } -final saveUserLaunchInfoProvider = - Provider((ref) => SaveUserLaunchInfo(ref.watch(databaseProvider))); +final saveUserLaunchInfoProvider = Provider((ref) => SaveUserLaunchInfo(ref.watch(databaseProvider))); class SaveUserLaunchInfo { final DatabaseConnection databaseConnection; @@ -186,8 +164,7 @@ class SaveUserLaunchInfo { final sharedPreferences = await SharedPreferences.getInstance(); // Stats - final lastLoginVersion = - await PackageInfo.fromPlatform().then((value) => value.version); + final lastLoginVersion = await PackageInfo.fromPlatform().then((value) => value.version); String? beginVersion = sharedPreferences.getString(StringKey.beginVersion); if (beginVersion == null) { final v = lastLoginVersion; @@ -204,11 +181,7 @@ class SaveUserLaunchInfo { // Package final packageInfo = await PackageInfo.fromPlatform(); final os = Platform.operatingSystem; - final package = Package( - latestOS: os, - appName: packageInfo.appName, - buildNumber: packageInfo.buildNumber, - appVersion: packageInfo.version); + final package = Package(latestOS: os, appName: packageInfo.appName, buildNumber: packageInfo.buildNumber, appVersion: packageInfo.version); // UserIDs final userID = user.id!; @@ -216,20 +189,14 @@ class SaveUserLaunchInfo { if (!userDocumentIDSets.contains(userID)) { userDocumentIDSets.add(userID); } - final lastSignInAnonymousUID = - sharedPreferences.getString(StringKey.lastSignInAnonymousUID); + final lastSignInAnonymousUID = sharedPreferences.getString(StringKey.lastSignInAnonymousUID); List anonymousUserIDSets = [...user.anonymousUserIDSets]; - if (lastSignInAnonymousUID != null && - !anonymousUserIDSets.contains(lastSignInAnonymousUID)) { + if (lastSignInAnonymousUID != null && !anonymousUserIDSets.contains(lastSignInAnonymousUID)) { anonymousUserIDSets.add(lastSignInAnonymousUID); } - final firebaseCurrentUserID = - firebase_auth.FirebaseAuth.instance.currentUser?.uid; - List firebaseCurrentUserIDSets = [ - ...user.firebaseCurrentUserIDSets - ]; - if (firebaseCurrentUserID != null && - !firebaseCurrentUserIDSets.contains(firebaseCurrentUserID)) { + final firebaseCurrentUserID = firebase_auth.FirebaseAuth.instance.currentUser?.uid; + List firebaseCurrentUserIDSets = [...user.firebaseCurrentUserIDSets]; + if (firebaseCurrentUserID != null && !firebaseCurrentUserIDSets.contains(firebaseCurrentUserID)) { firebaseCurrentUserIDSets.add(firebaseCurrentUserID); } @@ -253,23 +220,19 @@ class SaveUserLaunchInfo { // UserIDs UserFirestoreFieldKeys.userDocumentIDSets: userDocumentIDSets, - UserFirestoreFieldKeys.firebaseCurrentUserIDSets: - firebaseCurrentUserIDSets, + UserFirestoreFieldKeys.firebaseCurrentUserIDSets: firebaseCurrentUserIDSets, UserFirestoreFieldKeys.anonymousUserIDSets: anonymousUserIDSets, UserFirestoreFieldKeys.isTrial: user.isTrial, // TODO: [NewPillSheetNotification] from:2024-04-30. 2024-07-01 でこの処理を削除する。ある程度機関を置いたら削除するくらいで良い。重要な処理でも無い // 処理的に大体のユーザーがカバーできれば良いので、現在のnewPillSheetNotificationが登録されている数から判別する - UserFirestoreFieldKeys.useLocalNotificationForNewPillSheet: - (await localNotificationService.pendingNewPillSheetNotifications()) - .isNotEmpty, + UserFirestoreFieldKeys.useLocalNotificationForNewPillSheet: (await localNotificationService.pendingNewPillSheetNotifications()).isNotEmpty, }, SetOptions(merge: true)); } } -final endInitialSettingProvider = - Provider((ref) => EndInitialSetting(ref.watch(databaseProvider))); +final endInitialSettingProvider = Provider((ref) => EndInitialSetting(ref.watch(databaseProvider))); class EndInitialSetting { final DatabaseConnection databaseConnection; @@ -279,21 +242,15 @@ class EndInitialSetting { return databaseConnection.userRawReference().set({ UserFirestoreFieldKeys.isTrial: true, UserFirestoreFieldKeys.beginTrialDate: now(), - UserFirestoreFieldKeys.trialDeadlineDate: now() - .addDays(remoteConfigParameter.trialDeadlineDateOffsetDay) - .endOfDay(), - UserFirestoreFieldKeys.discountEntitlementDeadlineDate: now() - .addDays(remoteConfigParameter.trialDeadlineDateOffsetDay + - remoteConfigParameter.discountEntitlementOffsetDay) - .endOfDay(), + UserFirestoreFieldKeys.trialDeadlineDate: now().addDays(remoteConfigParameter.trialDeadlineDateOffsetDay).endOfDay(), + UserFirestoreFieldKeys.discountEntitlementDeadlineDate: now().addDays(remoteConfigParameter.trialDeadlineDateOffsetDay + remoteConfigParameter.discountEntitlementOffsetDay).endOfDay(), // TODO: [NewPillSheetNotification] from:2024-04-30. 2024-07-01 でこの処理を削除する。ある程度機関を置いたら削除するくらいで良い。重要な処理でも無い UserFirestoreFieldKeys.useLocalNotificationForNewPillSheet: true, }, SetOptions(merge: true)); } } -final disableShouldAskCancelReasonProvider = Provider( - (ref) => DisableShouldAskCancelReason(ref.watch(databaseProvider))); +final disableShouldAskCancelReasonProvider = Provider((ref) => DisableShouldAskCancelReason(ref.watch(databaseProvider))); class DisableShouldAskCancelReason { final DatabaseConnection databaseConnection; @@ -315,13 +272,11 @@ class ApplyShareRewardPremiumTrial { user.copyWith( beginTrialDate: now(), trialDeadlineDate: now().addDays(14).endOfDay(), - appliedShareRewardPremiumTrialCount: - user.appliedShareRewardPremiumTrialCount + 1, + appliedShareRewardPremiumTrialCount: user.appliedShareRewardPremiumTrialCount + 1, ), SetOptions(merge: true), ); } } -final applyShareRewardPremiumTrialProvider = Provider( - (ref) => ApplyShareRewardPremiumTrial(ref.watch(databaseProvider))); +final applyShareRewardPremiumTrialProvider = Provider((ref) => ApplyShareRewardPremiumTrial(ref.watch(databaseProvider))); diff --git a/lib/utils/analytics.dart b/lib/utils/analytics.dart index 927ecb7b65..7ff7e932ab 100644 --- a/lib/utils/analytics.dart +++ b/lib/utils/analytics.dart @@ -15,10 +15,8 @@ class Analytics { } } - void logEvent( - {required String name, Map? parameters}) async { - assert(name.length <= 40, - "firebase analytics log event name limit length up to 40"); + void logEvent({required String name, Map? parameters}) async { + assert(name.length <= 40, "firebase analytics log event name limit length up to 40"); if (kDebugMode) { print("[INFO] logEvent name: $name, parameters: $parameters"); } @@ -47,12 +45,9 @@ class Analytics { } } - void setCurrentScreen( - {required String screenName, - String screenClassOverride = 'Flutter'}) async { + void setCurrentScreen({required String screenName, String screenClassOverride = 'Flutter'}) async { unawaited(firebaseAnalytics.logEvent(name: "screen_$screenName")); - return firebaseAnalytics.setCurrentScreen( - screenName: screenName, screenClassOverride: screenClassOverride); + return firebaseAnalytics.setCurrentScreen(screenName: screenName, screenClassOverride: screenClassOverride); } /// Up to 25 user property names are supported. @@ -62,8 +57,7 @@ class Analytics { assert(name.toLowerCase() != "age"); assert(name.toLowerCase() != "gender"); assert(name.toLowerCase() != "interest"); - assert(name.length < 25, - "firebase setUserProperties name limit length up to 25"); + assert(name.length < 25, "firebase setUserProperties name limit length up to 25"); assert(!name.startsWith("firebase_")); if (kDebugMode) { diff --git a/lib/utils/auth/apple.dart b/lib/utils/auth/apple.dart index 90d16a197b..c095510861 100644 --- a/lib/utils/auth/apple.dart +++ b/lib/utils/auth/apple.dart @@ -44,16 +44,13 @@ final isAppleLinkedProvider = Provider((ref) { }); bool isLinkedAppleFor(User user) { - return user.providerData - .where((element) => element.providerId == AppleAuthProvider.PROVIDER_ID) - .isNotEmpty; + return user.providerData.where((element) => element.providerId == AppleAuthProvider.PROVIDER_ID).isNotEmpty; } Future appleReauthentification() async { try { final provider = AppleAuthProvider().addScope('email'); - await FirebaseAuth.instance.currentUser - ?.reauthenticateWithProvider(provider); + await FirebaseAuth.instance.currentUser?.reauthenticateWithProvider(provider); } on FirebaseAuthException catch (e) { // Googleのcodeとは違うので注意 if (e.code == "canceled") { diff --git a/lib/utils/auth/boilerplate.dart b/lib/utils/auth/boilerplate.dart index dfebb6a79b..c4ec392dd5 100644 --- a/lib/utils/auth/boilerplate.dart +++ b/lib/utils/auth/boilerplate.dart @@ -22,10 +22,8 @@ Future callLinkWithApple(LinkApple linkApple) async { return Future.value(SignInWithAppleState.determined); } on FirebaseAuthException catch (error, stackTrace) { errorLogger.recordError(error, stackTrace); - debugPrint( - "FirebaseAuthException $error, code: ${error.code}, stack: ${stackTrace.toString()}"); - final mappedException = - mapFromFirebaseAuthException(error, LinkAccountType.apple); + debugPrint("FirebaseAuthException $error, code: ${error.code}, stack: ${stackTrace.toString()}"); + final mappedException = mapFromFirebaseAuthException(error, LinkAccountType.apple); if (mappedException != null) { throw mappedException; } @@ -53,10 +51,8 @@ Future callLinkWithGoogle(LinkGoogle linkGoogle) async { return Future.value(SignInWithGoogleState.determined); } on FirebaseAuthException catch (error, stackTrace) { errorLogger.recordError(error, stackTrace); - debugPrint( - "FirebaseAuthException $error, code: ${error.code}, stack: ${stackTrace.toString()}"); - final mappedException = - mapFromFirebaseAuthException(error, LinkAccountType.google); + debugPrint("FirebaseAuthException $error, code: ${error.code}, stack: ${stackTrace.toString()}"); + final mappedException = mapFromFirebaseAuthException(error, LinkAccountType.google); if (mappedException != null) { throw mappedException; } diff --git a/lib/utils/auth/exception.dart b/lib/utils/auth/exception.dart index 2f55dc8eff..230744d61b 100644 --- a/lib/utils/auth/exception.dart +++ b/lib/utils/auth/exception.dart @@ -2,23 +2,16 @@ import 'package:firebase_auth/firebase_auth.dart'; import 'package:pilll/entity/link_account_type.dart'; import 'package:pilll/features/error/alert_error.dart'; -Exception? mapFromFirebaseAuthException( - FirebaseAuthException e, LinkAccountType accountType) { +Exception? mapFromFirebaseAuthException(FirebaseAuthException e, LinkAccountType accountType) { if (e.code == "provider-already-linked") { - throw AlertError( - "この${accountType.providerName}アカウントはすにでお使いのPilllのアカウントに紐付いています。画面の更新をお試しください。FAQもご覧ください。詳細: ${e.message}", - faqLinkURL: - "https://pilll.wraptas.site/a8d3c745e58c40f0b8b771bb70f7a7d1"); + throw AlertError("この${accountType.providerName}アカウントはすにでお使いのPilllのアカウントに紐付いています。画面の更新をお試しください。FAQもご覧ください。詳細: ${e.message}", + faqLinkURL: "https://pilll.wraptas.site/a8d3c745e58c40f0b8b771bb70f7a7d1"); } if (e.code == "credential-already-in-use") { - throw AlertError( - "この${accountType.providerName}アカウントはすでに他のPilllのアカウントに紐付いているため登録ができません。FAQもご覧ください。詳細: ${e.message}", - faqLinkURL: - "https://pilll.wraptas.site/a8d3c745e58c40f0b8b771bb70f7a7d1"); + throw AlertError("この${accountType.providerName}アカウントはすでに他のPilllのアカウントに紐付いているため登録ができません。FAQもご覧ください。詳細: ${e.message}", faqLinkURL: "https://pilll.wraptas.site/a8d3c745e58c40f0b8b771bb70f7a7d1"); } if (e.code == "email-already-in-use") { - throw AlertError( - "すでに${accountType.providerName}アカウントでお使いのメールアドレスが他のPilllアカウントに紐付いているため登録ができません。FAQもご覧ください。詳細: ${e.message}"); + throw AlertError("すでに${accountType.providerName}アカウントでお使いのメールアドレスが他のPilllアカウントに紐付いているため登録ができません。FAQもご覧ください。詳細: ${e.message}"); } return null; } diff --git a/lib/utils/auth/google.dart b/lib/utils/auth/google.dart index f2b4fb0418..4e484e66d4 100644 --- a/lib/utils/auth/google.dart +++ b/lib/utils/auth/google.dart @@ -48,16 +48,13 @@ final isGoogleLinkedProvider = Provider((ref) { }); bool isLinkedGoogleFor(User user) { - return user.providerData - .where((element) => element.providerId == GoogleAuthProvider.PROVIDER_ID) - .isNotEmpty; + return user.providerData.where((element) => element.providerId == GoogleAuthProvider.PROVIDER_ID).isNotEmpty; } Future googleReauthentification() async { try { final provider = GoogleAuthProvider().addScope('email'); - await FirebaseAuth.instance.currentUser - ?.reauthenticateWithProvider(provider); + await FirebaseAuth.instance.currentUser?.reauthenticateWithProvider(provider); } on FirebaseAuthException catch (e) { // sign-in-failed という code で返ってくるが、コードを読んでると該当するエラーが多かったので実際にdumpしてみたメッセージでマッチしている // Appleのcodeとは違うので注意 diff --git a/lib/utils/datetime/date_compare.dart b/lib/utils/datetime/date_compare.dart index 1039866b0a..ba4de64a21 100644 --- a/lib/utils/datetime/date_compare.dart +++ b/lib/utils/datetime/date_compare.dart @@ -1,5 +1,3 @@ -bool isSameDay(DateTime lhs, DateTime rhs) => - lhs.year == rhs.year && lhs.month == rhs.month && lhs.day == rhs.day; +bool isSameDay(DateTime lhs, DateTime rhs) => lhs.year == rhs.year && lhs.month == rhs.month && lhs.day == rhs.day; -bool isSameMonth(DateTime lhs, DateTime rhs) => - lhs.year == rhs.year && lhs.month == rhs.month; +bool isSameMonth(DateTime lhs, DateTime rhs) => lhs.year == rhs.year && lhs.month == rhs.month; diff --git a/lib/utils/datetime/date_range.dart b/lib/utils/datetime/date_range.dart index 7fd446cde7..6743f54e76 100644 --- a/lib/utils/datetime/date_range.dart +++ b/lib/utils/datetime/date_range.dart @@ -10,20 +10,15 @@ class DateRange { DateRange(this._begin, this._end); - static bool isSameDay(DateTime a, DateTime b) => - a.year == b.year && a.month == b.month && a.day == b.day; - bool inRange(DateTime date) => - (date.isAfter(begin) && date.isBefore(end)) || - DateRange.isSameDay(date, begin) || - DateRange.isSameDay(date, end); + static bool isSameDay(DateTime a, DateTime b) => a.year == b.year && a.month == b.month && a.day == b.day; + bool inRange(DateTime date) => (date.isAfter(begin) && date.isBefore(end)) || DateRange.isSameDay(date, begin) || DateRange.isSameDay(date, end); DateRange union(DateRange range) { var l = begin.isAfter(range.begin) ? begin : range.begin; var r = end.isBefore(range.end) ? end : range.end; return DateRange(l, r); } - List list() => - List.generate(days + 1, (index) => _begin.addDays(index)); + List list() => List.generate(days + 1, (index) => _begin.addDays(index)); T map(T Function(DateRange) converter) { return converter(this); diff --git a/lib/utils/datetime/day.dart b/lib/utils/datetime/day.dart index 04a47118a2..07b84bee4e 100644 --- a/lib/utils/datetime/day.dart +++ b/lib/utils/datetime/day.dart @@ -30,9 +30,7 @@ DateTime firstDayOfWeekday(DateTime day) { } DateTime endDayOfWeekday(DateTime day) { - return day - .subtract(Duration(days: day.weekday == 7 ? 0 : day.weekday)) - .addDays(Weekday.values.length - 1); + return day.subtract(Duration(days: day.weekday == 7 ? 0 : day.weekday)).addDays(Weekday.values.length - 1); } extension Date on DateTime { @@ -63,10 +61,7 @@ extension DateTimeBeginEnd on DateTime { extension MonthDateTimeRange on DateTimeRange { static DateTimeRange monthRange({required DateTime dateForMonth}) { - return DateTimeRange( - start: DateTime(dateForMonth.year, dateForMonth.month, 1), - end: - DateTime(dateForMonth.year, dateForMonth.month + 1, 0, 23, 59, 59)); + return DateTimeRange(start: DateTime(dateForMonth.year, dateForMonth.month, 1), end: DateTime(dateForMonth.year, dateForMonth.month + 1, 0, 23, 59, 59)); } } diff --git a/lib/utils/datetime/debug_print.dart b/lib/utils/datetime/debug_print.dart index 9f562b4301..1b7587bcac 100644 --- a/lib/utils/datetime/debug_print.dart +++ b/lib/utils/datetime/debug_print.dart @@ -11,9 +11,7 @@ void printWrapped(String? message, {int? wrapWidth}) { } else { final pattern = RegExp('.{1,800}'); // 800 is the size of each chunk // ignore: avoid_print - pattern - .allMatches(message) - .forEach((match) => print("[PILLL:DEBUG] ${match.group(0)}")); + pattern.allMatches(message).forEach((match) => print("[PILLL:DEBUG] ${match.group(0)}")); } } } diff --git a/lib/utils/emulator/emulator.dart b/lib/utils/emulator/emulator.dart index bbea3dff49..94f9360ffd 100644 --- a/lib/utils/emulator/emulator.dart +++ b/lib/utils/emulator/emulator.dart @@ -4,6 +4,5 @@ import 'package:cloud_firestore/cloud_firestore.dart'; void connectToEmulator() { final domain = Platform.isAndroid ? '10.0.2.2' : 'localhost'; - FirebaseFirestore.instance.settings = Settings( - persistenceEnabled: false, host: '$domain:8080', sslEnabled: false); + FirebaseFirestore.instance.settings = Settings(persistenceEnabled: false, host: '$domain:8080', sslEnabled: false); } diff --git a/lib/utils/environment.dart b/lib/utils/environment.dart index 34c6410ff0..5131a1c573 100644 --- a/lib/utils/environment.dart +++ b/lib/utils/environment.dart @@ -8,20 +8,16 @@ enum Flavor { abstract class Environment { static bool get isProduction => flavor == Flavor.PRODUCTION; - static bool get isDevelopment => - flavor == Flavor.DEVELOP || flavor == Flavor.LOCAL; + static bool get isDevelopment => flavor == Flavor.DEVELOP || flavor == Flavor.LOCAL; static bool get isLocal => flavor == Flavor.LOCAL; static bool isTest = false; static Flavor? flavor; // Avoid too, too much CPU usage. // Ref: https://github.com/flutter/flutter/issues/13203#issuecomment-430134157 - static bool get disableWidgetAnimation => - const bool.fromEnvironment("DISABLE_WIDGET_ANIMATION") && isDevelopment; + static bool get disableWidgetAnimation => const bool.fromEnvironment("DISABLE_WIDGET_ANIMATION") && isDevelopment; - static const siwaServiceIdentifier = - String.fromEnvironment("SIWA_SERVICE_IDENTIFIIER"); - static const androidSiwaRedirectURL = - String.fromEnvironment("ANDROID_SIWA_REDIRECT_URL"); + static const siwaServiceIdentifier = String.fromEnvironment("SIWA_SERVICE_IDENTIFIIER"); + static const androidSiwaRedirectURL = String.fromEnvironment("ANDROID_SIWA_REDIRECT_URL"); static Function()? deleteUser; static Function()? signOutUser; diff --git a/lib/utils/formatter/date_time_formatter.dart b/lib/utils/formatter/date_time_formatter.dart index f1731e4d2a..fbc31a9498 100644 --- a/lib/utils/formatter/date_time_formatter.dart +++ b/lib/utils/formatter/date_time_formatter.dart @@ -19,8 +19,7 @@ class DateTimeFormatter { } static String monthAndWeekday(DateTime dateTime) { - return DateFormat(DateFormat.NUM_MONTH_WEEKDAY_DAY, "ja_JP") - .format(dateTime); + return DateFormat(DateFormat.NUM_MONTH_WEEKDAY_DAY, "ja_JP").format(dateTime); } static String monthAndDay(DateTime dateTime) { diff --git a/lib/utils/formatter/text_input_formatter.dart b/lib/utils/formatter/text_input_formatter.dart index 50acbafb1b..9298fefc7f 100644 --- a/lib/utils/formatter/text_input_formatter.dart +++ b/lib/utils/formatter/text_input_formatter.dart @@ -1,8 +1,7 @@ import 'package:flutter/services.dart'; abstract class AppTextFieldFormatter { - static final greaterThanZero = - TextInputFormatter.withFunction((oldValue, newValue) { + static final greaterThanZero = TextInputFormatter.withFunction((oldValue, newValue) { if (newValue.text.isEmpty) { return newValue; } diff --git a/lib/utils/links.dart b/lib/utils/links.dart index c8a1ac2b91..cb39ca2f79 100644 --- a/lib/utils/links.dart +++ b/lib/utils/links.dart @@ -1,2 +1 @@ -const preimumLink = - "https://pilll.wraptas.site/fffebcb749b14d08863ecbc41943fb90"; +const preimumLink = "https://pilll.wraptas.site/fffebcb749b14d08863ecbc41943fb90"; diff --git a/lib/utils/local_notification.dart b/lib/utils/local_notification.dart index baa6f19e75..c39d9ea53b 100644 --- a/lib/utils/local_notification.dart +++ b/lib/utils/local_notification.dart @@ -30,17 +30,13 @@ import 'package:timezone/timezone.dart'; // Reminder Notification const actionIdentifier = "RECORD_PILL"; const iOSQuickRecordPillCategoryIdentifier = "PILL_REMINDER"; -const androidReminderNotificationChannelID = - "androidReminderNotificationChannelID"; -const androidCalendarScheduleNotificationChannelID = - "androidCalendarScheduleNotificationChannelID"; -const androidReminderNotificationGroupKey = - "androidReminderNotificationGroupKey"; +const androidReminderNotificationChannelID = "androidReminderNotificationChannelID"; +const androidCalendarScheduleNotificationChannelID = "androidCalendarScheduleNotificationChannelID"; +const androidReminderNotificationGroupKey = "androidReminderNotificationGroupKey"; // General Android Notification Setting // Doc: https://developer.android.com/reference/androidx/core/app/NotificationCompat#CATEGORY_REMINDER() -const androidNotificationCategoryCalendarSchedule = - "androidNotificationCategoryCalendarSchedule"; +const androidNotificationCategoryCalendarSchedule = "androidNotificationCategoryCalendarSchedule"; // Notification ID offset const fallbackNotificationIdentifier = 1; @@ -54,8 +50,7 @@ class LocalNotificationService { static Future setupTimeZone() async { tz.initializeTimeZones(); - tz.setLocalLocation( - tz.getLocation(await FlutterNativeTimezone.getLocalTimezone())); + tz.setLocalLocation(tz.getLocation(await FlutterNativeTimezone.getLocalTimezone())); } Future initialize() async { @@ -82,8 +77,7 @@ class LocalNotificationService { defaultPresentList: true, ), ), - onDidReceiveBackgroundNotificationResponse: - Platform.isAndroid ? handleNotificationAction : null, + onDidReceiveBackgroundNotificationResponse: Platform.isAndroid ? handleNotificationAction : null, ); } @@ -115,28 +109,20 @@ class LocalNotificationService { presentSound: true, ), ), - uiLocalNotificationDateInterpretation: - UILocalNotificationDateInterpretation.absoluteTime, + uiLocalNotificationDateInterpretation: UILocalNotificationDateInterpretation.absoluteTime, ); } // iOSではgetPendingNotificationRequestsWithCompletionHandlerを実行しているだけなのでおそらくエラーは発生しない - Future> - pendingReminderNotifications() async { + Future> pendingReminderNotifications() async { final pendingNotifications = await plugin.pendingNotificationRequests(); - return pendingNotifications - .where( - (element) => element.id - reminderNotificationIdentifierOffset > 0) - .toList(); + return pendingNotifications.where((element) => element.id - reminderNotificationIdentifierOffset > 0).toList(); } // iOSではgetPendingNotificationRequestsWithCompletionHandlerを実行しているだけなのでおそらくエラーは発生しない - Future> - pendingNewPillSheetNotifications() async { + Future> pendingNewPillSheetNotifications() async { final pendingNotifications = await plugin.pendingNotificationRequests(); - return pendingNotifications - .where((element) => element.id == newPillSheetNotificationIdentifier) - .toList(); + return pendingNotifications.where((element) => element.id == newPillSheetNotificationIdentifier).toList(); } } @@ -203,23 +189,15 @@ class RegisterReminderLocalNotification { final cancelReminderLocalNotification = CancelReminderLocalNotification(); // エンティティの変更があった場合にref.readで最新の状態を取得するために、Future.microtaskで更新を待ってから処理を始める // hour,minute,番号を基準にIDを決定しているので、時間変更や番号変更時にそれまで登録されていたIDを特定するのが不可能なので全てキャンセルする - await (Future.microtask(() => null), cancelReminderLocalNotification()) - .wait; + await (Future.microtask(() => null), cancelReminderLocalNotification()).wait; analytics.debug(name: "cancel_reminder_notification"); - final pillSheetGroup = - ref.read(latestPillSheetGroupProvider).asData?.valueOrNull; - final activePillSheet = - ref.read(activePillSheetProvider).asData?.valueOrNull; - final premiumOrTrial = - ref.read(userProvider).asData?.valueOrNull?.premiumOrTrial; + final pillSheetGroup = ref.read(latestPillSheetGroupProvider).asData?.valueOrNull; + final activePillSheet = ref.read(activePillSheetProvider).asData?.valueOrNull; + final premiumOrTrial = ref.read(userProvider).asData?.valueOrNull?.premiumOrTrial; final setting = ref.read(settingProvider).asData?.valueOrNull; final user = ref.read(userProvider).asData?.valueOrNull; - if (pillSheetGroup == null || - activePillSheet == null || - premiumOrTrial == null || - setting == null || - user == null) { + if (pillSheetGroup == null || activePillSheet == null || premiumOrTrial == null || setting == null || user == null) { return; } @@ -247,8 +225,7 @@ class RegisterReminderLocalNotification { // NOTE: 本来であれば各ユースケース毎に通知を登録するが、99%のケースで同じ通知を登録するのでここで登録してしまう // ただ、重要な服用通知のスケジューリング処理を邪魔しないため、awaitもしないしエラーハンドリングもしない final newPillSheetNotification = NewPillSheetNotification(); - unawaited(newPillSheetNotification.call( - pillSheetGroup: pillSheetGroup, setting: setting)); + unawaited(newPillSheetNotification.call(pillSheetGroup: pillSheetGroup, setting: setting)); } catch (e, st) { // 通知の登録に失敗しても、服用記録には影響がないのでエラーログだけ残す errorLogger.recordError(e, st); @@ -263,8 +240,7 @@ class RegisterReminderLocalNotification { final tzNow = tz.TZDateTime.now(tz.local); final List> futures = []; - final badgeNumber = - activePillSheet.todayPillNumber - activePillSheet.lastTakenPillNumber; + final badgeNumber = activePillSheet.todayPillNumber - activePillSheet.lastTakenPillNumber; for (final reminderTime in setting.reminderTimes) { // 新規ピルシートグループの作成後に通知のスケジュールができないため、多めに通知をスケジュールする @@ -281,11 +257,7 @@ class RegisterReminderLocalNotification { continue; } - final reminderDateTime = tzNow - .date() - .addDays(dayOffset) - .add(Duration(hours: reminderTime.hour)) - .add(Duration(minutes: reminderTime.minute)); + final reminderDateTime = tzNow.date().addDays(dayOffset).add(Duration(hours: reminderTime.hour)).add(Duration(minutes: reminderTime.minute)); if (reminderDateTime.isBefore(tzNow)) { analytics.debug(name: "rrrn_is_before_now", parameters: { "dayOffset": dayOffset, @@ -298,14 +270,8 @@ class RegisterReminderLocalNotification { } // 跨いでも1ピルシート分だけなので、今日の日付起点で考えて今処理しているループがactivePillSheetの次かどうかを判別し、処理中の「ピルシート中のピル番号」を計算して使用する - final isOverActivePillSheet = - activePillSheet.todayPillNumber + dayOffset > - activePillSheet.typeInfo.totalCount; - final pillNumberInPillSheet = isOverActivePillSheet - ? activePillSheet.todayPillNumber + - dayOffset - - activePillSheet.typeInfo.totalCount - : activePillSheet.todayPillNumber + dayOffset; + final isOverActivePillSheet = activePillSheet.todayPillNumber + dayOffset > activePillSheet.typeInfo.totalCount; + final pillNumberInPillSheet = isOverActivePillSheet ? activePillSheet.todayPillNumber + dayOffset - activePillSheet.typeInfo.totalCount : activePillSheet.todayPillNumber + dayOffset; var pillSheetGroupIndex = activePillSheet.groupIndex; var pillSheeType = activePillSheet.pillSheetType; @@ -317,42 +283,31 @@ class RegisterReminderLocalNotification { // activePillSheetよりも未来のPillSheet if (isOverActivePillSheet) { - final isLastPillSheet = (pillSheetGroup.pillSheets.length - 1) == - activePillSheet.groupIndex; - - switch (( - isLastPillSheet, - premiumOrTrial, - setting.isAutomaticallyCreatePillSheet - )) { + final isLastPillSheet = (pillSheetGroup.pillSheets.length - 1) == activePillSheet.groupIndex; + + switch ((isLastPillSheet, premiumOrTrial, setting.isAutomaticallyCreatePillSheet)) { case (true, true, true): // 次のピルシートグループの処理。新しいシート自動作成の場合の先読み追加 final nextPillSheetGroup = buildPillSheetGroup( setting: setting, pillSheetGroup: pillSheetGroup, - pillSheetTypes: pillSheetGroup.pillSheets - .map((e) => e.pillSheetType) - .toList(), + pillSheetTypes: pillSheetGroup.pillSheets.map((e) => e.pillSheetType).toList(), displayNumberSetting: null, ); - pillSheetDisplayNumber = - nextPillSheetGroup.displayPillNumberOnlyNumber( + pillSheetDisplayNumber = nextPillSheetGroup.displayPillNumberOnlyNumber( pillSheetAppearanceMode: pillSheetGroup.pillSheetAppearanceMode, pageIndex: 0, pillNumberInPillSheet: pillNumberInPillSheet, ); - final nextPillSheetGroupFirstPillSheet = - nextPillSheetGroup.pillSheets.first; + final nextPillSheetGroupFirstPillSheet = nextPillSheetGroup.pillSheets.first; pillSheetGroupIndex = nextPillSheetGroupFirstPillSheet.groupIndex; pillSheeType = nextPillSheetGroupFirstPillSheet.pillSheetType; case (false, _, _): // 次のピルシートを使用する場合 - final nextPillSheet = - pillSheetGroup.pillSheets[activePillSheet.groupIndex + 1]; + final nextPillSheet = pillSheetGroup.pillSheets[activePillSheet.groupIndex + 1]; pillSheetGroupIndex = nextPillSheet.groupIndex; pillSheeType = nextPillSheet.pillSheetType; - pillSheetDisplayNumber = - pillSheetGroup.displayPillNumberOnlyNumber( + pillSheetDisplayNumber = pillSheetGroup.displayPillNumberOnlyNumber( pillSheetAppearanceMode: pillSheetGroup.pillSheetAppearanceMode, pageIndex: nextPillSheet.groupIndex, pillNumberInPillSheet: pillNumberInPillSheet, @@ -364,8 +319,7 @@ class RegisterReminderLocalNotification { "dayOffset": dayOffset, "isLastPillSheet": isLastPillSheet, "premiumOrTrial": premiumOrTrial, - "isAutomaticallyCreatePillSheet": - setting.isAutomaticallyCreatePillSheet, + "isAutomaticallyCreatePillSheet": setting.isAutomaticallyCreatePillSheet, "reminderTimeHour": reminderTime.hour, "reminderTimeMinute": reminderTime.minute, }); @@ -380,8 +334,7 @@ class RegisterReminderLocalNotification { "dayOffset": dayOffset, "dosingPeriod": pillSheeType.dosingPeriod, "pillNumberInPillSheet": pillNumberInPillSheet, - "isOnNotifyInNotTakenDuration": - setting.isOnNotifyInNotTakenDuration, + "isOnNotifyInNotTakenDuration": setting.isOnNotifyInNotTakenDuration, "reminderTimeHour": reminderTime.hour, "reminderTimeMinute": reminderTime.minute, }); @@ -400,15 +353,12 @@ class RegisterReminderLocalNotification { if (premiumOrTrial) { final title = () { var result = setting.reminderNotificationCustomization.word; - if (!setting - .reminderNotificationCustomization.isInVisibleReminderDate) { + if (!setting.reminderNotificationCustomization.isInVisibleReminderDate) { result += " "; - result += - "${reminderDateTime.month}/${reminderDateTime.day} (${WeekdayFunctions.weekdayFromDate(reminderDateTime).weekdayString()})"; + result += "${reminderDateTime.month}/${reminderDateTime.day} (${WeekdayFunctions.weekdayFromDate(reminderDateTime).weekdayString()})"; } - if (!setting - .reminderNotificationCustomization.isInVisiblePillNumber) { + if (!setting.reminderNotificationCustomization.isInVisiblePillNumber) { result += " "; result += pillSheetDisplayNumber; result += "番"; @@ -425,26 +375,20 @@ class RegisterReminderLocalNotification { }(); final message = () { - if (setting - .reminderNotificationCustomization.isInVisibleDescription) { + if (setting.reminderNotificationCustomization.isInVisibleDescription) { return ""; } // 最後に飲んだ日付が数日前の場合は常にmissedTakenMessage - if (activePillSheet.todayPillNumber - - activePillSheet.lastTakenPillNumber > - 1) { - return setting - .reminderNotificationCustomization.missedTakenMessage; + if (activePillSheet.todayPillNumber - activePillSheet.lastTakenPillNumber > 1) { + return setting.reminderNotificationCustomization.missedTakenMessage; } // 本日分の服用記録がない場合で今日のループ(dayOffset==0)の時 if (dayOffset == 0 && !activePillSheet.todayPillIsAlreadyTaken) { - return setting - .reminderNotificationCustomization.dailyTakenMessage; + return setting.reminderNotificationCustomization.dailyTakenMessage; } // 本日分の服用記録がある場合で、次の日のループ(dayOffset==1)の時 if (dayOffset == 1) { - return setting - .reminderNotificationCustomization.dailyTakenMessage; + return setting.reminderNotificationCustomization.dailyTakenMessage; } return setting.reminderNotificationCustomization.missedTakenMessage; }(); @@ -486,8 +430,7 @@ class RegisterReminderLocalNotification { ), ), androidScheduleMode: AndroidScheduleMode.alarmClock, - uiLocalNotificationDateInterpretation: - UILocalNotificationDateInterpretation.absoluteTime, + uiLocalNotificationDateInterpretation: UILocalNotificationDateInterpretation.absoluteTime, ); analytics.debug(name: "rrrn_premium", parameters: { @@ -540,8 +483,7 @@ class RegisterReminderLocalNotification { ), ), androidScheduleMode: AndroidScheduleMode.alarmClock, - uiLocalNotificationDateInterpretation: - UILocalNotificationDateInterpretation.absoluteTime, + uiLocalNotificationDateInterpretation: UILocalNotificationDateInterpretation.absoluteTime, ); analytics.debug(name: "rrrn_non_premium", parameters: { @@ -591,16 +533,11 @@ class RegisterReminderLocalNotification { final groupIndex = pillSheetGroupIndex * 10000000; final hour = reminderTime.hour * 100000; final minute = reminderTime.minute * 1000; - return reminderNotificationIdentifierOffset + - groupIndex + - hour + - minute + - pillNumberInPillSheet; + return reminderNotificationIdentifierOffset + groupIndex + hour + minute + pillNumberInPillSheet; } } -final cancelReminderLocalNotificationProvider = - Provider((ref) => CancelReminderLocalNotification()); +final cancelReminderLocalNotificationProvider = Provider((ref) => CancelReminderLocalNotification()); class CancelReminderLocalNotification { // Usecase @@ -610,14 +547,12 @@ class CancelReminderLocalNotification { // - 退会 // これら以外はRegisterReminderLocalNotificationで登録し直す。なおRegisterReminderLocalNotification の内部でこの関数を読んでいる Future call() async { - final pendingNotifications = - await localNotificationService.pendingReminderNotifications(); + final pendingNotifications = await localNotificationService.pendingReminderNotifications(); analytics.debug(name: "cancel_reminder_local_notification", parameters: { "length": pendingNotifications.length, "ids": pendingNotifications.map((e) => e.id).toList().toString(), }); - await Future.wait(pendingNotifications.map((p) => localNotificationService - .cancelNotification(localNotificationID: p.id))); + await Future.wait(pendingNotifications.map((p) => localNotificationService.cancelNotification(localNotificationID: p.id))); } } @@ -628,8 +563,7 @@ extension ScheduleLocalNotificationService on LocalNotificationService { }) async { final localNotification = schedule.localNotification; if (localNotification != null) { - final remindDate = - tz.TZDateTime.from(localNotification.remindDateTime, tz.local); + final remindDate = tz.TZDateTime.from(localNotification.remindDateTime, tz.local); await plugin.zonedSchedule( localNotification.localNotificationID, "本日の予定です", @@ -647,15 +581,13 @@ extension ScheduleLocalNotificationService on LocalNotificationService { ), ), androidScheduleMode: AndroidScheduleMode.alarmClock, - uiLocalNotificationDateInterpretation: - UILocalNotificationDateInterpretation.absoluteTime, + uiLocalNotificationDateInterpretation: UILocalNotificationDateInterpretation.absoluteTime, ); } } } -final newPillSheetNotificationProvider = - Provider((ref) => NewPillSheetNotification()); +final newPillSheetNotificationProvider = Provider((ref) => NewPillSheetNotification()); // 新しいピルシートの通知をスケジュールする // PillSheetGroup.pillSheets毎にスケジュールする方法が直感的だが、ローカル通知のスケジュールができる数に上限もあるので枠を節約する意味でも一つ先のピルシートの通知をスケジュールする @@ -665,10 +597,8 @@ class NewPillSheetNotification { required PillSheetGroup pillSheetGroup, required Setting setting, }) async { - final pendingNotifications = - await localNotificationService.pendingNewPillSheetNotifications(); - await Future.wait(pendingNotifications.map((p) => localNotificationService - .cancelNotification(localNotificationID: p.id))); + final pendingNotifications = await localNotificationService.pendingNewPillSheetNotifications(); + await Future.wait(pendingNotifications.map((p) => localNotificationService.cancelNotification(localNotificationID: p.id))); final activePillSheet = pillSheetGroup.activePillSheet; if (activePillSheet == null) { @@ -708,8 +638,7 @@ class NewPillSheetNotification { ), ), androidScheduleMode: AndroidScheduleMode.alarmClock, - uiLocalNotificationDateInterpretation: - UILocalNotificationDateInterpretation.absoluteTime, + uiLocalNotificationDateInterpretation: UILocalNotificationDateInterpretation.absoluteTime, ); } catch (e, st) { // NOTE: エラーが発生しても他の通知のスケジュールを続ける @@ -726,8 +655,7 @@ class NewPillSheetNotification { for (final pillSheet in pillSheetGroup.pillSheets) { // 次のピルシートが存在する場合 if (pillSheet.groupIndex > activePillSheet.groupIndex) { - final nextBeginDate = - tz.TZDateTime.from(pillSheet.beginingDate, tz.local); + final nextBeginDate = tz.TZDateTime.from(pillSheet.beginingDate, tz.local); final reminderDateTime = nextBeginDate .date() .add( @@ -742,8 +670,7 @@ class NewPillSheetNotification { // ピルシートグループが終了する場合 if (pillSheet.groupIndex == pillSheetGroup.pillSheets.last.groupIndex) { - final nextBeginDate = tz.TZDateTime.from( - pillSheet.estimatedEndTakenDate.addDays(1), tz.local); + final nextBeginDate = tz.TZDateTime.from(pillSheet.estimatedEndTakenDate.addDays(1), tz.local); final reminderDateTime = nextBeginDate .date() .add( diff --git a/lib/utils/push_notification.dart b/lib/utils/push_notification.dart index 8bfbd832d3..af16275085 100644 --- a/lib/utils/push_notification.dart +++ b/lib/utils/push_notification.dart @@ -5,21 +5,14 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:pilll/provider/user.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; -Future requestNotificationPermissions( - RegisterRemotePushNotificationToken - registerRemotePushNotificationToken) async { +Future requestNotificationPermissions(RegisterRemotePushNotificationToken registerRemotePushNotificationToken) async { if (Platform.isIOS) { - await FirebaseMessaging.instance - .setForegroundNotificationPresentationOptions( - alert: true, badge: true, sound: true); + await FirebaseMessaging.instance.setForegroundNotificationPresentationOptions(alert: true, badge: true, sound: true); } - await FirebaseMessaging.instance.requestPermission( - alert: true, badge: true, sound: true, announcement: true); - registerRemotePushNotificationToken( - await FirebaseMessaging.instance.getToken()); + await FirebaseMessaging.instance.requestPermission(alert: true, badge: true, sound: true, announcement: true); + registerRemotePushNotificationToken(await FirebaseMessaging.instance.getToken()); if (Platform.isAndroid) { - await AndroidFlutterLocalNotificationsPlugin() - .requestExactAlarmsPermission(); + await AndroidFlutterLocalNotificationsPlugin().requestExactAlarmsPermission(); } } diff --git a/lib/utils/remote_config.dart b/lib/utils/remote_config.dart index 6ee86d613d..acac5c2ca7 100644 --- a/lib/utils/remote_config.dart +++ b/lib/utils/remote_config.dart @@ -18,20 +18,13 @@ Future setupRemoteConfig() async { minimumFetchInterval: const Duration(hours: 1), )), remoteConfig.setDefaults({ - RemoteConfigKeys.isPaywallFirst: - RemoteConfigParameterDefaultValues.isPaywallFirst, - RemoteConfigKeys.skipInitialSetting: - RemoteConfigParameterDefaultValues.skipInitialSetting, - RemoteConfigKeys.trialDeadlineDateOffsetDay: - RemoteConfigParameterDefaultValues.trialDeadlineDateOffsetDay, - RemoteConfigKeys.discountEntitlementOffsetDay: - RemoteConfigParameterDefaultValues.discountEntitlementOffsetDay, - RemoteConfigKeys.discountCountdownBoundaryHour: - RemoteConfigParameterDefaultValues.discountCountdownBoundaryHour, - RemoteConfigKeys.releasedVersion: - RemoteConfigParameterDefaultValues.releasedVersion, - RemoteConfigKeys.premiumIntroductionPattern: - RemoteConfigParameterDefaultValues.premiumIntroductionPattern, + RemoteConfigKeys.isPaywallFirst: RemoteConfigParameterDefaultValues.isPaywallFirst, + RemoteConfigKeys.skipInitialSetting: RemoteConfigParameterDefaultValues.skipInitialSetting, + RemoteConfigKeys.trialDeadlineDateOffsetDay: RemoteConfigParameterDefaultValues.trialDeadlineDateOffsetDay, + RemoteConfigKeys.discountEntitlementOffsetDay: RemoteConfigParameterDefaultValues.discountEntitlementOffsetDay, + RemoteConfigKeys.discountCountdownBoundaryHour: RemoteConfigParameterDefaultValues.discountCountdownBoundaryHour, + RemoteConfigKeys.releasedVersion: RemoteConfigParameterDefaultValues.releasedVersion, + RemoteConfigKeys.premiumIntroductionPattern: RemoteConfigParameterDefaultValues.premiumIntroductionPattern, }), remoteConfig.fetchAndActivate() ).wait; @@ -51,8 +44,7 @@ Future setupRemoteConfig() async { @Riverpod() Future appIsReleased(AppIsReleasedRef ref) async { - final releasedVersion = - Version.parse(remoteConfig.getString(RemoteConfigKeys.releasedVersion)); + final releasedVersion = Version.parse(remoteConfig.getString(RemoteConfigKeys.releasedVersion)); final packageInfo = await PackageInfo.fromPlatform(); final appVersion = Version.parse(packageInfo.version); return !appVersion.isGreaterThan(releasedVersion); diff --git a/lib/utils/remote_config.g.dart b/lib/utils/remote_config.g.dart index 1b6eadfefe..24b9b4f282 100644 --- a/lib/utils/remote_config.g.dart +++ b/lib/utils/remote_config.g.dart @@ -13,9 +13,7 @@ String _$appIsReleasedHash() => r'8a68c1d9a915644d386343a73424fda0504492e4'; final appIsReleasedProvider = AutoDisposeFutureProvider.internal( appIsReleased, name: r'appIsReleasedProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$appIsReleasedHash, + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') ? null : _$appIsReleasedHash, dependencies: null, allTransitiveDependencies: null, ); diff --git a/lib/utils/router.dart b/lib/utils/router.dart index a53a33bc72..50b26ade28 100644 --- a/lib/utils/router.dart +++ b/lib/utils/router.dart @@ -6,15 +6,13 @@ class AppRouter { // NOTE: This method call after user end all initialSetting // OR user signed with 3rd party provider // So, Don't forget when this function is edited. Both test necessary . - static Future endInitialSetting(NavigatorState navigator, - BoolSharedPreferences didEndInitialSettingNotifier) async { + static Future endInitialSetting(NavigatorState navigator, BoolSharedPreferences didEndInitialSettingNotifier) async { analytics.logEvent(name: "end_initial_setting"); await didEndInitialSettingNotifier.set(true); navigator.popUntil((router) => router.isFirst); } - static Future routeToInitialSetting(NavigatorState navigator, - BoolSharedPreferences didEndInitialSettingNotifier) async { + static Future routeToInitialSetting(NavigatorState navigator, BoolSharedPreferences didEndInitialSettingNotifier) async { analytics.logEvent(name: "route_to_initial_settings"); await didEndInitialSettingNotifier.set(false); navigator.popUntil((router) => router.isFirst); diff --git a/lib/utils/shared_preference/keys.dart b/lib/utils/shared_preference/keys.dart index 46b3ff6890..fefc29f752 100644 --- a/lib/utils/shared_preference/keys.dart +++ b/lib/utils/shared_preference/keys.dart @@ -1,11 +1,9 @@ extension BoolKey on String { static const didEndInitialSetting = "isDidEndInitialSettingKey"; - static const shownPaywallWhenAppFirstLaunch = - "shownPaywallWhenAppFirstLaunch"; + static const shownPaywallWhenAppFirstLaunch = "shownPaywallWhenAppFirstLaunch"; static const isAlreadyShowDemography = "isAlreadyShowDemography"; static const isAlreadyDoneDemography = "isAlreadyDoneDemography"; - static const isAlreadyAnsweredPreStoreReviewModal = - "isAlreadyAnsweredPreStoreReviewModal"; + static const isAlreadyAnsweredPreStoreReviewModal = "isAlreadyAnsweredPreStoreReviewModal"; static const isPreStoreReviewGoodAnswer = "isPreStoreReviewGoodAnswer"; static const migrateFrom132IsShown = "migrate_from_132_is_shown_9"; static const migration20240819 = "migration20240819"; @@ -45,6 +43,5 @@ extension ReleaseNoteKey on String { extension IntKey on String { static const String totalCountOfActionForTakenPill = "totalPillCount"; - static const String monthlyPremiumIntroductionSheetPresentedDateMilliSeconds = - "monthlyPremiumIntroductionSheetPresentedDateMilliSeconds"; + static const String monthlyPremiumIntroductionSheetPresentedDateMilliSeconds = "monthlyPremiumIntroductionSheetPresentedDateMilliSeconds"; } diff --git a/lib/utils/version/version.dart b/lib/utils/version/version.dart index 2d0df47384..05f0d4bd5b 100644 --- a/lib/utils/version/version.dart +++ b/lib/utils/version/version.dart @@ -15,9 +15,7 @@ class Version { factory Version.parse(String str) { final splited = str.split("."); if (Environment.isDevelopment) { - assert( - splited.length <= 3 || (splited.last == "dev" && splited.length == 4), - "unexpected version format $str"); + assert(splited.length <= 3 || (splited.last == "dev" && splited.length == 4), "unexpected version format $str"); } final versions = List.filled(3, 0); @@ -39,14 +37,8 @@ class Version { return Version.parse(package.version); } - bool isLessThan(Version other) => - major < other.major || - (major <= other.major && minor < other.minor) || - (major <= other.major && minor <= other.minor && patch < other.patch); - bool isGreaterThan(Version other) => - major > other.major || - (major >= other.major && minor > other.minor) || - (major >= other.major && minor >= other.minor && patch > other.patch); + bool isLessThan(Version other) => major < other.major || (major <= other.major && minor < other.minor) || (major <= other.major && minor <= other.minor && patch < other.patch); + bool isGreaterThan(Version other) => major > other.major || (major >= other.major && minor > other.minor) || (major >= other.major && minor >= other.minor && patch > other.patch); String get version { return "$major.$minor.$patch";