From 4e2354ed00cad0e4078ec5f9c082b96bd021c3c8 Mon Sep 17 00:00:00 2001 From: jspmic Date: Fri, 29 Nov 2024 03:07:59 +0200 Subject: [PATCH] fix: removed the need to initialize LIVRAISON_RETOUR --- lib/custom_widgets.dart | 36 ------------------------------------ lib/rest.dart | 1 + 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/lib/custom_widgets.dart b/lib/custom_widgets.dart index fd6dc6d..46bca9d 100644 --- a/lib/custom_widgets.dart +++ b/lib/custom_widgets.dart @@ -12,37 +12,6 @@ Map cache2 = {}; DateTime? dateSelected; bool collineDisponible = false; -Future _getDst() async { - final directory = await getApplicationDocumentsDirectory(); - - // Create the parent directory if it doesn't exist - if (!await directory.exists()) { - await directory.create(recursive: true); - } - - return directory.path; -} - -Future _localFile(String fileName) async { - final path = await _getDst(); - return File('$path/$fileName'); -} - -Future readCounter(String fileName) async { - final file = await _localFile(fileName); - - // Read the file - return file.readAsString(); -} - -Future writeCounter(String fileName, String content) async { - final file = await _localFile(fileName); - - // Write the file - return file.writeAsString(content, mode: FileMode.append); -} - - // Function to capitalize a string String capitalize(String string){ return string[0].toUpperCase() + string.substring(1, string.length); @@ -67,11 +36,6 @@ void initialize({String? district}){ list(DISTRICT+5, district: district); return; } - list(STOCK_CENTRAL); - list(TYPE_TRANSPORT); - list(INPUT); - list(DISTRICT); - list(LIVRAISON_RETOUR); } // Custom DatePicker widget diff --git a/lib/rest.dart b/lib/rest.dart index c0e1f1f..03b60fb 100644 --- a/lib/rest.dart +++ b/lib/rest.dart @@ -8,6 +8,7 @@ import 'package:soft/excel_fields.dart'; String? HOST; init() async{ + cache[LIVRAISON_RETOUR] = ["Livraison", "Retour"]; await dotenv.load(fileName: ".env"); HOST = dotenv.env["HOST"].toString(); }