How to get a base64 string from an image from an URL, using in a web application?

Troubleshooting

I have a web application, and I need to create an action to get the base64 string from an image from its url.

This code works fine only in Android or IOS. In web application it fails: Unsuported operation _Namespace.

I read this is a limitation of dart.io library, but I didn´t find a way around this problem.I read that this is a limitation of dart.io, but I didn't find a way around this.

What have you tried so far?
// Automatic FlutterFlow imports
import '/backend/backend.dart';
import '/backend/schema/structs/index.dart';
import '/backend/supabase/supabase.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/custom_code/actions/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:async';
import 'dart:convert';
import 'dart:math' as math;
import 'dart:io';

Future<String> imagePathToBase64(String imagePath) async {
  try {
    List<int> imageBytes = await File(imagePath).readAsBytes();
    String base64Image = base64Encode(imageBytes);
    return 'base64 ' + base64Image;
  } catch (ex) {
    return ex.toString();
  }
}
Did you check FlutterFlow's Documentation for this topic?
Yes