Skip to content
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

feat(storage): add initial firebase storage #5

Merged
merged 3 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/recipe.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins:
firebase_core: ["tv-7.0"]
firebase_database: ["tv-7.0"]
firebase_storage: []
firebase_storage: ["tv-7.0"]
cloud_functions: ["tv-7.0"]
1 change: 1 addition & 0 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
jobs:
integration_test:
runs-on: [self-hosted]
timeout-minutes: 30
if: ${{ github.repository_owner == 'flutter-tizen' }}
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ FlutterFire for Tizen is a set of plugins that enable Flutter apps to use Fireba
| Cloud Functions | REPLACEME | [🔗](https://firebase.google.com/products/functions) | [📖](https://firebase.flutter.dev/docs/functions/overview) | [`cloud_functions`](packages/cloud_functions) |
| Core | REPLACEME | [🔗](https://firebase.google.com) | [📖](https://firebase.flutter.dev/docs/core/usage) | [`firebase_core`](packages/firebase_core) |
| Realtime Database | REPLACEME | [🔗](https://firebase.google.com/products/database) | [📖](https://firebase.flutter.dev/docs/database/overview) | [`firebase_database`](packages/firebase_database) |
| Storage | REPLACEME | [🔗](https://firebase.google.com/products/storage) | [📖](https://firebase.flutter.dev/docs/storage/overview) | [`firebase_storage`](packages/firebase_storage) |

Please note that the plugins are now in an early stage of development, as they're based on the experimental implementation of the Firebase C++ SDK for Linux desktop ([v10.4.0](https://github.com/firebase/firebase-cpp-sdk/tree/v10.4.0)). Our plan is to initially provide development versions first, and then gradually transition to a stable version as a subsequent step following stable SDK releases.

Expand All @@ -19,6 +20,7 @@ Please note that the plugins are now in an early stage of development, as they'r
| Cloud Functions | 7.0 | ✔️ | ✔️ |
| Core | 7.0 | ✔️ | ✔️ |
| Realtime Database | 7.0 | ✔️ | ✔️ |
| Storage | 7.0 | ✔️ | ✔️ |

## License

Expand Down
2 changes: 1 addition & 1 deletion packages/cloud_functions/tizen/build_def.prop
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
PREBUILD_COMMAND = ./tar_url.sh \
https://github.com/daeye0n/gooddaytocode/archive/refs/tags/v10.4.0-draft-4.tar.gz
https://raw.githubusercontent.com/hs0225/download/firebase-sdk/firebaseSDK-tizen-1.0.1.tar.gz
JSUYA marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion packages/firebase_core/tizen/build_def.prop
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
PREBUILD_COMMAND = ./tar_url.sh \
https://github.com/daeye0n/gooddaytocode/archive/refs/tags/v10.4.0-draft-4.tar.gz \
https://raw.githubusercontent.com/hs0225/download/firebase-sdk/firebaseSDK-tizen-1.0.1.tar.gz\
&& ./cp_firebase_libs.sh
3 changes: 3 additions & 0 deletions packages/firebase_storage/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
BasedOnStyle: Google
---
28 changes: 28 additions & 0 deletions packages/firebase_storage/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# VS Code related
.vscode/

# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
.packages
build/
3 changes: 3 additions & 0 deletions packages/firebase_storage/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.1.0

* Initial release.
61 changes: 61 additions & 0 deletions packages/firebase_storage/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
```
Copyright (c) 2023 Samsung Electronics Co., Ltd. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

```
Copyright 2017 The Chromium Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```

```
Copyright 2019 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
43 changes: 43 additions & 0 deletions packages/firebase_storage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# firebase_storage_tizen

The [Firebase Storage for Flutter](https://pub.dev/packages/firebase_storage) implementation for Tizen.

It offers experimental features for using Firebase on Flutter for Tizen. It works by wrapping cross-compiled libraries that are based on the [Firebase C++ SDK](https://github.com/firebase/firebase-cpp-sdk) for Linux.


# Usage

To use this package, you need to include `firebase_storage_tizen` as a dependency alongside `firebase_storage` in your `pubspec.yaml`. Please note that `firebase_storage_tizen` implementation is not officially endorsed for `firebase_storage`.

```yaml
dependencies:
firebase_storage: ^11.0.10
JSUYA marked this conversation as resolved.
Show resolved Hide resolved
firebase_storage_tizen: ^0.1.0
```

Then you can import `firebase_storage` in your Dart code:

```dart
import 'package:firebase_storage/firebase_storage.dart';
```

## Required privileges

To use this plugin in a Tizen application, you may need to declare the following privileges in your `tizen-manifest.xml` file.

```xml
<privileges>
<privilege>http://tizen.org/privilege/internet</privilege>
Swanseo0 marked this conversation as resolved.
Show resolved Hide resolved
</privileges>
```

- `http://tizen.org/privilege/internet` allows the application to access the Internet.

For the details on Tizen privileges, please see [Tizen Docs: API Privileges](https://docs.tizen.org/application/dotnet/get-started/api-privileges).

# Limitations

The following features are currently unavailable as they're not supported by the version of Firebase C++ SDK for Linux that this plugin is currently based on.

- useEmulator method of FirebaseStorage class.
- listAll method of Reference class.
92 changes: 92 additions & 0 deletions packages/firebase_storage/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# in the LICENSE file.

include: all_lint_rules.yaml
analyzer:
# TODO(rrousselGit): disable implicit-cast/implicit-dynamic
errors:
# Otherwise cause the import of all_lint_rules to warn because of some rules conflicts.
# We explicitly enabled even conflicting rules and are fixing the conflict
# in this file
included_file_warning: ignore

linter:
rules:
## Disabled rules because the repository doesn't respect them (yet)

always_put_control_body_on_new_line: false
comment_references: false
prefer_constructors_over_static_methods: false
prefer_final_fields: false
prefer_final_locals: false
omit_local_variable_types: false
avoid_equals_and_hash_code_on_mutable_classes: false

#############

# Personal preference. I don't find it more readable
cascade_invocations: false

# Conflicts with `prefer_single_quotes`
# Single quotes are easier to type and don't compromise on readability.
prefer_double_quotes: false

# Conflicts with `omit_local_variable_types` and other rules.
# As per Dart guidelines, we want to avoid unnecessary types to make the code
# more readable.
# See https://dart.dev/guides/language/effective-dart/design#avoid-type-annotating-initialized-local-variables
always_specify_types: false

# Incompatible with `prefer_final_locals`
# Having immutable local variables makes larger functions more predictible
# so we will use `prefer_final_locals` instead.
unnecessary_final: false

# Not quite suitable for Flutter, which may have a `build` method with a single
# return, but that return is still complex enough that a "body" is worth it.
prefer_expression_function_bodies: false

# Conflicts with the convention used by flutter, which puts `Key key`
# and `@required Widget child` last.
always_put_required_named_parameters_first: false

# `as` is not that bad (especially with the upcoming non-nullable types).
# Explicit exceptions is better than implicit exceptions.
avoid_as: false

# This project doesn't use Flutter-style todos
flutter_style_todos: false

# There are situations where we voluntarily want to catch everything,
# especially as a library.
avoid_catches_without_on_clauses: false

# Boring as it sometimes force a line of 81 characters to be split in two.
# As long as we try to respect that 80 characters limit, going slightly
# above is fine.
lines_longer_than_80_chars: false

# Conflicts with disabling `implicit-dynamic`
avoid_annotating_with_dynamic: false

# conflicts with `prefer_relative_imports`
always_use_package_imports: false

# Disabled for now until we have NNBD as it otherwise conflicts with `missing_return`
no_default_cases: false

# False positive, null checks don't need a message
prefer_asserts_with_message: false

# Cumbersome with `context.select`
avoid_types_on_closure_parameters: false

# Too many false positive (builders)
diagnostic_describe_all_properties: false

# false positives (setter-like functions)
avoid_positional_boolean_parameters: false

# Does not apply to providers
prefer_const_constructors_in_immutables: false
38 changes: 38 additions & 0 deletions packages/firebase_storage/example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# VS Code related
.vscode/

# Flutter/Dart/Pub related
Swanseo0 marked this conversation as resolved.
Show resolved Hide resolved
/pubspec.lock
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json
16 changes: 16 additions & 0 deletions packages/firebase_storage/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# firebase_storage_tizen_example

Demonstrates how to use the firebase_storage_tizen plugin.

## Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)

For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
10 changes: 10 additions & 0 deletions packages/firebase_storage/example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# in the LICENSE file.

include: ../../../analysis_options.yaml
linter:
rules:
avoid_print: false
depend_on_referenced_packages: false
library_private_types_in_public_api: false
Swanseo0 marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions packages/firebase_storage/example/assets/hello.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello world
Loading