Skip to content

Commit

Permalink
fix: removed the need to initialize LIVRAISON_RETOUR
Browse files Browse the repository at this point in the history
  • Loading branch information
jspmic committed Nov 29, 2024
1 parent 3219690 commit 4e2354e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
36 changes: 0 additions & 36 deletions lib/custom_widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,6 @@ Map<String?, List> cache2 = {};
DateTime? dateSelected;
bool collineDisponible = false;

Future<String> _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<File> _localFile(String fileName) async {
final path = await _getDst();
return File('$path/$fileName');
}

Future<String> readCounter(String fileName) async {
final file = await _localFile(fileName);

// Read the file
return file.readAsString();
}

Future<File> 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);
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/rest.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 4e2354e

Please sign in to comment.