Adds a testsuite to Time API.
This commit is contained in:
parent
6ba00044af
commit
d4a6a3609e
2 changed files with 35 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
|||
import 'package:libac_flutter/nbt/Stream.dart';
|
||||
|
||||
class Time {
|
||||
int hours;
|
||||
int minutes;
|
||||
|
@ -119,4 +121,14 @@ class Time {
|
|||
|
||||
return Time(hours: hours, minutes: minutes, seconds: seconds);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
StringBuilder builder = StringBuilder();
|
||||
if (hours > 0) builder.append("${hours}h");
|
||||
if (minutes > 0) builder.append("${minutes}m");
|
||||
if (seconds > 0) builder.append("${seconds}s");
|
||||
|
||||
return "${builder}";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue