Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
fluttertpc_get
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jason Law
2020-12-01 07:59:13 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c5601c4d119b6bffa078057d0b325f4e6b8f0c68
c5601c4d
1 parent
85d08f33
Added support to List<MultipartFile>
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
lib/get_connect/http/src/multipart/form_data.dart
lib/get_connect/http/src/multipart/form_data.dart
View file @
c5601c4
...
...
@@ -10,9 +10,13 @@ class FormData {
FormData
(
Map
<
String
,
dynamic
>
map
)
:
boundary
=
_getBoundary
()
{
urlEncode
(
map
,
''
,
false
,
(
key
,
value
)
{
if
(
value
==
null
)
return
;
(
value
is
MultipartFile
)
?
files
.
add
(
MapEntry
(
key
,
value
))
:
fields
.
add
(
MapEntry
(
key
,
value
.
toString
()));
if
(
value
is
MultipartFile
)
{
files
.
add
(
MapEntry
(
key
,
value
));
}
else
if
(
value
is
List
<
MultipartFile
>)
{
files
.
addAll
(
value
.
map
((
e
)
=>
MapEntry
(
key
,
e
)));
}
else
{
fields
.
add
(
MapEntry
(
key
,
value
.
toString
()));
}
return
;
});
}
...
...
Please
register
or
login
to post a comment