Skip to content

Commit bcd94e7

Browse files
levenonxulinfeng
authored and
xulinfeng
committed
Initial commit
0 parents  commit bcd94e7

File tree

87 files changed

+5200
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+5200
-0
lines changed

.github/workflows/dart.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Flutter Test
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
runs-on: macos-latest
12+
steps:
13+
- uses: actions/checkout@v1
14+
- uses: subosito/flutter-action@v1
15+
with:
16+
channel: 'stable'
17+
- run: flutter pub get
18+
- run: flutter test
19+
- run: cd ./example && flutter build ios --simulator && flutter build apk

.github/workflows/publish.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- v*.*
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: subosito/flutter-action@v1
13+
with:
14+
channel: 'stable'
15+
- uses: modool/flutter-package-publisher@master
16+
with:
17+
credentialJson: ${{ secrets.CREDENTIAL_JSON }}

.gitignore

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
12+
# blutter
13+
blutter_tools
14+
15+
# IntelliJ related
16+
*.iml
17+
*.ipr
18+
*.iws
19+
.idea/
20+
21+
# Visual Studio Code related
22+
.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
**/doc/api/
26+
.dart_tool/
27+
.flutter-plugins
28+
.packages
29+
.pub-cache/
30+
.pub/
31+
.flutter-plugins-dependencies
32+
33+
build/
34+
coverage/
35+
artifacts/
36+
blutter_tools/
37+
38+
# Android related
39+
**/android/**/gradle-wrapper.jar
40+
**/android/.gradle
41+
**/android/captures/
42+
**/android/gradlew
43+
**/android/gradlew.bat
44+
**/android/local.properties
45+
**/android/**/GeneratedPluginRegistrant.java
46+
**/android/**/gen/
47+
48+
# iOS/XCode related
49+
**/ios/**/*.mode1v3
50+
**/ios/**/*.mode2v3
51+
**/ios/**/*.moved-aside
52+
**/ios/**/*.pbxuser
53+
**/ios/**/*.perspectivev3
54+
**/ios/**/*sync/
55+
**/ios/**/.sconsign.dblite
56+
**/ios/**/.tags*
57+
**/ios/**/.vagrant/
58+
**/ios/**/DerivedData/
59+
**/ios/**/Icon?
60+
**/ios/**/Pods/
61+
**/ios/**/.symlinks/
62+
**/ios/**/profile
63+
**/ios/**/xcuserdata
64+
**/ios/.generated/
65+
**/ios/Flutter/App.framework
66+
**/ios/Flutter/Flutter.framework
67+
**/ios/Flutter/Generated.xcconfig
68+
**/ios/Flutter/app.flx
69+
**/ios/Flutter/app.zip
70+
**/ios/Flutter/flutter_assets/
71+
**/ios/ServiceDefinitions.json
72+
**/ios/Runner/GeneratedPluginRegistrant.*
73+
74+
# Exceptions to above rules.
75+
!**/ios/**/default.mode1v3
76+
!**/ios/**/default.mode2v3
77+
!**/ios/**/default.pbxuser
78+
!**/ios/**/default.perspectivev3
79+
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
80+
81+
pubspec.lock
82+
!**/example/pubspec.lock

.metadata

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: 7a4c33425ddd78c54aba07d86f3f9a4a0051769b
8+
channel: stable
9+
10+
project_type: package

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.0.1
2+
3+
* Initial release.

CONTRIBUTING.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
Contributing to the Flutter Object Cache Package
2+
=============================================
3+
4+
What you will need
5+
------------------
6+
7+
* A Linux, Mac OS X, or Windows machine (note: to run and compile iOS specific parts you'll need access to a Mac OS X machine);
8+
* git (used for source version control, installation instruction can be found [here](https://git-scm.com/));
9+
* The Flutter SDK (installation instructions can be found [here](https://flutter.io/get-started/install/));
10+
* A personal GitHub account (if you don't have one, you can sign-up for free [here](https://github.com/))
11+
12+
Setting up your development environment
13+
---------------------------------------
14+
15+
* Fork `https://github.com/modool/flutter_object_cache` into your own GitHub account. If you already have a fork and moving to a new computer, make sure you update you fork.
16+
* If you haven't configured your machine with an SSH key that's known to github, then
17+
follow [GitHub's directions](https://help.github.com/articles/generating-ssh-keys/)
18+
to generate an SSH key.
19+
* Clone your forked repo on your local development machine: `git clone [email protected]:<your_name_here>/flutter_object_cache.git`
20+
* Change into the `flutter_object_cache` directory: `cd flutter_object_cache`
21+
* Add an upstream to the original repo, so that fetch from the master repository and not your clone: `git remote add upstream [email protected]:Modool/flutter_object_cache.git`
22+
23+
Running the example project
24+
---------------------------
25+
26+
* Change into the example directory: `cd example`
27+
* Run the App: `flutter run`
28+
29+
Contribute
30+
----------
31+
32+
We really appreciate contributions via GitHub pull requests. To contribute take the following steps:
33+
34+
* Make sure you are up to date with the latest code on the master:
35+
* `git fetch upstream`
36+
* `git checkout upstream/develop -b <name_of_your_branch>`
37+
* Apply your changes
38+
* Verify your changes and fix potential warnings/ errors:
39+
* Check formatting: `flutter format .`
40+
* Run static analyses: `flutter analyzes`
41+
* Run unit-tests: `flutter test`
42+
* Commit your changes: `git commit -am "<your informative commit message>"`
43+
* Push changes to your fork: `git push origin <name_of_your_branch>`
44+
45+
Send us your pull request:
46+
47+
* Go to `https://github.com/modool/flutter_object_cache` and click the "Compare & pull request" button.
48+
49+
Please make sure you solved all warnings and errors reported by the static code analyses and that you fill in the full pull request template. Failing to do so will result in us asking you to fix it.

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Modool
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the Software), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Flutter Object Cache Package
2+
3+
A Flutter package for caching object into memory or disk.
4+
5+
![Flutter Test](https://github.com/Modool/flutter_object_cache/workflows/Flutter%20Test/badge.svg) [![pub package](https://img.shields.io/pub/v/flutter_object_cache.svg)](https://pub.dartlang.org/packages/flutter_object_cache) [![Build Status](https://app.bitrise.io/app/fa4f5d4bf452bcfb/status.svg?token=HorGpL_AOw2llYz39CjmdQ&branch=master)](https://app.bitrise.io/app/fa4f5d4bf452bcfb) [![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://github.com/tenhobi/effective_dart)
6+
7+
8+
9+
## Features
10+
11+
* Provide 3 ways to cache object, memory cache, disk cache(sqlite database), mixed with disk and memory.
12+
* Support to cache object of any type by ObjectCodec.
13+
* Provide default codecs for base type, such as int, double, boolean, string, List, Map, ByteData.
14+
* Support genericity to write object into database or read from database.
15+
* Provide default rules(fifo, lifo) to control write operation,
16+
17+
## Usage
18+
19+
To use this package, add `flutter_object_cache` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/). For example:
20+
21+
```yaml
22+
dependencies:
23+
flutter_object_cache: 0.0.1
24+
```
25+
26+
## Issues
27+
28+
Please file any issues, bugs or feature request as an issue on our [Github](https://github.com/modool/flutter_object_cache/issues) page.
29+
30+
## Want to contribute
31+
32+
If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our [contribution guide](CONTRIBUTING.md) and send us your [pull request](https://github.com/modool/flutter_cache/pulls).
33+
34+
## Author
35+
36+
This Flutter object cache package for Flutter is developed by [modool](https://github.com/modool). You can contact us at <[email protected]>

example/.gitignore

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
12+
# IntelliJ related
13+
*.iml
14+
*.ipr
15+
*.iws
16+
.idea/
17+
18+
# The .vscode folder contains launch configuration and tasks you configure in
19+
# VS Code which you may wish to be included in version control, so this line
20+
# is commented out by default.
21+
#.vscode/
22+
23+
# Flutter/Dart/Pub related
24+
**/doc/api/
25+
**/ios/Flutter/.last_build_id
26+
.dart_tool/
27+
.flutter-plugins
28+
.flutter-plugins-dependencies
29+
.packages
30+
.pub-cache/
31+
.pub/
32+
/build/
33+
34+
# Web related
35+
lib/generated_plugin_registrant.dart
36+
37+
# Symbolication related
38+
app.*.symbols
39+
40+
# Obfuscation related
41+
app.*.map.json

example/.metadata

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: 78910062997c3a836feee883712c241a5fd22983
8+
channel: unknown
9+
10+
project_type: app

example/README.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# flutter_object_cache_example
2+
3+
Demonstrates how to use the flutter_object_cache plugin.
4+
5+
## Getting Started
6+
7+
This project is a starting point for a Flutter application.
8+
9+
A few resources to get you started if this is your first Flutter project:
10+
11+
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12+
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13+
14+
For help getting started with Flutter, view our
15+
[online documentation](https://flutter.dev/docs), which offers tutorials,
16+
samples, guidance on mobile development, and a full API reference.

example/android/.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java
8+
9+
# Remember to never publicly share your keystore.
10+
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11+
key.properties

example/android/app/build.gradle

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
def localProperties = new Properties()
2+
def localPropertiesFile = rootProject.file('local.properties')
3+
if (localPropertiesFile.exists()) {
4+
localPropertiesFile.withReader('UTF-8') { reader ->
5+
localProperties.load(reader)
6+
}
7+
}
8+
9+
def flutterRoot = localProperties.getProperty('flutter.sdk')
10+
if (flutterRoot == null) {
11+
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12+
}
13+
14+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15+
if (flutterVersionCode == null) {
16+
flutterVersionCode = '1'
17+
}
18+
19+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20+
if (flutterVersionName == null) {
21+
flutterVersionName = '1.0'
22+
}
23+
24+
apply plugin: 'com.android.application'
25+
apply plugin: 'kotlin-android'
26+
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27+
28+
android {
29+
compileSdkVersion 29
30+
31+
sourceSets {
32+
main.java.srcDirs += 'src/main/kotlin'
33+
}
34+
35+
lintOptions {
36+
disable 'InvalidPackage'
37+
}
38+
39+
defaultConfig {
40+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41+
applicationId "com.example.flutter_object_cache_example"
42+
minSdkVersion 16
43+
targetSdkVersion 29
44+
versionCode flutterVersionCode.toInteger()
45+
versionName flutterVersionName
46+
}
47+
48+
buildTypes {
49+
release {
50+
// TODO: Add your own signing config for the release build.
51+
// Signing with the debug keys for now, so `flutter run --release` works.
52+
signingConfig signingConfigs.debug
53+
}
54+
}
55+
}
56+
57+
flutter {
58+
source '../..'
59+
}
60+
61+
dependencies {
62+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
63+
}

0 commit comments

Comments
 (0)