forked from lukepighetti/fluro
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
70 changed files
with
1,644 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# mac system | ||
.DS_Store | ||
|
||
# intellij | ||
.idea | ||
|
||
# dart / flutter | ||
.packages | ||
pubspec.lock | ||
coverage | ||
__temp_coverage* | ||
__temp_coverage* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
.DS_Store | ||
|
||
.atom/ | ||
.idea | ||
.packages | ||
.pub/ | ||
build/ | ||
ios/.generated/ | ||
packages | ||
pubspec.lock | ||
.flutter-plugins | ||
|
||
# temporary | ||
Podfile.lock | ||
|
||
## Build generated | ||
build/ | ||
DerivedData/ | ||
|
||
## Various settings | ||
*.pbxuser | ||
!default.pbxuser | ||
*.mode1v3 | ||
!default.mode1v3 | ||
*.mode2v3 | ||
!default.mode2v3 | ||
*.perspectivev3 | ||
!default.perspectivev3 | ||
xcuserdata/ | ||
|
||
## Other | ||
*.moved-aside | ||
*.xcuserstate | ||
|
||
## Obj-C/Swift specific | ||
*.hmap | ||
*.ipa | ||
*.dSYM.zip | ||
*.dSYM | ||
|
||
## Playgrounds | ||
timeline.xctimeline | ||
playground.xcworkspace | ||
|
||
# Swift Package Manager | ||
# | ||
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. | ||
# Packages/ | ||
.build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="JAVA_MODULE" version="4"> | ||
<component name="NewModuleRootManager" inherit-compiler-output="true"> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$/android"> | ||
<sourceFolder url="file://$MODULE_DIR$/android/app/src/main/java" isTestSource="false" /> | ||
</content> | ||
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
<orderEntry type="library" name="Flutter for Android" level="project" /> | ||
</component> | ||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries | ||
.DS_Store | ||
/build | ||
/captures | ||
PluginRegistry.java | ||
|
||
/gradle | ||
/gradlew | ||
/gradlew.bat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
// flutter | ||
def localProperties = new Properties() | ||
def localPropertiesFile = rootProject.file('local.properties') | ||
if (localPropertiesFile.exists()) { | ||
localPropertiesFile.withInputStream { stream -> | ||
localProperties.load(stream) | ||
} | ||
} | ||
|
||
def flutterRoot = localProperties.getProperty('flutter.sdk') | ||
if (flutterRoot == null) { | ||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") | ||
} | ||
|
||
apply plugin: 'com.android.application' | ||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" | ||
|
||
flutter { | ||
source '../..' | ||
} | ||
|
||
// build versioning | ||
def currentVersionCode() { | ||
def propsFile = file('versions.properties') | ||
def props = new Properties() | ||
props.load(new FileInputStream(propsFile)) | ||
return props['build.versionCode'].toInteger() | ||
} | ||
|
||
def incrementVersionCode() { | ||
def propsFile = file('versions.properties') | ||
def props = new Properties() | ||
props.load(new FileInputStream(propsFile)) | ||
def currentCode = props['build.versionCode'].toInteger() | ||
def nextCode = currentCode + 1 | ||
props['build.versionCode'] = nextCode.toString() | ||
props.store(propsFile.newWriter(), null) | ||
return nextCode | ||
} | ||
|
||
// increments build version code on release builds | ||
task('incrementVersionCode') << { | ||
incrementVersionCode() | ||
} | ||
|
||
tasks.whenTaskAdded { task -> | ||
if (task.name == 'assembleRelease') { | ||
task.dependsOn 'incrementVersionCode' | ||
} | ||
} | ||
|
||
buildscript { | ||
// application variables | ||
ext.app_ver_name = "1.0" | ||
|
||
// google version codes | ||
ext.build_tools_ver = '25.0.3' | ||
ext.support_lib_ver = '25.3.1' | ||
ext.google_play_ver = '10.2.4' | ||
ext.constraint_layout_ver = '1.0.2' | ||
} | ||
|
||
android { | ||
compileSdkVersion 25 | ||
buildToolsVersion "$build_tools_ver" | ||
|
||
defaultConfig { | ||
minSdkVersion 19 | ||
targetSdkVersion 25 | ||
applicationId "com.goposse.routersample" | ||
versionCode currentVersionCode() | ||
versionName "$app_ver_name" | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
} | ||
lintOptions { | ||
disable 'InvalidPackage' | ||
} | ||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
buildTypes { | ||
release { | ||
// TODO: Add your own signing config for the release build. | ||
// Signing with the debug keys for now, so `flutter run --release` works. | ||
signingConfig signingConfigs.debug | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
|
||
compile "com.android.support:appcompat-v7:$support_lib_ver" | ||
compile "com.android.support:support-v13:$support_lib_ver" | ||
compile "com.android.support:support-v4:$support_lib_ver" | ||
|
||
// testing | ||
androidTestCompile "com.android.support:support-annotations:$support_lib_ver" | ||
androidTestCompile 'com.android.support.test:runner:0.5' | ||
androidTestCompile 'com.android.support.test:rules:0.5' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.goposse.routersample"> | ||
|
||
<!-- needed for flutter development tools --> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
|
||
<application | ||
android:name=".App" | ||
android:allowBackup="false" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/appName"> | ||
<activity | ||
android:name=".activities.MainActivity" | ||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection" | ||
android:hardwareAccelerated="true" | ||
android:theme="@android:style/Theme.Black.NoTitleBar" | ||
android:windowSoftInputMode="adjustResize"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
<intent-filter> | ||
<action android:name="android.intent.action.VIEW" /> | ||
<category android:name="android.intent.category.DEFAULT" /> | ||
<category android:name="android.intent.category.BROWSABLE" /> | ||
<data | ||
android:host="link" | ||
android:scheme="woomera" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
</manifest> |
6 changes: 6 additions & 0 deletions
6
example/android/app/src/main/java/com/goposse/routersample/App.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.goposse.routersample; | ||
|
||
import io.flutter.app.FlutterApplication; | ||
|
||
public class App extends FlutterApplication { | ||
} |
50 changes: 50 additions & 0 deletions
50
example/android/app/src/main/java/com/goposse/routersample/activities/MainActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.goposse.routersample.activities; | ||
|
||
import android.content.Intent; | ||
import android.net.Uri; | ||
import android.os.Bundle; | ||
import android.util.Log; | ||
|
||
import com.goposse.routersample.constants.Channels; | ||
|
||
import io.flutter.app.FlutterActivity; | ||
import io.flutter.plugin.common.MethodChannel; | ||
import io.flutter.plugins.PluginRegistry; | ||
|
||
public class MainActivity extends FlutterActivity { | ||
|
||
private static final String LOG_TAG = "A:Main"; | ||
|
||
PluginRegistry pluginRegistry; | ||
private static MethodChannel deepLinkChannel; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
pluginRegistry = new PluginRegistry(); | ||
pluginRegistry.registerAll(this); | ||
|
||
if (deepLinkChannel == null) { | ||
deepLinkChannel = new MethodChannel(getFlutterView(), Channels.DEEP_LINK_RECEIVED); | ||
} | ||
|
||
Intent intent = getIntent(); | ||
checkForLinkEvent(intent); | ||
} | ||
|
||
private void checkForLinkEvent(Intent intent) { | ||
String action = intent.getAction(); | ||
Log.d(LOG_TAG, "Hey!!! " + action); | ||
if (action.equals(Intent.ACTION_VIEW)) { | ||
Uri data = intent.getData(); | ||
if (data != null) { | ||
String path = data.getQueryParameter("path"); | ||
if (path != null) { | ||
Log.d(LOG_TAG, String.format("Received external link: %s", data.toString())); | ||
deepLinkChannel.invokeMethod("linkReceived", path); | ||
} | ||
} | ||
} | ||
} | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
example/android/app/src/main/java/com/goposse/routersample/constants/Channels.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.goposse.routersample.constants; | ||
|
||
public class Channels { | ||
private static final String CHANNEL_PREFIX = "channel:com.goposse.routerdemo"; | ||
public static final String DEEP_LINK_RECEIVED = CHANNEL_PREFIX + "/deeplink"; | ||
} |
11 changes: 11 additions & 0 deletions
11
example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package io.flutter.plugins; | ||
|
||
import io.flutter.plugin.common.PluginRegistry; | ||
|
||
/** | ||
* Generated file. Do not edit. | ||
*/ | ||
public final class GeneratedPluginRegistrant { | ||
public static void registerWith(PluginRegistry registry) { | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="appName">Router Sample</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build.versionCode=1 |
Oops, something went wrong.