• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

asartalo / diligence / 8476139677

29 Mar 2024 01:53AM UTC coverage: 92.831%. First build
8476139677

Pull #34

github

asartalo
ci: update workflows for new branch structure
Pull Request #34: diligent implementation using sqlite3 and MVP features

1046 of 1126 new or added lines in 56 files covered. (92.9%)

1282 of 1381 relevant lines covered (92.83%)

2.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.67
/lib/models/task_commons.dart
1
// Diligence - A Task Management App
2
//
3
// Copyright (C) 2024 Wayne Duran <asartalo@gmail.com>
4
//
5
// This program is free software: you can redistribute it and/or modify it under
6
// the terms of the GNU General Public License as published by the Free Software
7
// Foundation, either version 3 of the License, or (at your option) any later
8
// version.
9
//
10
// This program is distributed in the hope that it will be useful, but WITHOUT
11
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License along with
15
// this program. If not, see <https://www.gnu.org/licenses/>.
16

17
import 'task.dart';
18

19
mixin TaskCommons implements Task {
20
  String? normalizedDetails(String? str) {
10✔
21
    if (str is String && str.trim().isEmpty) {
16✔
22
      return null;
23
    }
24

25
    return str ?? details;
9✔
26
  }
27

28
  DateTime? normalizedDoneAt(bool? doneIntent, DateTime? dt) {
10✔
29
    if (doneIntent == null) {
30
      if (dt == null) {
31
        return doneAt;
9✔
32
      }
33
      if (dt != doneAt) {
4✔
34
        return dt;
35
      }
36
    }
37

38
    if (doneIntent == done) {
10✔
NEW
39
      if (dt is DateTime && dt != doneAt) {
×
40
        return dt;
41
      }
42

NEW
43
      return doneAt;
×
44
    }
45

46
    if (doneIntent == true) {
5✔
47
      return DateTime.now();
4✔
48
    }
49

50
    return null;
51
  }
52

53
  @override
3✔
54
  Task markDone() {
55
    return copyWith(done: true);
3✔
56
  }
57

58
  @override
2✔
59
  Task markNotDone() {
60
    return copyWith(done: false);
2✔
61
  }
62
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc