Skip to content

Commit

Permalink
WIP flutter example (#4063)
Browse files Browse the repository at this point in the history
* ADD start flutter step1

* FIX make more flutter stuff work

* FIX more flutter stuff

* FIX flutter stuff

* ADD more flutter stuff

* ADD more flutter stuff

* FIX flutter types

* ADD(flutter) query subscribe

* ADD flutter insert

* FIX some stuff

* CHANGE move flutter folder

* ADD(flutter) test

* FIX flutter test

* TRY fix test

* FIX desction

* FIX tests

* FIX test

* CHANGe(flutter) export stuff from rxdb flutter plugin

* FIX tests

* FIX more stuff

* FIX flutter stuff

* ADD flutter to docs

* FIX link
  • Loading branch information
pubkey authored Oct 19, 2022
1 parent 833ef81 commit 4c58b90
Show file tree
Hide file tree
Showing 146 changed files with 27,609 additions and 37 deletions.
77 changes: 63 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ jobs:
restore-keys: |
${{ runner.os }}-npm-angular-x7-
- name: prepare core
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
Expand Down Expand Up @@ -385,7 +385,7 @@ jobs:
restore-keys: |
${{ runner.os }}-npm-test-builds-x7-
- name: prepare core
- name: prepare RxDB core
run: |
npm install
npm run build
Expand Down Expand Up @@ -418,7 +418,7 @@ jobs:
restore-keys: |
${{ runner.os }}-npm-test-code-style-x7-
- name: prepare core
- name: prepare RxDB core
run: |
npm install
npm run build
Expand All @@ -445,7 +445,7 @@ jobs:

- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y chromium-browser
- name: prepare core
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
Expand Down Expand Up @@ -484,7 +484,7 @@ jobs:
node-version-file: '.nvmrc'
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y chromium-browser
- name: prepare core
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
Expand Down Expand Up @@ -512,7 +512,7 @@ jobs:
# TODO using latest node version does not work with expo-cli https://github.com/expo/expo-cli/issues/4478
node-version: 16.16.0

- name: prepare core
- name: prepare RxDB core
run: |
npm install
npm run build
Expand Down Expand Up @@ -556,7 +556,7 @@ jobs:
key: ${{ runner.os }}-buildx-supabase-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx
- name: prepare core
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
Expand Down Expand Up @@ -595,7 +595,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: prepare core
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
Expand Down Expand Up @@ -624,7 +624,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: prepare core
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
Expand Down Expand Up @@ -652,7 +652,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: prepare core
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
Expand Down Expand Up @@ -711,14 +711,63 @@ jobs:
with:
node-version-file: '.nvmrc'

- name: prepare core
- name: prepare RxDB core
run: |
npm install
npm run build
- name: npm run test:couchdb
run: npm run test:couchdb

test-flutter:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set node version
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.3.4'
channel: 'stable'
- run: flutter --version
- name: Reuse npm cache folder
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
./examples/flutter/javascript/node_modules
key: ${{ runner.os }}-npm-flutter-x8-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-flutter-x8-
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
rm -r node_modules
- name: flutter javascript build
working-directory: ./examples/flutter/javascript
run: |
npm run preinstall
npm install --legacy-peer-deps
npm run build
- name: Add flutter linux dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
- name: flutter test
uses: GabrielBB/[email protected]
with:
working-directory: ./examples/flutter
run: |
flutter config --enable-linux-desktop
flutter test integration_test/basics_test.dart -d linux
test-tutorials:
runs-on: ubuntu-20.04
steps:
Expand All @@ -727,7 +776,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: prepare core
- name: prepare RxDB core
run: |
npm install
npm run build
Expand All @@ -745,7 +794,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: prepare core
- name: prepare RxDB core
run: |
npm install
npm run build
Expand All @@ -762,7 +811,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: prepare core
- name: prepare RxDB core
run: |
npm install
npm run build
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,21 @@ No matter what kind of runtime you have, as long as it runs JavaScript, it can r
<img height="13" src="https://cdnjs.cloudflare.com/ajax/libs/browser-logos/39.2.2/safari/safari_24x24.png" />
<img height="13" src="https://cdnjs.cloudflare.com/ajax/libs/browser-logos/39.2.2/edge/edge_24x24.png" />
<img height="13" src="https://cdnjs.cloudflare.com/ajax/libs/browser-logos/39.2.2/archive/internet-explorer_9-11/internet-explorer_9-11_24x24.png" />
Browsers
<a href="./examples/angular">Browsers</a>
<img height="13" src="docs-src/files/icons/nodejs.png" />
Node.js
<a href="./examples/node">Node.js</a>
<img height="13" src="docs-src/files/icons/electron.png" />
Electron
<a href="./examples/electron">Electron</a>
<img height="13" src="docs-src/files/icons/react-native.png" />
React Native
<a href="./examples/react-native">React Native</a>
<img height="13" src="docs-src/files/icons/cordova.png" />
Cordova/Phonegap
<img height="13" src="docs-src/files/icons/capacitor.svg" />
Capacitor
<img height="13" src="docs-src/files/icons/nativescript.svg" />
NativeScript
<a href="https://github.com/herefishyfish/rxdb-nativescript">NativeScript</a>
<img height="13" src="docs-src/files/icons/flutter.svg" />
<a href="./examples/flutter">Flutter</a>
</h4>


Expand Down
20 changes: 20 additions & 0 deletions docs-src/files/icons/flutter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 28 additions & 18 deletions docs-src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -277,16 +277,21 @@ <h2>Online <b class="underline">is optional</b></h2>

<div class="block frameworks">
<div class="content">
<div
class="neumorphism-circle-m circle centered enlarge-on-mouse"
style="top: -10%; left: 10%;"
<a
href="https://github.com/pubkey/rxdb/tree/master/examples/angular"
target="_blank"
>
<img
src="./files/icons/angular.svg"
alt="angular"
/>
Angular
</div>
<div
class="neumorphism-circle-m circle centered enlarge-on-mouse"
style="top: -10%; left: 10%;"
>
<img
src="./files/icons/angular.svg"
alt="angular"
/>
Angular
</div>
</a>
<div
class="neumorphism-circle-m circle centered enlarge-on-mouse"
style="top: 10%; left: 58%;"
Expand Down Expand Up @@ -337,16 +342,21 @@ <h2>Online <b class="underline">is optional</b></h2>
Ionic
</div>
</a>
<div
class="neumorphism-circle-s circle centered enlarge-on-mouse"
style="top: 92%; left: 86%;"
<a
href="https://github.com/pubkey/rxdb/tree/master/examples/flutter"
target="_blank"
>
<img
src="./files/icons/jquery.svg"
alt="jQuery"
/>
jQuery
</div>
<div
class="neumorphism-circle-s circle centered enlarge-on-mouse"
style="top: 92%; left: 86%;"
>
<img
src="./files/icons/flutter.svg"
alt="Flutter"
/>
Flutter
</div>
</a>
<div
class="neumorphism-circle-m circle centered enlarge-on-mouse"
style="top: 94%; left: 11%;"
Expand Down
49 changes: 49 additions & 0 deletions examples/flutter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

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

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/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

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release


javascript/rxdb-local.tgz
javascript/node_modules
javascript/dist
45 changes: 45 additions & 0 deletions examples/flutter/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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.

version:
revision: eb6d86ee27deecba4a83536aa20f366a6044895c
channel: stable

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
base_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
- platform: android
create_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
base_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
- platform: ios
create_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
base_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
- platform: linux
create_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
base_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
- platform: macos
create_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
base_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
- platform: web
create_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
base_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
- platform: windows
create_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
base_revision: eb6d86ee27deecba4a83536aa20f366a6044895c

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
Loading

0 comments on commit 4c58b90

Please sign in to comment.