Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
xulinfeng committed Apr 1, 2021
1 parent daeb802 commit 42b20b7
Show file tree
Hide file tree
Showing 106 changed files with 7,305 additions and 18 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Flutter Test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
- run: flutter pub get
- run: flutter test
- run: cd ./example && flutter build ios --simulator -t lib/ios.dart && flutter build apk -t lib/android.dart
17 changes: 17 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Publish

on:
push:
tags:
- v*.*
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
- uses: modool/flutter-package-publisher@master
with:
credentialJson: ${{ secrets.CREDENTIAL_JSON }}
93 changes: 77 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,82 @@
# See https://www.dartlang.org/guides/libraries/private-files
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# Files and directories created by pub
# blutter
blutter_tools

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

# Visual Studio Code related
.vscode/

# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.packages
.pub-cache/
.pub/
.flutter-plugins-dependencies

build/
# If you're building an application, you may want to check-in your pubspec.lock
pubspec.lock
coverage/
artifacts/
blutter_tools/

# Directory created by dartdoc
# If you don't generate documentation locally you can remove this line.
doc/api/

# Avoid committing generated Javascript files:
*.dart.js
*.info.json # Produced by the --dump-info flag.
*.js # When generated by dart2js. Don't specify *.js if your
# project includes source files written in JavaScript.
*.js_
*.js.deps
*.js.map
# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java
**/android/**/gen/

# iOS/XCode related
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/**/.sconsign.dblite
**/ios/**/.tags*
**/ios/**/.vagrant/
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*

# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

pubspec.lock
!**/example/pubspec.lock
21 changes: 21 additions & 0 deletions .idea/flutter_native.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: 20e59316b8b8474554b38493b8ca888794b0234a
channel: unknown

project_type: package
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.0.1

* Initial release.
49 changes: 49 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Contributing to the Flutter Object Cache Package
=============================================

What you will need
------------------

* 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);
* git (used for source version control, installation instruction can be found [here](https://git-scm.com/));
* The Flutter SDK (installation instructions can be found [here](https://flutter.io/get-started/install/));
* A personal GitHub account (if you don't have one, you can sign-up for free [here](https://github.com/))

Setting up your development environment
---------------------------------------

* 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.
* If you haven't configured your machine with an SSH key that's known to github, then
follow [GitHub's directions](https://help.github.com/articles/generating-ssh-keys/)
to generate an SSH key.
* Clone your forked repo on your local development machine: `git clone [email protected]:<your_name_here>/flutter_object_cache.git`
* Change into the `flutter_object_cache` directory: `cd flutter_object_cache`
* 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`

Running the example project
---------------------------

* Change into the example directory: `cd example`
* Run the App: `flutter run`

Contribute
----------

We really appreciate contributions via GitHub pull requests. To contribute take the following steps:

* Make sure you are up to date with the latest code on the master:
* `git fetch upstream`
* `git checkout upstream/develop -b <name_of_your_branch>`
* Apply your changes
* Verify your changes and fix potential warnings/ errors:
* Check formatting: `flutter format .`
* Run static analyses: `flutter analyzes`
* Run unit-tests: `flutter test`
* Commit your changes: `git commit -am "<your informative commit message>"`
* Push changes to your fork: `git push origin <name_of_your_branch>`

Send us your pull request:

* Go to `https://github.com/modool/flutter_object_cache` and click the "Compare & pull request" button.

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.
75 changes: 73 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,73 @@
# flutter_native
A native runtime package for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and call native method or variable.
# Flutter Native Runtime Package

A native runtime package for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and call native method or variable.

![Flutter Test](https://github.com/Modool/flutter_native/workflows/Flutter%20Test/badge.svg) [![pub package](https://img.shields.io/pub/v/flutter_native.svg)](https://pub.dartlang.org/packages/flutter_native) [![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)
## Features

* Access android classes.
* Access ios classes.

## Usage

To use this package, add `flutter_native` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/). For example:

```yaml
dependencies:
flutter_object_cache: 0.0.1
```
## API
### Access native
```dart
import 'package:flutter_native/flutter_native.dart';

// To get system version for ios
final iosDevice = Device();
final systemVersion = await iosDevice.systemVersion;

// To get package name for android
final context = Context();
final packageName = await context.packageName;

// Instance type for android
final registrarTarget = nativeRuntime.instanceNamed('Registrar');
```

### iOS Support class

Native Class | Futter Class
-------------|--------------
-------------|--------------
UIDevice | Device
UIScreen | Screen
UIApplication | Application
NSBundle | Bundle
NSProcessInfo | Process
NSUserDefaults | UserDefaults

### Android Support class

Native Class | Futter Class
---| ---
Context | Context
AssetManager | AssetManager
ClassLoader | ClassLoader
ApplicationInfo | ApplicationInfo
Resources | Resources
ResourcesImpl | ResourcesImpl
SharedPreferences | SharedPreferences

## Issues

Please file any issues, bugs or feature request as an issue on our [Github](https://github.com/modool/flutter_native/issues) page.

## Want to contribute

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_native/pulls).

## Author

This Flutter Native package for Flutter is developed by [modool](https://github.com/modool). You can contact us at <[email protected]>
Loading

0 comments on commit 42b20b7

Please sign in to comment.