Skip to content

Commit

Permalink
fixup! drop: MemNotification v1 wip drop: EntityV1
Browse files Browse the repository at this point in the history
  • Loading branch information
zin- committed Sep 16, 2024
1 parent 7d5174b commit a8e5314
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 53 deletions.
6 changes: 3 additions & 3 deletions lib/components/created_and_updated_at_texts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ import 'package:mem/components/date_and_time/date_and_time_view.dart';
import 'package:mem/core/date_and_time/date_and_time.dart';
import 'package:mem/core/mem.dart';
import 'package:mem/logger/log_service.dart';
import 'package:mem/repositories/mem.dart';
import 'package:mem/repositories/mem_entity.dart';
import 'package:mem/values/colors.dart';

class CreatedAndUpdatedAtTexts extends StatelessWidget {
final MemV1 _entity;
final Mem _entity;

const CreatedAndUpdatedAtTexts(this._entity, {super.key});

@override
Widget build(BuildContext context) => v(
() {
if (_entity is SavedMemV1) {
if (_entity is SavedMemEntity) {
return Wrap(
direction: Axis.horizontal,
children: [
Expand Down
50 changes: 1 addition & 49 deletions lib/core/mem.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,7 @@ class Mem {

Mem(this.name, this.doneAt, this.period);

// factory Mem.defaultNew() => Mem("", null, null);
//
// bool get isDone => doneAt != null;
//
// Iterable<Schedule> periodSchedules(
// TimeOfDay startOfDay,
// ) =>
// v(
// () {
// final id = this is SavedMemV1 ? (this as SavedMemV1).id : null;
//
// return id == null
// ? throw Exception() // coverage:ignore-line
// : [
// Schedule.of(
// id,
// period?.start?.isAllDay == true
// ? DateTime(
// period!.start!.year,
// period!.start!.month,
// period!.start!.day,
// startOfDay.hour,
// startOfDay.minute,
// )
// : period?.start,
// NotificationType.startMem,
// ),
// Schedule.of(
// id,
// period?.end?.isAllDay == true
// ? DateTime(
// period!.end!.year,
// period!.end!.month,
// period!.end!.day,
// startOfDay.hour,
// startOfDay.minute,
// )
// .add(const Duration(days: 1))
// .subtract(const Duration(minutes: 1))
// : period?.end,
// NotificationType.endMem,
// ),
// ];
// },
// {
// 'this': this,
// 'startOfDay': startOfDay,
// },
// );
static Mem fromV1(MemV1 v1) => Mem(v1.name, v1.doneAt, v1.period);
}

class MemV1 extends EntityV1 {
Expand Down
6 changes: 5 additions & 1 deletion lib/mems/detail/body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ class _MemDetailBodyComponent extends StatelessWidget {
),
Padding(
padding: pageBottomPadding,
child: CreatedAndUpdatedAtTexts(_mem),
child: CreatedAndUpdatedAtTexts(
Mem.fromV1(
_mem,
),
),
),
],
),
Expand Down

0 comments on commit a8e5314

Please sign in to comment.