flutter-freaccess-hub/lib/custom_code/actions/convert_image_file_to_base6...

23 lines
781 B
Dart

// Automatic FlutterFlow imports
import '/backend/schema/structs/index.dart';
import '/backend/schema/enums/enums.dart';
import '/actions/actions.dart' as action_blocks;
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import 'index.dart'; // Imports other custom actions
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
// Begin custom action code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!
import 'dart:convert';
import 'dart:typed_data';
Future<String?> convertImageFileToBase64(FFUploadedFile imageFile) async {
List<int>? imageBytes = imageFile.bytes;
if (imageBytes != null) {
String base64Image = base64Encode(imageBytes);
return base64Image;
}
}