Skip to content

Commit

Permalink
🫥 Simplfied the Payload constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
HeySreelal committed Jun 26, 2024
1 parent fd3b872 commit ca3bb1d
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 346 deletions.
6 changes: 3 additions & 3 deletions lib/src/televerse/models/payload.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Payload {
/// Each map associates a field key (a `String`) with its corresponding
/// `MultipartFile` object. This type is typically used to represent a collection
/// of files to be uploaded in a multipart request. (See [Payload.files] for details)
Payload({Map<String, dynamic>? params, this.files}) : params = params ?? {};
Payload([Map<String, dynamic>? params, this.files]) : params = params ?? {};

/// Creates a new `Payload` instance from an existing map of parameters and a list of multipart files.
///
Expand All @@ -72,8 +72,8 @@ class Payload {
/// A new `Payload` object with the provided parameters and files.
factory Payload.from([Map<String, dynamic>? params, PayloadFiles? files]) =>
Payload(
params: params,
files: files,
params,
files,
);

/// Get the parameter value for the key
Expand Down
Loading

0 comments on commit ca3bb1d

Please sign in to comment.