Skip to content

Commit 85774e3

Browse files
authored
chore(#47): Recreate example project (#48)
* chore(#47): Recreate the project * feat(#47): Update home screen * fix(#47): Make linter ignore `nstack.dart` * chore(#47): Remove tests * chore(#47): Remove tests, for now
1 parent 4680985 commit 85774e3

34 files changed

+326
-395
lines changed

.github/workflows/pull_request_checks.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,3 @@ jobs:
2626
- name: Run analyzer /example
2727
run: flutter analyze
2828
working-directory: example
29-
- name: Run tests
30-
run: flutter test
31-
- name: Run tests /example
32-
run: flutter test
33-
working-directory: example

example/.gitignore

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
.buildlog/
99
.history
1010
.svn/
11+
migrate_working_dir/
1112

1213
# IntelliJ related
1314
*.iml
@@ -22,6 +23,7 @@
2223

2324
# Flutter/Dart/Pub related
2425
**/doc/api/
26+
**/ios/Flutter/.last_build_id
2527
.dart_tool/
2628
.flutter-plugins
2729
.flutter-plugins-dependencies
@@ -30,14 +32,13 @@
3032
.pub/
3133
/build/
3234

33-
# Web related
34-
lib/generated_plugin_registrant.dart
35-
3635
# Symbolication related
3736
app.*.symbols
3837

3938
# Obfuscation related
4039
app.*.map.json
4140

42-
# Exceptions to above rules.
43-
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
41+
# Android Studio will place build artifacts here
42+
/android/app/debug
43+
/android/app/profile
44+
/android/app/release

example/.metadata

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,45 @@
11
# This file tracks properties of this Flutter project.
22
# Used by Flutter tool to assess capabilities and perform upgrades etc.
33
#
4-
# This file should be version controlled and should not be manually edited.
4+
# This file should be version controlled.
55

66
version:
7-
revision: 35ed1ccc9a90642f1e2a3ce374fe3d4fb626b37d
8-
channel: master
7+
revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
8+
channel: unknown
99

1010
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
17+
base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
18+
- platform: android
19+
create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
20+
base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
21+
- platform: ios
22+
create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
23+
base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
24+
- platform: linux
25+
create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
26+
base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
27+
- platform: macos
28+
create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
29+
base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
30+
- platform: web
31+
create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
32+
base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
33+
- platform: windows
34+
create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
35+
base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
36+
37+
# User provided section
38+
39+
# List of Local paths (relative to this file) that should be
40+
# ignored by the migrate tool.
41+
#
42+
# Files that are not part of the templates will be ignored by default.
43+
unmanaged_files:
44+
- 'lib/main.dart'
45+
- 'ios/Runner.xcodeproj/project.pbxproj'

example/README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1-
# nstack_example
1+
# example
22

3-
Demonstrates how to use the nstack plugin.
3+
A new Flutter project.
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://docs.flutter.dev/get-started/codelab)
12+
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
13+
14+
For help getting started with Flutter development, view the
15+
[online documentation](https://docs.flutter.dev/), which offers tutorials,
16+
samples, guidance on mobile development, and a full API reference.

example/analysis_options.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
include: package:flutter_lints/flutter.yaml
2+
3+
linter:
4+
rules:
5+
6+
analyzer:
7+
exclude:
8+
- "**/nstack.dart"

example/android/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ gradle-wrapper.jar
55
/gradlew.bat
66
/local.properties
77
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
12+
**/*.keystore
13+
**/*.jks

example/android/app/build.gradle

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,34 +26,33 @@ apply plugin: 'kotlin-android'
2626
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2727

2828
android {
29-
compileSdkVersion 30
29+
compileSdkVersion flutter.compileSdkVersion
30+
ndkVersion flutter.ndkVersion
3031

31-
sourceSets {
32-
main.java.srcDirs += 'src/main/kotlin'
32+
compileOptions {
33+
sourceCompatibility JavaVersion.VERSION_1_8
34+
targetCompatibility JavaVersion.VERSION_1_8
3335
}
3436

35-
lintOptions {
36-
disable 'InvalidPackage'
37+
kotlinOptions {
38+
jvmTarget = '1.8'
39+
}
40+
41+
sourceSets {
42+
main.java.srcDirs += 'src/main/kotlin'
3743
}
3844

3945
defaultConfig {
4046
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41-
applicationId "dk.nodes.nstack_example"
42-
minSdkVersion 16
43-
targetSdkVersion 30
47+
applicationId "com.example.example"
48+
// You can update the following values to match your application needs.
49+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
50+
minSdkVersion flutter.minSdkVersion
51+
targetSdkVersion flutter.targetSdkVersion
4452
versionCode flutterVersionCode.toInteger()
4553
versionName flutterVersionName
4654
}
4755

48-
compileOptions {
49-
sourceCompatibility JavaVersion.VERSION_1_8
50-
targetCompatibility JavaVersion.VERSION_1_8
51-
}
52-
53-
kotlinOptions {
54-
jvmTarget = "1.8"
55-
}
56-
5756
buildTypes {
5857
release {
5958
// TODO: Add your own signing config for the release build.
@@ -68,5 +67,5 @@ flutter {
6867
}
6968

7069
dependencies {
71-
70+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
7271
}

example/android/app/src/debug/AndroidManifest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="dk.nodes.nstack_example">
3-
<!-- Flutter needs it to communicate with the running application
2+
package="com.example.example">
3+
<!-- The INTERNET permission is required for development. Specifically,
4+
the Flutter tool needs it to communicate with the running application
45
to allow setting breakpoints, to provide hot reload, etc.
56
-->
67
<uses-permission android:name="android.permission.INTERNET"/>

example/android/app/src/main/AndroidManifest.xml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="dk.nodes.nstack_example">
3-
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
4-
calls FlutterMain.startInitialization(this); in its onCreate method.
5-
In most cases you can leave this as-is, but you if you want to provide
6-
additional functionality it is fine to subclass or reimplement
7-
FlutterApplication and put your custom class here. -->
8-
<application
9-
android:name="io.flutter.app.FlutterApplication"
10-
android:label="nstack_example"
2+
package="com.example.example">
3+
<application
4+
android:label="example"
5+
android:name="${applicationName}"
116
android:icon="@mipmap/ic_launcher">
127
<activity
138
android:name=".MainActivity"
9+
android:exported="true"
1410
android:launchMode="singleTop"
1511
android:theme="@style/LaunchTheme"
1612
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
@@ -24,15 +20,6 @@
2420
android:name="io.flutter.embedding.android.NormalTheme"
2521
android:resource="@style/NormalTheme"
2622
/>
27-
<!-- Displays an Android View that continues showing the launch screen
28-
Drawable until Flutter paints its first frame, then this splash
29-
screen fades out. A splash screen is useful to avoid any visual
30-
gap between the end of Android's launch screen and the painting of
31-
Flutter's first frame. -->
32-
<meta-data
33-
android:name="io.flutter.embedding.android.SplashScreenDrawable"
34-
android:resource="@drawable/launch_background"
35-
/>
3623
<intent-filter>
3724
<action android:name="android.intent.action.MAIN"/>
3825
<category android:name="android.intent.category.LAUNCHER"/>

example/android/app/src/main/kotlin/dk/nodes/nstack_example/MainActivity.kt renamed to example/android/app/src/main/kotlin/com/example/example/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package dk.nodes.nstack_example
1+
package com.example.example
22

33
import io.flutter.embedding.android.FlutterActivity
44

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:colorBackground" />
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>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
4+
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
5+
<!-- Show a splash screen on the activity. Automatically removed when
6+
the Flutter engine draws its first frame -->
7+
<item name="android:windowBackground">@drawable/launch_background</item>
8+
</style>
9+
<!-- Theme applied to the Android Window as soon as the process has started.
10+
This theme determines the color of the Android Window while your
11+
Flutter UI initializes, as well as behind your Flutter UI while its
12+
running.
13+
14+
This Theme is only used starting with V2 of Flutter's Android embedding. -->
15+
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
16+
<item name="android:windowBackground">?android:colorBackground</item>
17+
</style>
18+
</resources>
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3-
<!-- Theme applied to the Android Window while the process is starting -->
4-
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
3+
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
4+
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
55
<!-- Show a splash screen on the activity. Automatically removed when
6-
Flutter draws its first frame -->
6+
the Flutter engine draws its first frame -->
77
<item name="android:windowBackground">@drawable/launch_background</item>
88
</style>
99
<!-- Theme applied to the Android Window as soon as the process has started.
1010
This theme determines the color of the Android Window while your
1111
Flutter UI initializes, as well as behind your Flutter UI while its
1212
running.
13-
13+
1414
This Theme is only used starting with V2 of Flutter's Android embedding. -->
15-
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
16-
<item name="android:windowBackground">@android:color/white</item>
15+
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
16+
<item name="android:windowBackground">?android:colorBackground</item>
1717
</style>
1818
</resources>

example/android/app/src/profile/AndroidManifest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="dk.nodes.nstack_example">
3-
<!-- Flutter needs it to communicate with the running application
2+
package="com.example.example">
3+
<!-- The INTERNET permission is required for development. Specifically,
4+
the Flutter tool needs it to communicate with the running application
45
to allow setting breakpoints, to provide hot reload, etc.
56
-->
67
<uses-permission android:name="android.permission.INTERNET"/>

example/android/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
buildscript {
2-
ext.kotlin_version = '1.4.31'
2+
ext.kotlin_version = '1.6.10'
33
repositories {
44
google()
5-
jcenter()
5+
mavenCentral()
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.0.2'
9+
classpath 'com.android.tools.build:gradle:7.1.2'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}
1313

1414
allprojects {
1515
repositories {
1616
google()
17-
jcenter()
17+
mavenCentral()
1818
}
1919
}
2020

example/android/gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
org.gradle.jvmargs=-Xmx1536M
2-
android.enableR8=true
32
android.useAndroidX=true
43
android.enableJetifier=true
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Fri Jun 23 08:50:38 CEST 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
43
zipStoreBase=GRADLE_USER_HOME
54
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip

example/android/settings.gradle

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
include ':app'
22

3-
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
3+
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4+
def properties = new Properties()
45

5-
def plugins = new Properties()
6-
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7-
if (pluginsFile.exists()) {
8-
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9-
}
6+
assert localPropertiesFile.exists()
7+
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
108

11-
plugins.each { name, path ->
12-
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13-
include ":$name"
14-
project(":$name").projectDir = pluginDirectory
15-
}
9+
def flutterSdkPath = properties.getProperty("flutter.sdk")
10+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11+
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"

example/ios/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
**/dgph
12
*.mode1v3
23
*.mode2v3
34
*.moved-aside
@@ -18,6 +19,7 @@ Flutter/App.framework
1819
Flutter/Flutter.framework
1920
Flutter/Flutter.podspec
2021
Flutter/Generated.xcconfig
22+
Flutter/ephemeral/
2123
Flutter/app.flx
2224
Flutter/app.zip
2325
Flutter/flutter_assets/

0 commit comments

Comments
 (0)