Skip to content

Commit a9f4966

Browse files
authored
Merge pull request #136 from objectbox/sync
Sync client
2 parents f3787e9 + a7252df commit a9f4966

File tree

102 files changed

+2768
-41
lines changed

Some content is hidden

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

102 files changed

+2768
-41
lines changed

example/flutter/objectbox_demo/lib/main.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
import 'dart:async';
2+
import 'dart:io';
3+
14
import 'package:flutter/material.dart';
2-
import 'package:objectbox/objectbox.dart';
35
import 'package:intl/intl.dart';
46
import 'package:path_provider/path_provider.dart';
5-
import 'objectbox.g.dart';
7+
import 'package:objectbox/objectbox.dart';
68
import 'package:objectbox/observable.dart';
7-
import 'dart:async';
8-
import 'dart:io';
9+
10+
import 'objectbox.g.dart';
911

1012
@Entity()
1113
class Note {
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
.dart_tool/
26+
.flutter-plugins*
27+
.packages
28+
.pub-cache/
29+
.pub/
30+
/build/
31+
32+
# Web related
33+
lib/generated_plugin_registrant.dart
34+
35+
# Exceptions to above rules.
36+
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
37+
38+
objectbox
Lines changed: 10 additions & 0 deletions
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: a4d5266b769e92286a48f6b6714e538f2c4578dc
8+
channel: master
9+
10+
project_type: app
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# objectbox_demo
2+
3+
## Getting Started
4+
5+
This project contains the Flutter version of the main example from the [objectbox-examples](https://github.com/objectbox/objectbox-examples) repository.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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 28
30+
31+
sourceSets {
32+
main.java.srcDirs += 'src/main/kotlin'
33+
}
34+
35+
lintOptions {
36+
disable 'InvalidPackage'
37+
}
38+
39+
defaultConfig {
40+
applicationId "com.example.objectbox_demo"
41+
minSdkVersion 16
42+
targetSdkVersion 28
43+
versionCode flutterVersionCode.toInteger()
44+
versionName flutterVersionName
45+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
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+
testImplementation 'junit:junit:4.12'
64+
androidTestImplementation 'androidx.test:runner:1.1.1'
65+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
66+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.example.objectbox_demo">
3+
<!-- Flutter needs it to communicate with the running application
4+
to allow setting breakpoints, to provide hot reload, etc.
5+
-->
6+
<uses-permission android:name="android.permission.INTERNET"/>
7+
</manifest>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.example.objectbox_demo">
3+
<application
4+
android:label="objectbox_demo"
5+
android:icon="@mipmap/ic_launcher">
6+
7+
<meta-data
8+
android:name="flutterEmbedding"
9+
android:value="2" />
10+
11+
<activity
12+
android:name=".MainActivity"
13+
android:launchMode="singleTop"
14+
android:theme="@style/LaunchTheme"
15+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
16+
android:hardwareAccelerated="true"
17+
android:windowSoftInputMode="adjustResize">
18+
<!-- Specify that the launch screen should continue being displayed -->
19+
<!-- until Flutter renders its first frame. -->
20+
<meta-data
21+
android:name="io.flutter.embedding.android.SplashScreenDrawable"
22+
android:resource="@drawable/launch_background" />
23+
24+
<!-- Theme to apply as soon as Flutter begins rendering frames -->
25+
<meta-data
26+
android:name="io.flutter.embedding.android.NormalTheme"
27+
android:resource="@style/NormalTheme" />
28+
<intent-filter>
29+
<action android:name="android.intent.action.MAIN"/>
30+
<category android:name="android.intent.category.LAUNCHER"/>
31+
</intent-filter>
32+
</activity>
33+
</application>
34+
</manifest>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package com.example.objectbox_demo
2+
3+
import io.flutter.embedding.android.FlutterActivity
4+
5+
class MainActivity: FlutterActivity() {
6+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Modify this file to customize your launch splash screen -->
3+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4+
<item android:drawable="@android:color/white" />
5+
6+
<!-- You can insert your own image assets here -->
7+
<!-- <item>
8+
<bitmap
9+
android:gravity="center"
10+
android:src="@mipmap/launch_image" />
11+
</item> -->
12+
</layer-list>

0 commit comments

Comments
 (0)