-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support to latest flutter version
- Loading branch information
leonardo.gabriel
committed
Dec 20, 2024
1 parent
fb87c8b
commit 526b329
Showing
8 changed files
with
141 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,53 @@ | ||
import 'package:lime/lime.dart'; | ||
|
||
import '../../client.dart'; | ||
import '../base.extension.dart'; | ||
import 'uri_templates.dart'; | ||
|
||
const postmasterName = 'postmaster'; | ||
const postmasterDomain = 'media'; | ||
|
||
class MediaExtension extends BaseExtension { | ||
MediaExtension(final Client client, final String domain) | ||
: super(client, | ||
to: Node( | ||
name: postmasterName, domain: '$postmasterDomain.$domain')); | ||
MediaExtension(super.client, final String domain) | ||
: super( | ||
to: Node( | ||
name: postmasterName, | ||
domain: '$postmasterDomain.$domain', | ||
), | ||
); | ||
|
||
Future<Command> getUploadToken({bool secure = false}) { | ||
return processCommand(createGetCommand( | ||
buildResourceQuery(UriTemplates.mediaUpload, {'secure': secure}))); | ||
return processCommand( | ||
buildUploadTokenComand( | ||
secure: secure, | ||
), | ||
); | ||
} | ||
|
||
Command buildUploadTokenComand({bool secure = false}) { | ||
return createGetCommand( | ||
buildResourceQuery( | ||
UriTemplates.mediaUpload, | ||
{ | ||
'secure': secure, | ||
}, | ||
), | ||
); | ||
} | ||
|
||
Future<Command> refreshMedia(id) { | ||
return processCommand( | ||
createGetCommand(buildUri(UriTemplates.refreshMedia, [id]))); | ||
buildRefreshMediaCommand(id), | ||
); | ||
} | ||
|
||
Command buildRefreshMediaCommand(id) { | ||
return createGetCommand( | ||
buildUri( | ||
UriTemplates.refreshMedia, | ||
[ | ||
id, | ||
], | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.