Switch to using the new LibAC time/duration API
This commit is contained in:
parent
f8e3ff359d
commit
ebfc4ddc05
2 changed files with 5 additions and 14 deletions
|
@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_background/flutter_background.dart';
|
import 'package:flutter_background/flutter_background.dart';
|
||||||
import 'package:geolocator/geolocator.dart';
|
import 'package:geolocator/geolocator.dart';
|
||||||
import 'package:libac_dart/nbt/Stream.dart';
|
import 'package:libac_dart/nbt/Stream.dart';
|
||||||
|
import 'package:libac_dart/utils/TimeUtils.dart';
|
||||||
import 'package:timetrack/consts.dart';
|
import 'package:timetrack/consts.dart';
|
||||||
|
|
||||||
class SessionData {
|
class SessionData {
|
||||||
|
@ -362,19 +363,9 @@ class SessionData {
|
||||||
}
|
}
|
||||||
|
|
||||||
static String Duration2Notation(Duration time) {
|
static String Duration2Notation(Duration time) {
|
||||||
int days = time.inDays;
|
Time tm = Time.fromDuration(time);
|
||||||
int hours = time.inHours.remainder(24);
|
|
||||||
int minutes = time.inMinutes.remainder(60);
|
|
||||||
int seconds = time.inSeconds.remainder(60);
|
|
||||||
|
|
||||||
List<String> parts = [];
|
return tm.toString();
|
||||||
|
|
||||||
if (days > 0) parts.add('${days}d');
|
|
||||||
if (hours > 0) parts.add('${hours}h');
|
|
||||||
if (minutes > 0) parts.add('${minutes}m');
|
|
||||||
if (seconds > 0) parts.add('${seconds}s');
|
|
||||||
|
|
||||||
return parts.join(' ');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,10 +36,10 @@ dependencies:
|
||||||
cupertino_icons: ^1.0.8
|
cupertino_icons: ^1.0.8
|
||||||
libac_dart:
|
libac_dart:
|
||||||
hosted: https://git.zontreck.com/api/packages/Packages/pub/
|
hosted: https://git.zontreck.com/api/packages/Packages/pub/
|
||||||
version: 1.4.20325+1215
|
version: ^1.4.052525+0002
|
||||||
libacflutter:
|
libacflutter:
|
||||||
hosted: https://git.zontreck.com/api/packages/Packages/pub/
|
hosted: https://git.zontreck.com/api/packages/Packages/pub/
|
||||||
version: 1.0.31525+0222
|
version: ^1.0.052525+0051
|
||||||
dio: ^5.8.0+1
|
dio: ^5.8.0+1
|
||||||
ota_update: ^7.0.1
|
ota_update: ^7.0.1
|
||||||
geolocator: ^14.0.0
|
geolocator: ^14.0.0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue