update to fix start after goal
This commit is contained in:
@ -2,7 +2,9 @@ import 'dart:io';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:rogapp/model/destination.dart';
|
||||
import 'package:rogapp/model/rog.dart';
|
||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
import 'package:rogapp/utils/database_helper.dart';
|
||||
import 'package:sqflite/sqlite_api.dart';
|
||||
@ -190,8 +192,9 @@ class ExternalService {
|
||||
Map<String, dynamic> _res2 = {};
|
||||
|
||||
final IndexController indexController = Get.find<IndexController>();
|
||||
final DestinationController destinationController = Get.find<DestinationController>();
|
||||
|
||||
if(indexController.connectionStatusName != "wifi" && indexController.connectionStatusName != "mobile"){
|
||||
//if(indexController.connectionStatusName != "wifi" && indexController.connectionStatusName != "mobile"){
|
||||
DatabaseHelper db = DatabaseHelper.instance;
|
||||
Rog _rog = Rog(
|
||||
id:1,
|
||||
@ -204,8 +207,8 @@ class ExternalService {
|
||||
rog_action_type: 1,
|
||||
);
|
||||
db.insertRogaining(_rog);
|
||||
}
|
||||
else{
|
||||
// }
|
||||
// else{
|
||||
String server_url = ConstValues.currentServer();
|
||||
String url1 = "${server_url}/api/goalimage/";
|
||||
final im1Bytes = File(image!).readAsBytesSync();
|
||||
@ -252,7 +255,8 @@ class ExternalService {
|
||||
_res2 = json.decode(utf8.decode(response2.bodyBytes));
|
||||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
destinationController.resetRogaining();
|
||||
return _res2;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user