Skip to content

Commit a589608

Browse files
committed
initial commit
1 parent 2bcd69c commit a589608

File tree

98 files changed

+2616
-21
lines changed

Some content is hidden

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

98 files changed

+2616
-21
lines changed

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
migrate_working_dir/
12+
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
#.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
26+
/pubspec.lock
27+
**/doc/api/
28+
.dart_tool/
29+
build/

.metadata

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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: "9e1c857886f07d342cf106f2cd588bcd5e031bb2"
8+
channel: "stable"
9+
10+
project_type: plugin
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
17+
base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
18+
- platform: android
19+
create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
20+
base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
21+
- platform: ios
22+
create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
23+
base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
24+
- platform: web
25+
create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
26+
base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
27+
28+
# User provided section
29+
30+
# List of Local paths (relative to this file) that should be
31+
# ignored by the migrate tool.
32+
#
33+
# Files that are not part of the templates will be ignored by default.
34+
unmanaged_files:
35+
- 'lib/main.dart'
36+
- 'ios/Runner.xcodeproj/project.pbxproj'

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.0.1
2+
3+
* TODO: Describe initial release.

LICENSE

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1 @@
1-
MIT License
2-
3-
Copyright (c) 2023 OpenFlutter
4-
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
11-
12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
1+
TODO: Add your license here.

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# fludy
2+
3+
A new Flutter project.
4+
5+
## Getting Started
6+
7+
This project is a starting point for a Flutter
8+
[plug-in package](https://flutter.dev/developing-packages/),
9+
a specialized package that includes platform-specific implementation code for
10+
Android and/or iOS.
11+
12+
For help getting started with Flutter development, view the
13+
[online documentation](https://flutter.dev/docs), which offers tutorials,
14+
samples, guidance on mobile development, and a full API reference.
15+

analysis_options.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include: package:flutter_lints/flutter.yaml
2+
3+
# Additional information about this file can be found at
4+
# https://dart.dev/guides/language/analysis-options

android/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures
9+
.cxx

android/build.gradle

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
group 'com.example.fludy'
2+
version '1.0-SNAPSHOT'
3+
4+
buildscript {
5+
ext.kotlin_version = '1.8.22'
6+
repositories {
7+
google()
8+
mavenCentral()
9+
}
10+
11+
dependencies {
12+
classpath 'com.android.tools.build:gradle:7.3.0'
13+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14+
}
15+
}
16+
17+
allprojects {
18+
repositories {
19+
google()
20+
mavenCentral()
21+
maven { url 'https://artifact.bytedance.com/repository/AwemeOpenSDK' }
22+
}
23+
}
24+
25+
apply plugin: 'com.android.library'
26+
apply plugin: 'kotlin-android'
27+
28+
android {
29+
if (project.android.hasProperty("namespace")) {
30+
namespace 'com.example.fludy'
31+
}
32+
33+
compileSdkVersion 33
34+
35+
compileOptions {
36+
sourceCompatibility JavaVersion.VERSION_11
37+
targetCompatibility JavaVersion.VERSION_11
38+
}
39+
40+
kotlinOptions {
41+
jvmTarget = '11'
42+
}
43+
44+
sourceSets {
45+
main.java.srcDirs += 'src/main/kotlin'
46+
test.java.srcDirs += 'src/test/kotlin'
47+
}
48+
49+
defaultConfig {
50+
minSdkVersion 19
51+
}
52+
53+
dependencies {
54+
implementation 'com.bytedance.ies.ugc.aweme:opensdk-china-external:0.1.9.9'
55+
implementation 'com.bytedance.ies.ugc.aweme:opensdk-common:0.1.9.9'
56+
implementation "androidx.core:core-ktx:1.12.0"
57+
implementation 'androidx.annotation:annotation:1.7.0'
58+
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.22"))
59+
testImplementation 'org.jetbrains.kotlin:kotlin-test'
60+
testImplementation 'org.mockito:mockito-core:5.0.0'
61+
}
62+
63+
testOptions {
64+
unitTests.all {
65+
useJUnitPlatform()
66+
67+
testLogging {
68+
events "passed", "skipped", "failed", "standardOut", "standardError"
69+
outputs.upToDateWhen {false}
70+
showStandardStreams = true
71+
}
72+
}
73+
}
74+
}

android/settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'fludy'

android/src/main/AndroidManifest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.example.fludy">
3+
</manifest>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package com.example.fludy
2+
3+
import androidx.annotation.NonNull
4+
5+
import io.flutter.embedding.engine.plugins.FlutterPlugin
6+
import io.flutter.plugin.common.MethodCall
7+
import io.flutter.plugin.common.MethodChannel
8+
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
9+
import io.flutter.plugin.common.MethodChannel.Result
10+
11+
/** FludyPlugin */
12+
class FludyPlugin: FlutterPlugin, MethodCallHandler {
13+
/// The MethodChannel that will the communication between Flutter and native Android
14+
///
15+
/// This local reference serves to register the plugin with the Flutter Engine and unregister it
16+
/// when the Flutter Engine is detached from the Activity
17+
private lateinit var channel : MethodChannel
18+
19+
override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
20+
channel = MethodChannel(flutterPluginBinding.binaryMessenger, "fludy")
21+
channel.setMethodCallHandler(this)
22+
}
23+
24+
override fun onMethodCall(call: MethodCall, result: Result) {
25+
if (call.method == "getPlatformVersion") {
26+
result.success("Android ${android.os.Build.VERSION.RELEASE}")
27+
} else {
28+
result.notImplemented()
29+
}
30+
}
31+
32+
override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
33+
channel.setMethodCallHandler(null)
34+
}
35+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.example.fludy
2+
3+
import io.flutter.plugin.common.MethodCall
4+
import io.flutter.plugin.common.MethodChannel
5+
import kotlin.test.Test
6+
import org.mockito.Mockito
7+
8+
/*
9+
* This demonstrates a simple unit test of the Kotlin portion of this plugin's implementation.
10+
*
11+
* Once you have built the plugin's example app, you can run these tests from the command
12+
* line by running `./gradlew testDebugUnitTest` in the `example/android/` directory, or
13+
* you can run them directly from IDEs that support JUnit such as Android Studio.
14+
*/
15+
16+
internal class FludyPluginTest {
17+
@Test
18+
fun onMethodCall_getPlatformVersion_returnsExpectedValue() {
19+
val plugin = FludyPlugin()
20+
21+
val call = MethodCall("getPlatformVersion", null)
22+
val mockResult: MethodChannel.Result = Mockito.mock(MethodChannel.Result::class.java)
23+
plugin.onMethodCall(call, mockResult)
24+
25+
Mockito.verify(mockResult).success("Android " + android.os.Build.VERSION.RELEASE)
26+
}
27+
}

example/.gitignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
migrate_working_dir/
12+
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
#.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
**/doc/api/
26+
**/ios/Flutter/.last_build_id
27+
.dart_tool/
28+
.flutter-plugins
29+
.flutter-plugins-dependencies
30+
.pub-cache/
31+
.pub/
32+
/build/
33+
34+
# Symbolication related
35+
app.*.symbols
36+
37+
# Obfuscation related
38+
app.*.map.json
39+
40+
# Android Studio will place build artifacts here
41+
/android/app/debug
42+
/android/app/profile
43+
/android/app/release

example/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# fludy_example
2+
3+
Demonstrates how to use the fludy plugin.
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: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# included above or to enable additional rules. A list of all available lints
16+
# and their documentation is published at https://dart.dev/lints.
17+
#
18+
# Instead of disabling a lint rule for the entire project in the
19+
# section below, it can also be suppressed for a single line of code
20+
# or a specific dart file by using the `// ignore: name_of_lint` and
21+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
22+
# producing the lint.
23+
rules:
24+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
25+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
26+
27+
# Additional information about this file can be found at
28+
# https://dart.dev/guides/language/analysis-options

example/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

0 commit comments

Comments
 (0)