Skip to content

Commit 03818cc

Browse files
committed
feat: example code for the article
0 parents  commit 03818cc

File tree

326 files changed

+9911
-0
lines changed

Some content is hidden

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

326 files changed

+9911
-0
lines changed

.gitignore

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
**/ios/Flutter/.last_build_id
26+
.dart_tool/
27+
.flutter-plugins
28+
.flutter-plugins-dependencies
29+
.packages
30+
.pub-cache/
31+
.pub/
32+
/build/
33+
/coverage/
34+
**/*.freezed.dart
35+
**/*.mocks.dart
36+
**/*.g.dart
37+
38+
# Web related
39+
lib/generated_plugin_registrant.dart
40+
41+
# Symbolication related
42+
app.*.symbols
43+
44+
# Obfuscation related
45+
app.*.map.json
46+
47+
# Android Studio will place build artifacts here
48+
/android/app/debug
49+
/android/app/profile
50+
/android/app/release
51+
*.config.json

.metadata

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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.
5+
6+
version:
7+
revision: f1875d570e39de09040c8f79aa13cc56baab8db1
8+
channel: stable
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
17+
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
18+
- platform: android
19+
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
20+
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
21+
- platform: ios
22+
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
23+
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
24+
- platform: linux
25+
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
26+
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
27+
- platform: macos
28+
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
29+
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
30+
- platform: web
31+
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
32+
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
33+
- platform: windows
34+
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
35+
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
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'

.vscode/launch.json

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "local Debug",
6+
"request": "launch",
7+
"type": "dart",
8+
"flutterMode": "debug",
9+
"args": [
10+
"--flavor",
11+
"local",
12+
"--web-port",
13+
"8686",
14+
],
15+
"program": "lib/main_local.dart"
16+
},
17+
{
18+
"name": "local Profile",
19+
"request": "launch",
20+
"type": "dart",
21+
"flutterMode": "profile",
22+
"args": [
23+
"--flavor",
24+
"local",
25+
"--web-port",
26+
"8686",
27+
],
28+
"program": "lib/main_local.dart"
29+
},
30+
{
31+
"name": "local Release",
32+
"request": "launch",
33+
"type": "dart",
34+
"flutterMode": "release",
35+
"args": [
36+
"--flavor",
37+
"local",
38+
"--web-port",
39+
"8686",
40+
],
41+
"program": "lib/main_local.dart"
42+
},
43+
{
44+
"name": "development Debug",
45+
"request": "launch",
46+
"type": "dart",
47+
"flutterMode": "debug",
48+
"args": [
49+
"--flavor",
50+
"development",
51+
"--web-port",
52+
"8686",
53+
],
54+
"program": "lib/main_development.dart"
55+
},
56+
{
57+
"name": "development Profile",
58+
"request": "launch",
59+
"type": "dart",
60+
"flutterMode": "profile",
61+
"args": [
62+
"--flavor",
63+
"development",
64+
"--web-port",
65+
"8686",
66+
],
67+
"program": "lib/main_development.dart"
68+
},
69+
{
70+
"name": "development Release",
71+
"request": "launch",
72+
"type": "dart",
73+
"flutterMode": "release",
74+
"args": [
75+
"--flavor",
76+
"development",
77+
"--web-port",
78+
"8686",
79+
],
80+
"program": "lib/main_development.dart"
81+
},
82+
{
83+
"name": "production Debug",
84+
"request": "launch",
85+
"type": "dart",
86+
"flutterMode": "debug",
87+
"args": [
88+
"--flavor",
89+
"production",
90+
"--web-port",
91+
"8686",
92+
],
93+
"program": "lib/main_production.dart"
94+
},
95+
{
96+
"name": "production Profile",
97+
"request": "launch",
98+
"type": "dart",
99+
"flutterMode": "profile",
100+
"args": [
101+
"--flavor",
102+
"production",
103+
"--web-port",
104+
"8686",
105+
],
106+
"program": "lib/main_production.dart"
107+
},
108+
{
109+
"name": "production Release",
110+
"request": "launch",
111+
"type": "dart",
112+
"flutterMode": "release",
113+
"args": [
114+
"--flavor",
115+
"production",
116+
"--web-port",
117+
"8686",
118+
],
119+
"program": "lib/main_production.dart"
120+
}
121+
]
122+
}

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# example
2+
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.

analysis_options.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:very_good_analysis/analysis_options.yaml
11+
12+
linter:
13+
rules:
14+
sort_pub_dependencies: false
15+
library_private_types_in_public_api: false
16+
lines_longer_than_80_chars: false
17+
18+
analyzer:
19+
exclude:
20+
- "**/*.g.dart"
21+
- "**/*.freezed.dart"
22+
- "**/*.mocks.dart"
23+
strong-mode:
24+
implicit-casts: true
25+
implicit-dynamic: true
26+
errors:
27+
invalid_annotation_target: ignore

android/.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
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

android/app/build.gradle

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
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+
30+
// ----- BEGIN flavorDimensions (autogenerated by flutter_flavorizr) -----
31+
flavorDimensions "flavor-type"
32+
33+
productFlavors {
34+
local {
35+
dimension "flavor-type"
36+
applicationId "com.otakoyi.example.local"
37+
resValue "string", "app_name", "Example Local"
38+
}
39+
development {
40+
dimension "flavor-type"
41+
applicationId "com.otakoyi.example.dev"
42+
resValue "string", "app_name", "Example Development"
43+
}
44+
production {
45+
dimension "flavor-type"
46+
applicationId "com.otakoyi.example"
47+
resValue "string", "app_name", "Example Production"
48+
}
49+
}
50+
51+
// ----- END flavorDimensions (autogenerated by flutter_flavorizr) -----
52+
53+
compileSdkVersion flutter.compileSdkVersion
54+
ndkVersion flutter.ndkVersion
55+
56+
compileOptions {
57+
sourceCompatibility JavaVersion.VERSION_1_8
58+
targetCompatibility JavaVersion.VERSION_1_8
59+
}
60+
61+
kotlinOptions {
62+
jvmTarget = '1.8'
63+
}
64+
65+
sourceSets {
66+
main.java.srcDirs += 'src/main/kotlin'
67+
}
68+
69+
defaultConfig {
70+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
71+
applicationId "com.example.example"
72+
// You can update the following values to match your application needs.
73+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
74+
minSdkVersion flutter.minSdkVersion
75+
targetSdkVersion flutter.targetSdkVersion
76+
versionCode flutterVersionCode.toInteger()
77+
versionName flutterVersionName
78+
}
79+
80+
buildTypes {
81+
release {
82+
// TODO: Add your own signing config for the release build.
83+
// Signing with the debug keys for now, so `flutter run --release` works.
84+
signingConfig signingConfigs.debug
85+
}
86+
}
87+
}
88+
89+
flutter {
90+
source '../..'
91+
}
92+
93+
dependencies {
94+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
95+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
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
5+
to allow setting breakpoints, to provide hot reload, etc.
6+
-->
7+
<uses-permission android:name="android.permission.INTERNET"/>
8+
</manifest>
544 Bytes
Loading
442 Bytes
Loading

0 commit comments

Comments
 (0)