import 'dart:typed_data';
import 'package:flutter/services.dart';
ByteData bytes = await rootBundle.load( 'images/beautiful.jpeg' );
var buffer = bytes.buffer;
String base64 = base64.encode(Uint8List.view(buffer));
'images/beautiful.jpeg' 图片路径
import 'dart:typed_data';
import 'package:flutter/services.dart';
ByteData bytes = await rootBundle.load( 'images/beautiful.jpeg' );
var buffer = bytes.buffer;
String base64 = base64.encode(Uint8List.view(buffer));
'images/beautiful.jpeg' 图片路径
本文标题:flutter--image 转 base64
本文链接:https://www.haomeiwen.com/subject/xahkyltx.html
网友评论