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

asartalo / diligence / 8476139779

29 Mar 2024 01:54AM UTC coverage: 92.831%. First build
8476139779

Pull #34

github

web-flow
Merge cd5eb9667 into e2a82f47f
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

83.33
/lib/ui/components/clock_wrap.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 'dart:async';
18

19
import 'package:flutter/material.dart';
20

21
typedef ClockCallback = Widget Function(DateTime time);
22

23
class ClockWrap extends StatefulWidget {
24
  final ClockCallback builder;
25
  const ClockWrap({super.key, required this.builder});
1✔
26

27
  @override
1✔
28
  State<ClockWrap> createState() => _ClockWrapState();
1✔
29
}
30

31
class _ClockWrapState extends State<ClockWrap> {
32
  late Timer timer;
33
  late DateTime time;
34

35
  @override
1✔
36
  void initState() {
37
    super.initState();
1✔
38
    time = DateTime.now();
2✔
39
    timer = Timer.periodic(const Duration(minutes: 1), (Timer t) {
3✔
40
      if (mounted) {
1✔
NEW
41
        setState(() {
×
NEW
42
          time = DateTime.now();
×
43
        });
44
      }
45
    });
46
  }
47

48
  @override
1✔
49
  Widget build(BuildContext context) {
50
    return widget.builder(time);
4✔
51
  }
52
}
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