|
@@ -1,10 +1,12 @@
|
|
|
import 'dart:convert';
|
|
|
import 'package:colorize_logger/colorize_logger.dart';
|
|
|
import 'package:get_it/get_it.dart';
|
|
|
+import 'package:intl/intl.dart';
|
|
|
import 'package:ustest/Services/BuildTargetPlatform.dart';
|
|
|
import 'dart:typed_data';
|
|
|
|
|
|
class BuildService {
|
|
|
+ List<BuildHistory> list = [];
|
|
|
Future<BuildHistory> LoadDataAsync() async {
|
|
|
dynamic datas = []; //TODO
|
|
|
var list =
|
|
@@ -25,32 +27,21 @@ class BuildService {
|
|
|
// var list =
|
|
|
// datas.map<BuildHistory>((json) => BuildHistory.fromJson(json)).toList();
|
|
|
//TODO refactor data should from server
|
|
|
- List<BuildHistory> list = [];
|
|
|
+
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ Run(BuildTargetPlatform platform) {
|
|
|
+ DateTime myDateTime = DateTime.now();
|
|
|
+ String formattedDateTime = DateFormat('yyyyMMddHHmmss').format(myDateTime);
|
|
|
list.add(new BuildHistory(
|
|
|
- id: "id1",
|
|
|
+ id: "id_" + formattedDateTime,
|
|
|
userName: '',
|
|
|
status: BuildStatus.Building,
|
|
|
- platform: BuildTargetPlatform.Windows,
|
|
|
- startTime: DateTime.now(),
|
|
|
- endTime: DateTime.now()));
|
|
|
- list.add(new BuildHistory(
|
|
|
- id: "id2",
|
|
|
- userName: '',
|
|
|
- status: BuildStatus.Done,
|
|
|
- platform: BuildTargetPlatform.Linux,
|
|
|
+ platform: platform,
|
|
|
startTime: DateTime.now(),
|
|
|
endTime: DateTime.now()));
|
|
|
- list.add(new BuildHistory(
|
|
|
- id: "id3",
|
|
|
- userName: '',
|
|
|
- status: BuildStatus.Cancelled,
|
|
|
- platform: BuildTargetPlatform.IOS,
|
|
|
- startTime: DateTime.now(),
|
|
|
- endTime: DateTime.now()));
|
|
|
- return list;
|
|
|
}
|
|
|
-
|
|
|
- Run() {}
|
|
|
}
|
|
|
|
|
|
class BuildHistory {
|