我想在 Flutter 中使用 Dio 和 multi_image_picker 插件上传多张图片。
List<Asset>这就是问题所在,因为我无法从 转换List<Asset>为List<File>所以如果您有任何解决方案可以帮助我。
尝试使用:
multi_image_picker: ^4.6.1
dio: ^3.0.4
谢谢
博纳 SR。
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:merchantside/helper/colorhelper.dart';
import 'package:merchantside/merchantside/login.dart';
import 'dart:async';
import 'package:multi_image_picker/multi_image_picker.dart';
class ListImages extends StatefulWidget {
String errorMessage = "";
@override
_ListImagesState createState() => new _ListImagesState();
}
class _ListImagesState extends State<ListImages> {
List<Asset> images = List<Asset>();
List<File> listImages = [];
@override
void initState() {
super.initState();
}
Widget buildGridView() {
return GridView.count(
crossAxisCount: 3, …Run Code Online (Sandbox Code Playgroud) 亲爱的移动开发人员,谁能帮助我,我在尝试运行时遇到了这个问题pod install
这是我的 podFile,谢谢
# platform :ios, '9.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
end
generated_key_values = {}
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) do |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip() …Run Code Online (Sandbox Code Playgroud)