Переглянути джерело

Fixed compile error for deploy tool

arthur.wu 1 рік тому
батько
коміт
ae3894879b

+ 0 - 1
Tools/Flyinsono.Deployment/lib/AutoTestView.dart

@@ -4,7 +4,6 @@ import 'package:get_it/get_it.dart';
 import 'package:ustest/BuildHistoryList.dart';
 
 import 'Services/BuildService.dart';
-import 'Services/NotificationReceivedArgs.dart';
 
 class AutoTestView extends StatefulWidget {
   @override

+ 1 - 1
Tools/Flyinsono.Deployment/lib/BuildView.dart

@@ -121,7 +121,7 @@ class _BuildView extends State<BuildView> {
   void onBuild(context) {
     try {
       var service = GetIt.instance.get<BuildService>();
-      var result = service.Run();
+      var result = service.Run(BuildTargetPlatform.Linux);
     } catch (ex) {
       Logger.error("onBuild ex:${ex}");
     }

+ 11 - 20
Tools/Flyinsono.Deployment/lib/Services/BuildService.dart

@@ -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 {

+ 0 - 1
Tools/Flyinsono.Deployment/lib/operatorListView.dart

@@ -7,7 +7,6 @@ import 'package:ustest/BuildHistoryList.dart';
 import 'package:ustest/UserList.dart';
 
 import 'Services/BuildService.dart';
-import 'Services/NotificationReceivedArgs.dart';
 import 'Services/OperatorService.dart';
 
 class OperatorListView extends StatefulWidget {