Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
image_service.dart
Go to the documentation of this file.
1import 'dart:convert';
2import 'dart:developer';
3import 'dart:io';
4
5import 'package:image_picker/image_picker.dart';
6
8
11
12 Future<String?> processImage(XFile? image) async {
13 if (image == null) {
14 return null;
15 }
16 try {
17 final File imageFile = File(image.path);
18 final List<int> imageBytes = await imageFile.readAsBytes();
19 return base64Encode(imageBytes);
20 } catch (e) {
21 log('Image processing error: $e');
22 return null;
23 }
24 }
25}
static final ImageService instance
ImageService _()
Future< String?> processImage(XFile? image) async