-
Notifications
You must be signed in to change notification settings - Fork 4k
[firebase_storage] Implement "listAll" function #232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
d5b277c
added "list" function
danysz 986f85e
working on new function list
danysz 3ed451a
now we are getting the results
danysz 2f0c6d7
clean Android code
danysz 7c40d32
start working on iOS implementation
danysz fa08446
list function response is parsed from maps.
danysz 57d8426
remove logs
danysz 97e13a1
handling the listAll method from the ios side.
emildesign 8a4cb43
Changed version to 3.1.0
danysz 648220f
change format from default XCode to default "dart"
danysz 5713bdc
change in indentation
danysz ac46efc
code format
danysz 60bfa07
code format
danysz 191e2f1
code format
danysz 57ae754
change indentation
danysz 58821e0
change indentation
danysz 4cd54fb
again indentation
danysz 64ef3d2
more indentation work
danysz e1cb841
empty rows removal
danysz d5fcec0
change comment format
danysz ce8cdd1
added logs for testing
danysz 30fdd27
added logs for metadata
danysz f8830df
more logs on listAll
danysz 6292364
fix comments from PR
danysz 4f6b49c
remove unused import
danysz 799566a
fix incorrect variable
danysz 434ff6c
add missing filed
danysz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2017 The Chromium Authors & Daniel Szasz. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
part of firebase_storage; | ||
|
||
/// Metadata for a [ListResult]. ListResult stores page token, items and | ||
/// prefixes which are returned by list all results. | ||
|
||
class ListResult { | ||
danysz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ListResult({ | ||
this.pageToken, | ||
this.items, | ||
this.prefixes, | ||
}); | ||
|
||
ListResult._fromMap(Map<String, dynamic> map) | ||
: pageToken = map['pageToken'], | ||
items = map['items'].cast<String, ListResultItem>(), | ||
prefixes = map['prefixes'].cast<String, ListResultPrefix>(); | ||
|
||
final String pageToken; | ||
final Map<String, ListResultItem> items; | ||
final Map<String, ListResultPrefix> prefixes; | ||
} |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2017 The Chromium Authors & Daniel Szasz. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
part of firebase_storage; | ||
|
||
/// Metadata for a [ListResultItem]. ListResultItem stores name, bucket and | ||
/// path. | ||
|
||
class ListResultItem { | ||
danysz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ListResultItem({ | ||
this.name, | ||
this.bucket, | ||
this.path, | ||
}); | ||
|
||
final String name; | ||
final String bucket; | ||
final String path; | ||
} |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2017 The Chromium Authors & Daniel Szasz. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
part of firebase_storage; | ||
|
||
/// Metadata for a [ListResultPrefix]. ListResultPrefix stores name, bucket and | ||
/// path. | ||
|
||
class ListResultPrefix { | ||
ListResultPrefix({ | ||
this.name, | ||
this.bucket, | ||
this.path, | ||
}); | ||
|
||
final String name; | ||
final String bucket; | ||
final String path; | ||
} |
This file contains hidden or 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 |
---|---|---|
|
@@ -135,6 +135,18 @@ class StorageReference { | |
return task; | ||
} | ||
|
||
/// Asynchronously retrieves the full list of all the items and prefixes | ||
/// from a specific path. This is according to "listAll" in Android and | ||
/// iOS Swift documentation. | ||
Future<dynamic> listAll() async { | ||
return await FirebaseStorage.channel | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like you're getting a complex data structure and returning it to the developer as a |
||
.invokeMethod<dynamic>("StorageReference#listAll", <String, String>{ | ||
'app': _firebaseStorage.app?.name, | ||
'bucket': _firebaseStorage.storageBucket, | ||
'path': _pathComponents.join("/"), | ||
}); | ||
} | ||
|
||
/// Asynchronously retrieves a long lived download URL with a revokable token. | ||
/// This can be used to share the file with others, but can be revoked by a | ||
/// developer in the Firebase Console if desired. | ||
|
This file contains hidden or 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 |
---|---|---|
|
@@ -3,7 +3,7 @@ description: Flutter plugin for Firebase Cloud Storage, a powerful, simple, and | |
cost-effective object storage service for Android and iOS. | ||
author: Flutter Team <[email protected]> | ||
homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_storage | ||
version: 3.0.6 | ||
version: 3.1.0 | ||
|
||
flutter: | ||
plugin: | ||
|
@@ -14,13 +14,13 @@ flutter: | |
dependencies: | ||
flutter: | ||
sdk: flutter | ||
firebase_core: ^0.4.0 | ||
firebase_core: ^0.4.0+9 | ||
|
||
dev_dependencies: | ||
http: ^0.12.0 | ||
http: ^0.12.0+2 | ||
flutter_test: | ||
sdk: flutter | ||
uuid: "^1.0.0" | ||
uuid: ^2.0.2 | ||
flutter_driver: | ||
sdk: flutter | ||
test: any | ||
|
Empty file.
Empty file.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.