| | |
| | | |
| | | dependencies { |
| | | implementation 'androidx.appcompat:appcompat:1.2.0' |
| | | |
| | | implementation 'com.google.android.material:material:1.3.0' |
| | | implementation 'androidx.constraintlayout:constraintlayout:2.0.4' |
| | | implementation project(path: ':library-common') |
| | |
| | | implementation project(path: ':library-ad') |
| | | implementation project(path: ':library-ec') |
| | | implementation project(path: ':library-login') |
| | | implementation project(path: ':library-flutter') |
| | | testImplementation 'junit:junit:4.+' |
| | | androidTestImplementation 'androidx.test.ext:junit:1.1.2' |
| | | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' |
| | |
| | | package com.demo.app; |
| | | |
| | | import android.Manifest; |
| | | import android.app.Activity; |
| | | import android.app.Application; |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.os.Bundle; |
| | | |
| | | import com.bytedance.sdk.dp.DPSdkConfig; |
| | | import com.bytedance.sdk.openadsdk.TTAdSdk; |
| | | import com.demo.app.utils.Constant; |
| | | import com.demo.app.utils.UserUtil; |
| | | import com.demo.app.utils.api.HttpApiUtil; |
| | | import com.demo.lib.common.util.ui.MyActivityManager; |
| | | import com.demo.library_ad.AdUtil; |
| | | import com.demo.library_dp.DPUtil; |
| | | import com.demo.lib.common.util.ManifestDataUtil; |
| | | import com.demo.library_flutter.FlutterCommonActivity; |
| | | import com.demo.library_flutter.message.AdMethodChannel; |
| | | import com.demo.library_flutter.message.DataMethodChannel; |
| | | import com.demo.library_flutter.message.UIMethodChannel; |
| | | import com.demo.library_flutter.nativeview.CSJExpressNativeViewFactory; |
| | | import com.demo.library_flutter.nativeview.GDTExpressNativeViewFactory; |
| | | import com.idlefish.flutterboost.FlutterBoost; |
| | | import com.idlefish.flutterboost.FlutterBoostDelegate; |
| | | import com.idlefish.flutterboost.FlutterBoostRouteOptions; |
| | | import com.idlefish.flutterboost.containers.FlutterBoostActivity; |
| | | import com.umeng.analytics.MobclickAgent; |
| | | import com.umeng.commonsdk.UMConfigure; |
| | | |
| | | import java.util.Iterator; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.Map; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | import androidx.multidex.MultiDex; |
| | | import io.flutter.embedding.android.FlutterActivityLaunchConfigs; |
| | | import io.flutter.embedding.engine.FlutterEngine; |
| | | import io.flutter.plugin.common.MethodCall; |
| | | import io.flutter.plugin.common.MethodChannel; |
| | | import io.flutter.plugin.common.StandardMessageCodec; |
| | | import io.flutter.plugin.platform.PlatformViewRegistry; |
| | | |
| | | public class MyApplication extends Application { |
| | | public static MyApplication application = null; |
| | |
| | | initNovel(application); |
| | | //穿山甲小视频 |
| | | initDPSDK(application); |
| | | |
| | | initFlutter(application); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | public static void initFlutter(Application application) { |
| | | |
| | | FlutterBoost.instance().setup(application, new FlutterBoostDelegate() { |
| | | @Override |
| | | public void pushNativeRoute(FlutterBoostRouteOptions options) { |
| | | //这里根据options.pageName来判断你想跳转哪个页面,这里简单给一个 |
| | | Intent intent = new Intent(FlutterBoost.instance().currentActivity(), FlutterCommonActivity.class); |
| | | FlutterBoost.instance().currentActivity().startActivityForResult(intent, options.requestCode()); |
| | | } |
| | | |
| | | @Override |
| | | public void pushFlutterRoute(FlutterBoostRouteOptions options) { |
| | | Intent intent = new FlutterBoostActivity.CachedEngineIntentBuilder(FlutterBoostActivity.class) |
| | | .backgroundMode(FlutterActivityLaunchConfigs.BackgroundMode.transparent) |
| | | .destroyEngineWithActivity(false) |
| | | .uniqueId(options.uniqueId()) |
| | | .url(options.pageName()) |
| | | .urlParams(options.arguments()) |
| | | .build(FlutterBoost.instance().currentActivity()); |
| | | FlutterBoost.instance().currentActivity().startActivity(intent); |
| | | } |
| | | }, engine -> { |
| | | PlatformViewRegistry registry = engine.getPlatformViewsController().getRegistry(); |
| | | registry.registerViewFactory("ad-csj-express-view", new CSJExpressNativeViewFactory(engine.getDartExecutor().getBinaryMessenger(), StandardMessageCodec.INSTANCE)); |
| | | registry.registerViewFactory("ad-gdt-express-view", new GDTExpressNativeViewFactory(engine.getDartExecutor().getBinaryMessenger(), StandardMessageCodec.INSTANCE)); |
| | | |
| | | //数据接口 |
| | | new DataMethodChannel(engine.getDartExecutor().getBinaryMessenger(), application.getApplicationContext(), new DataMethodChannel.DataListener() { |
| | | @Override |
| | | public Map<String, Object> getBaseRequestParams(Map<String, Object> params) { |
| | | LinkedHashMap<String, String> ps = new LinkedHashMap<>(); |
| | | if (params != null) |
| | | for (Iterator<String> its = params.keySet().iterator(); its.hasNext(); ) { |
| | | String key = its.next(); |
| | | if (params.get(key) != null) { |
| | | ps.put(key, params.get(key).toString()); |
| | | } |
| | | } |
| | | HttpApiUtil.getRequestParams(application.getApplicationContext(), ps); |
| | | return null; |
| | | } |
| | | }); |
| | | //UI接口 |
| | | new UIMethodChannel(engine.getDartExecutor().getBinaryMessenger(), application.getApplicationContext(), new UIMethodChannel.DataListener() { |
| | | @Override |
| | | public boolean isStatusBarDefaultLight() { |
| | | return true; |
| | | } |
| | | }); |
| | | //广告接口 |
| | | new AdMethodChannel(engine.getDartExecutor().getBinaryMessenger(), application.getApplicationContext(), new AdMethodChannel.DataListener() { |
| | | |
| | | }); |
| | | |
| | | |
| | | }); |
| | | } |
| | | |
| | | |
| | | public interface InitListener { |
| | | public void onFinish(); |
| | |
| | | |
| | | maven { url 'https://jitpack.io' } |
| | | |
| | | maven { |
| | | url 'D:\\workspace\\codegenerator\\src\\main\\resources\\flutter_module\\build\\host\\outputs\\repo' |
| | | } |
| | | maven { |
| | | url 'https://storage.googleapis.com/download.flutter.io' |
| | | } |
| | | |
| | | } |
| | | dependencies { |
| | | classpath 'com.android.tools.build:gradle:4.1.3' |
| | |
| | | } |
| | | } |
| | | |
| | | allprojects { |
| | | |
| | | repositories { |
| | | maven { |
| | | url "https://maven.aliyun.com/repository/public" |
| | | } |
| | | |
| | | maven { |
| | | url "https://maven.aliyun.com/repository/google" |
| | | } |
| | | mavenCentral() |
| | | |
| | | //穿山甲 |
| | | maven { |
| | | url 'https://artifact.bytedance.com/repository/pangle' |
| | | } |
| | | |
| | | //火山引擎maven仓库地址 |
| | | maven { url 'https://artifact.bytedance.com/repository/Volcengine/' } |
| | | |
| | | //阿里百川 |
| | | maven { |
| | | url "http://repo.baichuan-android.taobao.com/content/groups/BaichuanRepositories/" |
| | | } |
| | | |
| | | jcenter() |
| | | |
| | | maven { url 'https://jitpack.io' } |
| | | |
| | | maven { |
| | | url 'D:\\workspace\\codegenerator\\src\\main\\resources\\flutter_module\\build\\host\\outputs\\repo' |
| | | } |
| | | maven { |
| | | url 'https://storage.googleapis.com/download.flutter.io' |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | task clean(type: Delete) { |
| | | delete rootProject.buildDir |
| | | } |
| | |
| | | implementation project(path: ':library-common') |
| | | |
| | | //穿山甲 |
| | | api 'com.pangle.cn:ads-sdk-pro:4.2.0.3' |
| | | api 'com.pangle.cn:ads-sdk-pro:4.3.0.8' |
| | | //广点通 |
| | | api 'com.qq.e.union:union:4.440.1310' |
| | | api 'com.qq.e.union:union:4.452.1322' |
| | | } |
New file |
| | |
| | | package com.demo.lib.common.util.ui; |
| | | |
| | | import android.app.Activity; |
| | | |
| | | import java.lang.ref.WeakReference; |
| | | |
| | | public class MyActivityManager { |
| | | private static MyActivityManager sInstance = new MyActivityManager(); |
| | | private WeakReference<Activity> sCurrentActivityWeakRef; |
| | | |
| | | |
| | | private MyActivityManager() { |
| | | |
| | | } |
| | | |
| | | public static MyActivityManager getInstance() { |
| | | return sInstance; |
| | | } |
| | | |
| | | public Activity getCurrentActivity() { |
| | | Activity currentActivity = null; |
| | | if (sCurrentActivityWeakRef != null) { |
| | | currentActivity = sCurrentActivityWeakRef.get(); |
| | | } |
| | | return currentActivity; |
| | | } |
| | | |
| | | public void setCurrentActivity(Activity activity) { |
| | | sCurrentActivityWeakRef = new WeakReference<Activity>(activity); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | plugins { |
| | | id 'com.android.library' |
| | | } |
| | | |
| | | android { |
| | | compileSdkVersion 31 |
| | | |
| | | defaultConfig { |
| | | applicationId "com.demo.library_flutter" |
| | | minSdkVersion 19 |
| | | targetSdkVersion 31 |
| | | versionCode 1 |
| | | versionName "1.0" |
| | | |
| | | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
| | | } |
| | | |
| | | buildTypes { |
| | | release { |
| | | minifyEnabled false |
| | | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
| | | } |
| | | profile { |
| | | initWith debug |
| | | } |
| | | } |
| | | compileOptions { |
| | | sourceCompatibility JavaVersion.VERSION_1_8 |
| | | targetCompatibility JavaVersion.VERSION_1_8 |
| | | } |
| | | } |
| | | |
| | | dependencies { |
| | | |
| | | implementation 'androidx.appcompat:appcompat:1.2.0' |
| | | implementation 'com.google.android.material:material:1.3.0' |
| | | implementation 'androidx.constraintlayout:constraintlayout:2.0.4' |
| | | implementation project(path: ':library-ad') |
| | | implementation project(path: ':library-common') |
| | | testImplementation 'junit:junit:4.+' |
| | | androidTestImplementation 'androidx.test.ext:junit:1.1.2' |
| | | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' |
| | | |
| | | api project(':flutter') |
| | | api project(':flutter_boost') |
| | | } |
New file |
| | |
| | | # Add project specific ProGuard rules here. |
| | | # You can control the set of applied configuration files using the |
| | | # proguardFiles setting in build.gradle. |
| | | # |
| | | # For more details, see |
| | | # http://developer.android.com/guide/developing/tools/proguard.html |
| | | |
| | | # If your project uses WebView with JS, uncomment the following |
| | | # and specify the fully qualified class name to the JavaScript interface |
| | | # class: |
| | | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { |
| | | # public *; |
| | | #} |
| | | |
| | | # Uncomment this to preserve the line number information for |
| | | # debugging stack traces. |
| | | #-keepattributes SourceFile,LineNumberTable |
| | | |
| | | # If you keep the line number information, uncomment this to |
| | | # hide the original source file name. |
| | | #-renamesourcefileattribute SourceFile |
New file |
| | |
| | | package com.demo.library_flutter; |
| | | |
| | | import android.content.Context; |
| | | |
| | | import androidx.test.platform.app.InstrumentationRegistry; |
| | | import androidx.test.ext.junit.runners.AndroidJUnit4; |
| | | |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | |
| | | import static org.junit.Assert.*; |
| | | |
| | | /** |
| | | * Instrumented test, which will execute on an Android device. |
| | | * |
| | | * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> |
| | | */ |
| | | @RunWith(AndroidJUnit4.class) |
| | | public class ExampleInstrumentedTest { |
| | | @Test |
| | | public void useAppContext() { |
| | | // Context of the app under test. |
| | | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); |
| | | assertEquals("com.demo.library_flutter", appContext.getPackageName()); |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" |
| | | package="com.demo.library_flutter"> |
| | | |
| | | <application |
| | | android:allowBackup="true" |
| | | android:icon="@mipmap/ic_launcher" |
| | | android:label="@string/app_name" |
| | | android:roundIcon="@mipmap/ic_launcher_round" |
| | | android:supportsRtl="true" |
| | | android:theme="@style/Theme.Android"> |
| | | <activity |
| | | android:name=".FlutterCommonActivity" |
| | | android:exported="true"> |
| | | <intent-filter> |
| | | <action android:name="android.intent.action.MAIN" /> |
| | | |
| | | <category android:name="android.intent.category.LAUNCHER" /> |
| | | </intent-filter> |
| | | </activity> |
| | | |
| | | <activity |
| | | android:name="io.flutter.embedding.android.FlutterActivity" |
| | | android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" |
| | | android:hardwareAccelerated="true" |
| | | android:windowSoftInputMode="adjustResize" |
| | | /> |
| | | |
| | | </application> |
| | | |
| | | </manifest> |
New file |
| | |
| | | package com.demo.library_flutter; |
| | | |
| | | import androidx.appcompat.app.AppCompatActivity; |
| | | |
| | | import android.os.Bundle; |
| | | |
| | | public class FlutterCommonActivity extends AppCompatActivity { |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | setContentView(R.layout.activity_main); |
| | | } |
| | | } |
New file |
| | |
| | | package com.demo.library_flutter.message; |
| | | |
| | | import android.content.Context; |
| | | import android.content.SharedPreferences; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.demo.library_ad.AdUtil; |
| | | import com.demo.library_ad.FullVideoAdManager; |
| | | import com.demo.library_ad.IntertitialAdUtil; |
| | | import com.idlefish.flutterboost.FlutterBoost; |
| | | |
| | | import java.util.Map; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import io.flutter.plugin.common.BinaryMessenger; |
| | | import io.flutter.plugin.common.MethodCall; |
| | | import io.flutter.plugin.common.MethodChannel; |
| | | import io.flutter.plugin.common.MethodCodec; |
| | | import io.flutter.plugin.common.StandardMessageCodec; |
| | | |
| | | public class AdMethodChannel extends MethodChannel { |
| | | public AdMethodChannel(BinaryMessenger messenger, Context context, DataListener dataListener) { |
| | | super(messenger, "com.yeshi.video/ad", (MethodCodec) StandardMessageCodec.INSTANCE); |
| | | setMethodCallHandler(new MethodCallHandler() { |
| | | @Override |
| | | public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { |
| | | |
| | | switch (call.method) { |
| | | case "loadCSJFullScreenAd": { |
| | | String pid = call.argument("pid"); |
| | | FullVideoAdManager.getInstance().loadAd(FlutterBoost.instance().currentActivity(), AdUtil.AD_TYPE.csj, pid, new FullVideoAdManager.IFullVideoAdListener() { |
| | | @Override |
| | | public void onFail(String msg) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onFinish() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | |
| | | case "loadGDTInterstitialAd": { |
| | | String pid = call.argument("pid"); |
| | | IntertitialAdUtil.showAd(FlutterBoost.instance().currentActivity(), AdUtil.AD_TYPE.gdt, pid); |
| | | } |
| | | break; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | }); |
| | | } |
| | | |
| | | public interface DataListener { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.demo.library_flutter.message; |
| | | |
| | | import android.content.Context; |
| | | import android.content.SharedPreferences; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | |
| | | import java.util.Map; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import io.flutter.plugin.common.BinaryMessenger; |
| | | import io.flutter.plugin.common.JSONUtil; |
| | | import io.flutter.plugin.common.MethodCall; |
| | | import io.flutter.plugin.common.MethodChannel; |
| | | import io.flutter.plugin.common.MethodCodec; |
| | | import io.flutter.plugin.common.StandardMessageCodec; |
| | | |
| | | public class DataMethodChannel extends MethodChannel { |
| | | public DataMethodChannel(BinaryMessenger messenger, Context context, DataListener dataListener) { |
| | | super(messenger, "com.yeshi.video/data", (MethodCodec) StandardMessageCodec.INSTANCE); |
| | | setMethodCallHandler(new MethodCallHandler() { |
| | | @Override |
| | | public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { |
| | | |
| | | switch (call.method) { |
| | | case "setSharedValue": { |
| | | String key = call.argument("key"); |
| | | String value = call.argument("value"); |
| | | SharedPreferences sharedPreferences = context.getSharedPreferences("flutter", Context.MODE_PRIVATE); |
| | | SharedPreferences.Editor editor = sharedPreferences.edit(); |
| | | editor.putString(key, value); |
| | | editor.commit(); |
| | | } |
| | | break; |
| | | |
| | | case "getSharedValue": { |
| | | SharedPreferences sharedPreferences = context.getSharedPreferences("flutter", Context.MODE_PRIVATE); |
| | | result.success(sharedPreferences.getString(call.arguments + "", "")); |
| | | } |
| | | break; |
| | | case "removeSharedValue": { |
| | | SharedPreferences sharedPreferences = context.getSharedPreferences("flutter", Context.MODE_PRIVATE); |
| | | SharedPreferences.Editor editor = sharedPreferences.edit(); |
| | | editor.remove(call.arguments + ""); |
| | | editor.commit(); |
| | | } |
| | | break; |
| | | case "getAdConfig": |
| | | SharedPreferences sharedPreferences = context.getSharedPreferences("flutter", Context.MODE_PRIVATE); |
| | | result.success(sharedPreferences.getString("adConfig", "")); |
| | | break; |
| | | case "getBaseRequestParams": |
| | | //获取请求参数 |
| | | Map<String, Object> params = (Map<String, Object>) call.arguments; |
| | | params = dataListener.getBaseRequestParams(params); |
| | | //转json返回 |
| | | result.success(JSONObject.toJSON(params)); |
| | | break; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | }); |
| | | } |
| | | |
| | | public interface DataListener { |
| | | public Map<String, Object> getBaseRequestParams(Map<String, Object> params); |
| | | } |
| | | } |
New file |
| | |
| | | package com.demo.library_flutter.message; |
| | | |
| | | import android.content.Context; |
| | | import android.content.SharedPreferences; |
| | | import android.widget.Toast; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.idlefish.flutterboost.FlutterBoost; |
| | | import com.jaeger.library.StatusBarUtil; |
| | | |
| | | import java.util.Map; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import io.flutter.plugin.common.BinaryMessenger; |
| | | import io.flutter.plugin.common.MethodCall; |
| | | import io.flutter.plugin.common.MethodChannel; |
| | | import io.flutter.plugin.common.MethodCodec; |
| | | import io.flutter.plugin.common.StandardMessageCodec; |
| | | |
| | | public class UIMethodChannel extends MethodChannel { |
| | | public UIMethodChannel(BinaryMessenger messenger, Context context, DataListener dataListener) { |
| | | super(messenger, "com.yeshi.video/ui", (MethodCodec) StandardMessageCodec.INSTANCE); |
| | | setMethodCallHandler(new MethodCallHandler() { |
| | | @Override |
| | | public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { |
| | | |
| | | switch (call.method) { |
| | | case "toast": { |
| | | Toast.makeText(context, call.arguments + "", Toast.LENGTH_SHORT).show(); |
| | | } |
| | | break; |
| | | |
| | | case "setStatusBarLight": { |
| | | StatusBarUtil.setLightMode(FlutterBoost.instance().currentActivity()); |
| | | } |
| | | break; |
| | | |
| | | case "setStatusBarDark": { |
| | | StatusBarUtil.setDarkMode(FlutterBoost.instance().currentActivity()); |
| | | } |
| | | break; |
| | | case "setStatusBarDefault": |
| | | if (dataListener.isStatusBarDefaultLight()) { |
| | | StatusBarUtil.setLightMode(FlutterBoost.instance().currentActivity()); |
| | | } else { |
| | | StatusBarUtil.setDarkMode(FlutterBoost.instance().currentActivity()); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | public interface DataListener { |
| | | //状态栏是否默认浅色 |
| | | public boolean isStatusBarDefaultLight(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.demo.library_flutter.nativeview; |
| | | |
| | | import android.app.Activity; |
| | | import android.app.ActivityManager; |
| | | import android.content.Context; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.FrameLayout; |
| | | |
| | | import com.bytedance.sdk.openadsdk.AdSlot; |
| | | import com.bytedance.sdk.openadsdk.TTAdConstant; |
| | | import com.bytedance.sdk.openadsdk.TTAdDislike; |
| | | import com.bytedance.sdk.openadsdk.TTAdManager; |
| | | import com.bytedance.sdk.openadsdk.TTAdNative; |
| | | import com.bytedance.sdk.openadsdk.TTNativeExpressAd; |
| | | import com.demo.lib.common.util.ui.MyActivityManager; |
| | | import com.demo.library_ad.TTAdManagerHolder; |
| | | import com.idlefish.flutterboost.FlutterBoost; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import io.flutter.plugin.common.BinaryMessenger; |
| | | import io.flutter.plugin.common.MessageCodec; |
| | | import io.flutter.plugin.common.MethodCall; |
| | | import io.flutter.plugin.common.MethodChannel; |
| | | import io.flutter.plugin.platform.PlatformView; |
| | | import io.flutter.plugin.platform.PlatformViewFactory; |
| | | |
| | | class CSJExpressNativeView implements PlatformView { |
| | | private Map<String, Object> params; |
| | | private TTAdNative mTTAdNative; |
| | | private MethodChannel methodChannel; |
| | | |
| | | public CSJExpressNativeView(int viewId, Map<String, Object> params, Context context, BinaryMessenger binaryMessenger) { |
| | | this.params = params; |
| | | try { |
| | | TTAdManager ttAdManager = TTAdManagerHolder.get(); |
| | | mTTAdNative = ttAdManager.createAdNative(context); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | methodChannel = new MethodChannel(binaryMessenger, "ad-csj-express-view-" + viewId); |
| | | methodChannel.setMethodCallHandler(new MethodChannel.MethodCallHandler() { |
| | | @Override |
| | | public void onMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result result) { |
| | | if ("refresh".equalsIgnoreCase(call.method)) { |
| | | //刷新 |
| | | if (fl_container != null && adSlot != null) { |
| | | loadAd(adSlot, fl_container); |
| | | } |
| | | |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | private AdSlot adSlot = null; |
| | | private FrameLayout fl_container; |
| | | |
| | | @Override |
| | | public View getView() { |
| | | if (fl_container == null) { |
| | | fl_container = new FrameLayout(getView().getContext()); |
| | | } |
| | | if (adSlot == null) { |
| | | float width = Float.parseFloat(params.get("width") + ""); |
| | | float height = Float.parseFloat(params.get("height") + ""); |
| | | String pid = params.get("pid") + ""; |
| | | adSlot = new AdSlot.Builder() |
| | | .setCodeId(pid) |
| | | .setSupportDeepLink(true) |
| | | .setExpressViewAcceptedSize(width, height) |
| | | .setAdCount(1) //请求广告数量为1到3条 |
| | | .build(); |
| | | } |
| | | loadAd(adSlot, fl_container); |
| | | return fl_container; |
| | | } |
| | | |
| | | private void loadAd(AdSlot adSlot, FrameLayout container) { |
| | | mTTAdNative.loadNativeExpressAd(adSlot, new TTAdNative.NativeExpressAdListener() { |
| | | @Override |
| | | public void onError(int i, String s) { |
| | | //加载失败 |
| | | methodChannel.invokeMethod("loadFail", s); |
| | | } |
| | | |
| | | @Override |
| | | public void onNativeExpressAdLoad(List<TTNativeExpressAd> list) { |
| | | |
| | | if (list != null && list.size() > 0) { |
| | | |
| | | if (FlutterBoost.instance().currentActivity() != null) { |
| | | list.get(0).setDislikeCallback(FlutterBoost.instance().currentActivity(), new TTAdDislike.DislikeInteractionCallback() { |
| | | @Override |
| | | public void onShow() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onSelected(int i, String s, boolean b) { |
| | | //关闭广告 |
| | | methodChannel.invokeMethod("close", null); |
| | | } |
| | | |
| | | @Override |
| | | public void onCancel() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | list.get(0).render(); |
| | | fl_container.removeAllViews(); |
| | | if (list.get(0).getExpressAdView().getParent() != null) { |
| | | ((ViewGroup) list.get(0).getExpressAdView().getParent()).removeAllViews(); |
| | | } |
| | | fl_container.addView(list.get(0).getExpressAdView()); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void dispose() { |
| | | |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.demo.library_flutter.nativeview; |
| | | |
| | | |
| | | import android.content.Context; |
| | | |
| | | import java.util.Map; |
| | | |
| | | import io.flutter.plugin.common.BinaryMessenger; |
| | | import io.flutter.plugin.common.MessageCodec; |
| | | import io.flutter.plugin.platform.PlatformView; |
| | | import io.flutter.plugin.platform.PlatformViewFactory; |
| | | |
| | | public class CSJExpressNativeViewFactory extends PlatformViewFactory { |
| | | |
| | | private BinaryMessenger binaryMessenger; |
| | | |
| | | /** |
| | | * @param createArgsCodec the codec used to decode the args parameter of {@link #create}. |
| | | */ |
| | | public CSJExpressNativeViewFactory(BinaryMessenger binaryMessenger, MessageCodec<Object> createArgsCodec) { |
| | | super(createArgsCodec); |
| | | this.binaryMessenger = binaryMessenger; |
| | | } |
| | | |
| | | @Override |
| | | public PlatformView create(Context context, int viewId, Object args) { |
| | | //参数 |
| | | Map params = (Map) args; |
| | | CSJExpressNativeView view = new CSJExpressNativeView(viewId, params, context, binaryMessenger); |
| | | return view; |
| | | } |
| | | } |
New file |
| | |
| | | package com.demo.library_flutter.nativeview; |
| | | |
| | | import android.app.Activity; |
| | | import android.content.Context; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.FrameLayout; |
| | | |
| | | import com.bytedance.sdk.openadsdk.AdSlot; |
| | | import com.bytedance.sdk.openadsdk.TTAdDislike; |
| | | import com.bytedance.sdk.openadsdk.TTAdManager; |
| | | import com.bytedance.sdk.openadsdk.TTAdNative; |
| | | import com.bytedance.sdk.openadsdk.TTNativeExpressAd; |
| | | import com.demo.lib.common.util.common.DimenUtils; |
| | | import com.demo.lib.common.util.ui.MyActivityManager; |
| | | import com.demo.library_ad.TTAdManagerHolder; |
| | | import com.qq.e.ads.cfg.VideoOption; |
| | | import com.qq.e.ads.nativ.ADSize; |
| | | import com.qq.e.ads.nativ.NativeExpressAD; |
| | | import com.qq.e.ads.nativ.NativeExpressADView; |
| | | import com.qq.e.comm.util.AdError; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import io.flutter.plugin.common.BinaryMessenger; |
| | | import io.flutter.plugin.common.MethodCall; |
| | | import io.flutter.plugin.common.MethodChannel; |
| | | import io.flutter.plugin.platform.PlatformView; |
| | | |
| | | class GDTExpressNativeView implements PlatformView { |
| | | private Map<String, Object> params; |
| | | private NativeExpressAD nativeExpressAD; |
| | | private MethodChannel methodChannel; |
| | | |
| | | public GDTExpressNativeView(int viewId, Map<String, Object> params, BinaryMessenger binaryMessenger) { |
| | | this.params = params; |
| | | methodChannel = new MethodChannel(binaryMessenger, "ad-gdt-express-view-" + viewId); |
| | | methodChannel.setMethodCallHandler(new MethodChannel.MethodCallHandler() { |
| | | @Override |
| | | public void onMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result result) { |
| | | if ("refresh".equalsIgnoreCase(call.method)) { |
| | | //刷新 |
| | | loadAd(); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | private FrameLayout fl_container; |
| | | private NativeExpressADView nativeExpressADView; |
| | | |
| | | @Override |
| | | public View getView() { |
| | | if (fl_container == null) { |
| | | fl_container = new FrameLayout(getView().getContext()); |
| | | } |
| | | |
| | | if (nativeExpressAD == null) { |
| | | float width = Float.parseFloat(params.get("width") + ""); |
| | | float height = Float.parseFloat(params.get("height") + ""); |
| | | String pid = params.get("pid") + ""; |
| | | nativeExpressAD = new NativeExpressAD(getView().getContext(), new ADSize(DimenUtils.dipToPixels((int) width, getView().getContext()), ADSize.AUTO_HEIGHT), pid, new NativeExpressAD.NativeExpressADListener() { |
| | | @Override |
| | | public void onADLoaded(List<NativeExpressADView> list) { |
| | | if (nativeExpressADView != null) { |
| | | nativeExpressADView.destroy(); |
| | | } |
| | | nativeExpressADView = list.get(0); |
| | | nativeExpressADView.render(); |
| | | if (fl_container.getChildCount() > 0) { |
| | | fl_container.removeAllViews(); |
| | | } |
| | | if (nativeExpressADView.getParent() != null) { |
| | | ((ViewGroup) nativeExpressADView.getParent()).removeAllViews(); |
| | | } |
| | | // 需要保证 View 被绘制的时候是可见的,否则将无法产生曝光和收益。 |
| | | fl_container.addView(nativeExpressADView); |
| | | } |
| | | |
| | | @Override |
| | | public void onRenderFail(NativeExpressADView nativeExpressADView) { |
| | | methodChannel.invokeMethod("loadFail", "渲染失败"); |
| | | } |
| | | |
| | | @Override |
| | | public void onRenderSuccess(NativeExpressADView nativeExpressADView) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onADExposure(NativeExpressADView nativeExpressADView) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onADClicked(NativeExpressADView nativeExpressADView) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onADClosed(NativeExpressADView nativeExpressADView) { |
| | | methodChannel.invokeMethod("close", null); |
| | | } |
| | | |
| | | @Override |
| | | public void onADLeftApplication(NativeExpressADView nativeExpressADView) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onNoAD(AdError adError) { |
| | | methodChannel.invokeMethod("loadFail", adError.getErrorMsg()); |
| | | } |
| | | }); |
| | | |
| | | nativeExpressAD.setVideoOption(new VideoOption.Builder() |
| | | .setAutoPlayPolicy(VideoOption.AutoPlayPolicy.WIFI) // WIFI 环境下可以自动播放视频 |
| | | .setAutoPlayMuted(true) // 自动播放时为静音 |
| | | .build()); |
| | | } |
| | | loadAd(); |
| | | return fl_container; |
| | | } |
| | | |
| | | private void loadAd() { |
| | | if (nativeExpressAD != null) { |
| | | nativeExpressAD.loadAD(1); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void dispose() { |
| | | |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.demo.library_flutter.nativeview; |
| | | |
| | | |
| | | import android.content.Context; |
| | | |
| | | import java.util.Map; |
| | | |
| | | import io.flutter.plugin.common.BinaryMessenger; |
| | | import io.flutter.plugin.common.MessageCodec; |
| | | import io.flutter.plugin.platform.PlatformView; |
| | | import io.flutter.plugin.platform.PlatformViewFactory; |
| | | |
| | | public class GDTExpressNativeViewFactory extends PlatformViewFactory { |
| | | |
| | | |
| | | private BinaryMessenger binaryMessenger; |
| | | |
| | | /** |
| | | * @param createArgsCodec the codec used to decode the args parameter of {@link #create}. |
| | | */ |
| | | public GDTExpressNativeViewFactory(BinaryMessenger binaryMessenger, MessageCodec<Object> createArgsCodec) { |
| | | super(createArgsCodec); |
| | | this.binaryMessenger = binaryMessenger; |
| | | } |
| | | |
| | | @Override |
| | | public PlatformView create(Context context, int viewId, Object args) { |
| | | //参数 |
| | | Map params = (Map) args; |
| | | GDTExpressNativeView view = new GDTExpressNativeView(viewId, params, binaryMessenger); |
| | | return view; |
| | | } |
| | | } |
New file |
| | |
| | | <vector xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:aapt="http://schemas.android.com/aapt" |
| | | android:width="108dp" |
| | | android:height="108dp" |
| | | android:viewportWidth="108" |
| | | android:viewportHeight="108"> |
| | | <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> |
| | | <aapt:attr name="android:fillColor"> |
| | | <gradient |
| | | android:endX="85.84757" |
| | | android:endY="92.4963" |
| | | android:startX="42.9492" |
| | | android:startY="49.59793" |
| | | android:type="linear"> |
| | | <item |
| | | android:color="#44000000" |
| | | android:offset="0.0" /> |
| | | <item |
| | | android:color="#00000000" |
| | | android:offset="1.0" /> |
| | | </gradient> |
| | | </aapt:attr> |
| | | </path> |
| | | <path |
| | | android:fillColor="#FFFFFF" |
| | | android:fillType="nonZero" |
| | | android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" |
| | | android:strokeWidth="1" |
| | | android:strokeColor="#00000000" /> |
| | | </vector> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <vector xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:width="108dp" |
| | | android:height="108dp" |
| | | android:viewportWidth="108" |
| | | android:viewportHeight="108"> |
| | | <path |
| | | android:fillColor="#3DDC84" |
| | | android:pathData="M0,0h108v108h-108z" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M9,0L9,108" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M19,0L19,108" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M29,0L29,108" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M39,0L39,108" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M49,0L49,108" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M59,0L59,108" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M69,0L69,108" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M79,0L79,108" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M89,0L89,108" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M99,0L99,108" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M0,9L108,9" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M0,19L108,19" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M0,29L108,29" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M0,39L108,39" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M0,49L108,49" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M0,59L108,59" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M0,69L108,69" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M0,79L108,79" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M0,89L108,89" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M0,99L108,99" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M19,29L89,29" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M19,39L89,39" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M19,49L89,49" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M19,59L89,59" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M19,69L89,69" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M19,79L89,79" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M29,19L29,89" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M39,19L39,89" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M49,19L49,89" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M59,19L59,89" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M69,19L69,89" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | <path |
| | | android:fillColor="#00000000" |
| | | android:pathData="M79,19L79,89" |
| | | android:strokeWidth="0.8" |
| | | android:strokeColor="#33FFFFFF" /> |
| | | </vector> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:tools="http://schemas.android.com/tools" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | tools:context=".FlutterCommonActivity"> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="Hello World!" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintLeft_toLeftOf="parent" |
| | | app:layout_constraintRight_toRightOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" /> |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <background android:drawable="@drawable/ic_launcher_background" /> |
| | | <foreground android:drawable="@drawable/ic_launcher_foreground" /> |
| | | </adaptive-icon> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <background android:drawable="@drawable/ic_launcher_background" /> |
| | | <foreground android:drawable="@drawable/ic_launcher_foreground" /> |
| | | </adaptive-icon> |
New file |
| | |
| | | <resources xmlns:tools="http://schemas.android.com/tools"> |
| | | <!-- Base application theme. --> |
| | | <style name="Theme.Android" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> |
| | | <!-- Primary brand color. --> |
| | | <item name="colorPrimary">@color/purple_200</item> |
| | | <item name="colorPrimaryVariant">@color/purple_700</item> |
| | | <item name="colorOnPrimary">@color/black</item> |
| | | <!-- Secondary brand color. --> |
| | | <item name="colorSecondary">@color/teal_200</item> |
| | | <item name="colorSecondaryVariant">@color/teal_200</item> |
| | | <item name="colorOnSecondary">@color/black</item> |
| | | <!-- Status bar color. --> |
| | | <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item> |
| | | <!-- Customize your theme here. --> |
| | | </style> |
| | | </resources> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <resources> |
| | | <color name="purple_200">#FFBB86FC</color> |
| | | <color name="purple_500">#FF6200EE</color> |
| | | <color name="purple_700">#FF3700B3</color> |
| | | <color name="teal_200">#FF03DAC5</color> |
| | | <color name="teal_700">#FF018786</color> |
| | | <color name="black">#FF000000</color> |
| | | <color name="white">#FFFFFFFF</color> |
| | | </resources> |
New file |
| | |
| | | <resources> |
| | | <string name="app_name">library-flutter</string> |
| | | </resources> |
New file |
| | |
| | | <resources xmlns:tools="http://schemas.android.com/tools"> |
| | | <!-- Base application theme. --> |
| | | <style name="Theme.Android" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> |
| | | <!-- Primary brand color. --> |
| | | <item name="colorPrimary">@color/purple_500</item> |
| | | <item name="colorPrimaryVariant">@color/purple_700</item> |
| | | <item name="colorOnPrimary">@color/white</item> |
| | | <!-- Secondary brand color. --> |
| | | <item name="colorSecondary">@color/teal_200</item> |
| | | <item name="colorSecondaryVariant">@color/teal_700</item> |
| | | <item name="colorOnSecondary">@color/black</item> |
| | | <!-- Status bar color. --> |
| | | <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item> |
| | | <!-- Customize your theme here. --> |
| | | </style> |
| | | </resources> |
New file |
| | |
| | | package com.demo.library_flutter; |
| | | |
| | | import org.junit.Test; |
| | | |
| | | import static org.junit.Assert.*; |
| | | |
| | | /** |
| | | * Example local unit test, which will execute on the development machine (host). |
| | | * |
| | | * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> |
| | | */ |
| | | public class ExampleUnitTest { |
| | | @Test |
| | | public void addition_isCorrect() { |
| | | assertEquals(4, 2 + 2); |
| | | } |
| | | } |
| | |
| | | dependencyResolutionManagement { |
| | | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) |
| | | repositories { |
| | | maven { |
| | | url "https://maven.aliyun.com/repository/public" |
| | | } |
| | | //dependencyResolutionManagement { |
| | | // repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) |
| | | // repositories { |
| | | // maven { |
| | | // url "https://maven.aliyun.com/repository/public" |
| | | // } |
| | | // |
| | | // maven { |
| | | // url "https://maven.aliyun.com/repository/google" |
| | | // } |
| | | // mavenCentral() |
| | | // |
| | | // //穿山甲 |
| | | // maven { |
| | | // url 'https://artifact.bytedance.com/repository/pangle' |
| | | // } |
| | | // |
| | | // //火山引擎maven仓库地址 |
| | | // maven { url 'https://artifact.bytedance.com/repository/Volcengine/' } |
| | | // |
| | | // //阿里百川 |
| | | // maven { |
| | | // url "http://repo.baichuan-android.taobao.com/content/groups/BaichuanRepositories/" |
| | | // } |
| | | // |
| | | // jcenter() |
| | | // |
| | | // maven { url 'https://jitpack.io' } |
| | | // } |
| | | //} |
| | | |
| | | maven { |
| | | url "https://maven.aliyun.com/repository/google" |
| | | } |
| | | mavenCentral() |
| | | setBinding(new Binding([gradle: this])) |
| | | evaluate(new File( |
| | | settingsDir.parentFile, |
| | | 'flutter_module/.android/include_flutter.groovy' |
| | | )) |
| | | |
| | | //穿山甲 |
| | | maven { |
| | | url 'https://artifact.bytedance.com/repository/pangle' |
| | | } |
| | | |
| | | //火山引擎maven仓库地址 |
| | | maven { url 'https://artifact.bytedance.com/repository/Volcengine/' } |
| | | |
| | | //阿里百川 |
| | | maven { |
| | | url "http://repo.baichuan-android.taobao.com/content/groups/BaichuanRepositories/" |
| | | } |
| | | |
| | | jcenter() |
| | | |
| | | maven { url 'https://jitpack.io' } |
| | | } |
| | | } |
| | | rootProject.name = "Android" |
| | | include ':app' |
| | | include ':library-common' |
| | |
| | | include ':library-ec' |
| | | include ':library-dp' |
| | | include ':library-login' |
| | | include ':library-flutter' |
| | | |
| | | include ':flutter_module' |
| | | project(':flutter_module').projectDir = new File('../flutter_module') |
New file |
| | |
| | | .DS_Store |
| | | .dart_tool/ |
| | | |
| | | .packages |
| | | .pub/ |
| | | |
| | | .idea/ |
| | | .vagrant/ |
| | | .sconsign.dblite |
| | | .svn/ |
| | | |
| | | *.swp |
| | | profile |
| | | |
| | | DerivedData/ |
| | | |
| | | .generated/ |
| | | |
| | | *.pbxuser |
| | | *.mode1v3 |
| | | *.mode2v3 |
| | | *.perspectivev3 |
| | | |
| | | !default.pbxuser |
| | | !default.mode1v3 |
| | | !default.mode2v3 |
| | | !default.perspectivev3 |
| | | |
| | | xcuserdata |
| | | |
| | | *.moved-aside |
| | | |
| | | *.pyc |
| | | *sync/ |
| | | Icon? |
| | | .tags* |
| | | |
| | | build/ |
| | | .android/ |
| | | .ios/ |
| | | .flutter-plugins |
| | | .flutter-plugins-dependencies |
| | | |
| | | # Symbolication related |
| | | app.*.symbols |
| | | |
| | | # Obfuscation related |
| | | app.*.map.json |
New file |
| | |
| | | # This file tracks properties of this Flutter project. |
| | | # Used by Flutter tool to assess capabilities and perform upgrades etc. |
| | | # |
| | | # This file should be version controlled and should not be manually edited. |
| | | |
| | | version: |
| | | revision: 18116933e77adc82f80866c928266a5b4f1ed645 |
| | | channel: stable |
| | | |
| | | project_type: module |
New file |
| | |
| | | # flutter_module |
| | | |
| | | A new Flutter module. |
| | | |
| | | ## Getting Started |
| | | |
| | | For help getting started with Flutter, view our online |
| | | [documentation](https://flutter.dev/). |
| | | |
| | | For instructions integrating Flutter modules to your existing applications, |
| | | see the [add-to-app documentation](https://flutter.dev/docs/development/add-to-app). |
New file |
| | |
| | | include: package:flutter_lints/flutter.yaml |
| | | |
| | | # Additional information about this file can be found at |
| | | # https://dart.dev/guides/language/analysis-options |
New file |
| | |
| | | import 'package:flutter/material.dart'; |
| | | |
| | | void main() => runApp(const MyApp()); |
| | | |
| | | class MyApp extends StatelessWidget { |
| | | const MyApp({Key? key}) : super(key: key); |
| | | |
| | | // This widget is the root of your application. |
| | | @override |
| | | Widget build(BuildContext context) { |
| | | return MaterialApp( |
| | | title: 'Flutter Demo', |
| | | theme: ThemeData( |
| | | // This is the theme of your application. |
| | | // |
| | | // Try running your application with "flutter run". You'll see the |
| | | // application has a blue toolbar. Then, without quitting the app, try |
| | | // changing the primarySwatch below to Colors.green and then invoke |
| | | // "hot reload" (press "r" in the console where you ran "flutter run", |
| | | // or press Run > Flutter Hot Reload in a Flutter IDE). Notice that the |
| | | // counter didn't reset back to zero; the application is not restarted. |
| | | primarySwatch: Colors.blue, |
| | | ), |
| | | home: const MyHomePage(title: 'Flutter Demo Home Page'), |
| | | ); |
| | | } |
| | | } |
| | | |
| | | class MyHomePage extends StatefulWidget { |
| | | const MyHomePage({Key? key, required this.title}) : super(key: key); |
| | | |
| | | // This widget is the home page of your application. It is stateful, meaning |
| | | // that it has a State object (defined below) that contains fields that affect |
| | | // how it looks. |
| | | |
| | | // This class is the configuration for the state. It holds the values (in this |
| | | // case the title) provided by the parent (in this case the App widget) and |
| | | // used by the build method of the State. Fields in a Widget subclass are |
| | | // always marked "final". |
| | | |
| | | final String title; |
| | | |
| | | @override |
| | | State<MyHomePage> createState() => _MyHomePageState(); |
| | | } |
| | | |
| | | class _MyHomePageState extends State<MyHomePage> { |
| | | int _counter = 0; |
| | | |
| | | void _incrementCounter() { |
| | | setState(() { |
| | | // This call to setState tells the Flutter framework that something has |
| | | // changed in this State, which causes it to rerun the build method below |
| | | // so that the display can reflect the updated values. If we changed |
| | | // _counter without calling setState(), then the build method would not be |
| | | // called again, and so nothing would appear to happen. |
| | | _counter++; |
| | | }); |
| | | } |
| | | |
| | | @override |
| | | Widget build(BuildContext context) { |
| | | // This method is rerun every time setState is called, for instance as done |
| | | // by the _incrementCounter method above. |
| | | // |
| | | // The Flutter framework has been optimized to make rerunning build methods |
| | | // fast, so that you can just rebuild anything that needs updating rather |
| | | // than having to individually change instances of widgets. |
| | | return Scaffold( |
| | | appBar: AppBar( |
| | | // Here we take the value from the MyHomePage object that was created by |
| | | // the App.build method, and use it to set our appbar title. |
| | | title: Text(widget.title), |
| | | ), |
| | | body: Center( |
| | | // Center is a layout widget. It takes a single child and positions it |
| | | // in the middle of the parent. |
| | | child: Column( |
| | | // Column is also a layout widget. It takes a list of children and |
| | | // arranges them vertically. By default, it sizes itself to fit its |
| | | // children horizontally, and tries to be as tall as its parent. |
| | | // |
| | | // Invoke "debug painting" (press "p" in the console, choose the |
| | | // "Toggle Debug Paint" action from the Flutter Inspector in Android |
| | | // Studio, or the "Toggle Debug Paint" command in Visual Studio Code) |
| | | // to see the wireframe for each widget. |
| | | // |
| | | // Column has various properties to control how it sizes itself and |
| | | // how it positions its children. Here we use mainAxisAlignment to |
| | | // center the children vertically; the main axis here is the vertical |
| | | // axis because Columns are vertical (the cross axis would be |
| | | // horizontal). |
| | | mainAxisAlignment: MainAxisAlignment.center, |
| | | children: <Widget>[ |
| | | const Text( |
| | | 'You have pushed the button this many times:', |
| | | ), |
| | | Text( |
| | | '$_counter', |
| | | style: Theme.of(context).textTheme.headline4, |
| | | ), |
| | | ], |
| | | ), |
| | | ), |
| | | floatingActionButton: FloatingActionButton( |
| | | onPressed: _incrementCounter, |
| | | tooltip: 'Increment', |
| | | child: const Icon(Icons.add), |
| | | ), // This trailing comma makes auto-formatting nicer for build methods. |
| | | ); |
| | | } |
| | | } |
New file |
| | |
| | | # Generated by pub |
| | | # See https://dart.dev/tools/pub/glossary#lockfile |
| | | packages: |
| | | async: |
| | | dependency: transitive |
| | | description: |
| | | name: async |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.8.1" |
| | | boolean_selector: |
| | | dependency: transitive |
| | | description: |
| | | name: boolean_selector |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.1.0" |
| | | cached_network_image: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: cached_network_image |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "3.2.0" |
| | | cached_network_image_platform_interface: |
| | | dependency: transitive |
| | | description: |
| | | name: cached_network_image_platform_interface |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.0.0" |
| | | cached_network_image_web: |
| | | dependency: transitive |
| | | description: |
| | | name: cached_network_image_web |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.0.1" |
| | | characters: |
| | | dependency: transitive |
| | | description: |
| | | name: characters |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.1.0" |
| | | charcode: |
| | | dependency: transitive |
| | | description: |
| | | name: charcode |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.3.1" |
| | | clock: |
| | | dependency: transitive |
| | | description: |
| | | name: clock |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.1.0" |
| | | collection: |
| | | dependency: transitive |
| | | description: |
| | | name: collection |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.15.0" |
| | | cross_file: |
| | | dependency: transitive |
| | | description: |
| | | name: cross_file |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "0.3.2" |
| | | crypto: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: crypto |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "3.0.1" |
| | | csslib: |
| | | dependency: transitive |
| | | description: |
| | | name: csslib |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "0.17.1" |
| | | cupertino_icons: |
| | | dependency: "direct main" |
| | | description: |
| | | name: cupertino_icons |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.0.4" |
| | | date_format: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: date_format |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.5" |
| | | device_info: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: device_info |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.3" |
| | | device_info_platform_interface: |
| | | dependency: transitive |
| | | description: |
| | | name: device_info_platform_interface |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.1" |
| | | dio: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: dio |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "4.0.4" |
| | | event_bus: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: event_bus |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.0" |
| | | fake_async: |
| | | dependency: transitive |
| | | description: |
| | | name: fake_async |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.2.0" |
| | | ffi: |
| | | dependency: transitive |
| | | description: |
| | | name: ffi |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.1.2" |
| | | file: |
| | | dependency: transitive |
| | | description: |
| | | name: file |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "6.1.2" |
| | | flutter: |
| | | dependency: "direct main" |
| | | description: flutter |
| | | source: sdk |
| | | version: "0.0.0" |
| | | flutter_blurhash: |
| | | dependency: transitive |
| | | description: |
| | | name: flutter_blurhash |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "0.6.4" |
| | | flutter_boost: |
| | | dependency: "direct dev" |
| | | description: |
| | | path: "." |
| | | ref: "v3.0-null-safety-preview.18" |
| | | resolved-ref: c4e5ed7c0471fe11b202b5df70b6ee6fe28369ed |
| | | url: "https://github.com/alibaba/flutter_boost.git" |
| | | source: git |
| | | version: "3.0.0" |
| | | flutter_cache_manager: |
| | | dependency: transitive |
| | | description: |
| | | name: flutter_cache_manager |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "3.3.0" |
| | | flutter_datetime_picker: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: flutter_datetime_picker |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.5.1" |
| | | flutter_lints: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: flutter_lints |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.0.4" |
| | | flutter_plugin_android_lifecycle: |
| | | dependency: transitive |
| | | description: |
| | | name: flutter_plugin_android_lifecycle |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.5" |
| | | flutter_spinkit: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: flutter_spinkit |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "5.1.0" |
| | | flutter_swiper_null_safety: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: flutter_swiper_null_safety |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.0.2" |
| | | flutter_test: |
| | | dependency: "direct dev" |
| | | description: flutter |
| | | source: sdk |
| | | version: "0.0.0" |
| | | flutter_web_plugins: |
| | | dependency: transitive |
| | | description: flutter |
| | | source: sdk |
| | | version: "0.0.0" |
| | | flutter_widget_from_html_core: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: flutter_widget_from_html_core |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "0.8.5+1" |
| | | fluwx_no_pay: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: fluwx_no_pay |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "3.8.1" |
| | | fwfh_text_style: |
| | | dependency: transitive |
| | | description: |
| | | name: fwfh_text_style |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.5.1" |
| | | html: |
| | | dependency: transitive |
| | | description: |
| | | name: html |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "0.15.0" |
| | | http: |
| | | dependency: transitive |
| | | description: |
| | | name: http |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "0.13.4" |
| | | http_parser: |
| | | dependency: transitive |
| | | description: |
| | | name: http_parser |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "4.0.0" |
| | | image_cropper: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: image_cropper |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.5.0" |
| | | image_gallery_saver: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: image_gallery_saver |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.7.1" |
| | | image_picker: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: image_picker |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "0.8.4+11" |
| | | image_picker_for_web: |
| | | dependency: transitive |
| | | description: |
| | | name: image_picker_for_web |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.1.6" |
| | | image_picker_platform_interface: |
| | | dependency: transitive |
| | | description: |
| | | name: image_picker_platform_interface |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.4.4" |
| | | js: |
| | | dependency: transitive |
| | | description: |
| | | name: js |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "0.6.3" |
| | | launch_review: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: launch_review |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "3.0.1" |
| | | lints: |
| | | dependency: transitive |
| | | description: |
| | | name: lints |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.0.1" |
| | | matcher: |
| | | dependency: transitive |
| | | description: |
| | | name: matcher |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "0.12.10" |
| | | meta: |
| | | dependency: transitive |
| | | description: |
| | | name: meta |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.7.0" |
| | | mime: |
| | | dependency: transitive |
| | | description: |
| | | name: mime |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.0.1" |
| | | octo_image: |
| | | dependency: transitive |
| | | description: |
| | | name: octo_image |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.0.1" |
| | | oktoast: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: oktoast |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "3.1.5" |
| | | package_info: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: package_info |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.2" |
| | | path: |
| | | dependency: transitive |
| | | description: |
| | | name: path |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.8.0" |
| | | path_provider: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: path_provider |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.9" |
| | | path_provider_android: |
| | | dependency: transitive |
| | | description: |
| | | name: path_provider_android |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.11" |
| | | path_provider_ios: |
| | | dependency: transitive |
| | | description: |
| | | name: path_provider_ios |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.7" |
| | | path_provider_linux: |
| | | dependency: transitive |
| | | description: |
| | | name: path_provider_linux |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.1.5" |
| | | path_provider_macos: |
| | | dependency: transitive |
| | | description: |
| | | name: path_provider_macos |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.5" |
| | | path_provider_platform_interface: |
| | | dependency: transitive |
| | | description: |
| | | name: path_provider_platform_interface |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.3" |
| | | path_provider_windows: |
| | | dependency: transitive |
| | | description: |
| | | name: path_provider_windows |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.5" |
| | | pedantic: |
| | | dependency: transitive |
| | | description: |
| | | name: pedantic |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.11.1" |
| | | permission_handler: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: permission_handler |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "8.3.0" |
| | | permission_handler_platform_interface: |
| | | dependency: transitive |
| | | description: |
| | | name: permission_handler_platform_interface |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "3.7.0" |
| | | platform: |
| | | dependency: transitive |
| | | description: |
| | | name: platform |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "3.1.0" |
| | | plugin_platform_interface: |
| | | dependency: transitive |
| | | description: |
| | | name: plugin_platform_interface |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.1.2" |
| | | process: |
| | | dependency: transitive |
| | | description: |
| | | name: process |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "4.2.4" |
| | | pull_to_refresh: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: pull_to_refresh |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.0" |
| | | qr: |
| | | dependency: transitive |
| | | description: |
| | | name: qr |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.1.0" |
| | | qr_flutter: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: qr_flutter |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "4.0.0" |
| | | rxdart: |
| | | dependency: transitive |
| | | description: |
| | | name: rxdart |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "0.27.3" |
| | | screenshot: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: screenshot |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.2.3" |
| | | share_plus: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: share_plus |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "3.1.0" |
| | | share_plus_linux: |
| | | dependency: transitive |
| | | description: |
| | | name: share_plus_linux |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.4" |
| | | share_plus_macos: |
| | | dependency: transitive |
| | | description: |
| | | name: share_plus_macos |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.2" |
| | | share_plus_platform_interface: |
| | | dependency: transitive |
| | | description: |
| | | name: share_plus_platform_interface |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.1" |
| | | share_plus_web: |
| | | dependency: transitive |
| | | description: |
| | | name: share_plus_web |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.4" |
| | | share_plus_windows: |
| | | dependency: transitive |
| | | description: |
| | | name: share_plus_windows |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.3" |
| | | shared_preferences: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: shared_preferences |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.13" |
| | | shared_preferences_android: |
| | | dependency: transitive |
| | | description: |
| | | name: shared_preferences_android |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.10" |
| | | shared_preferences_ios: |
| | | dependency: transitive |
| | | description: |
| | | name: shared_preferences_ios |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.9" |
| | | shared_preferences_linux: |
| | | dependency: transitive |
| | | description: |
| | | name: shared_preferences_linux |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.1.0" |
| | | shared_preferences_macos: |
| | | dependency: transitive |
| | | description: |
| | | name: shared_preferences_macos |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.3" |
| | | shared_preferences_platform_interface: |
| | | dependency: transitive |
| | | description: |
| | | name: shared_preferences_platform_interface |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.0" |
| | | shared_preferences_web: |
| | | dependency: transitive |
| | | description: |
| | | name: shared_preferences_web |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.3" |
| | | shared_preferences_windows: |
| | | dependency: transitive |
| | | description: |
| | | name: shared_preferences_windows |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.1.0" |
| | | sky_engine: |
| | | dependency: transitive |
| | | description: flutter |
| | | source: sdk |
| | | version: "0.0.99" |
| | | source_span: |
| | | dependency: transitive |
| | | description: |
| | | name: source_span |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.8.1" |
| | | sqflite: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: sqflite |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.2" |
| | | sqflite_common: |
| | | dependency: transitive |
| | | description: |
| | | name: sqflite_common |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.1+1" |
| | | stack_trace: |
| | | dependency: transitive |
| | | description: |
| | | name: stack_trace |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.10.0" |
| | | stream_channel: |
| | | dependency: transitive |
| | | description: |
| | | name: stream_channel |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.1.0" |
| | | string_scanner: |
| | | dependency: transitive |
| | | description: |
| | | name: string_scanner |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.1.0" |
| | | synchronized: |
| | | dependency: transitive |
| | | description: |
| | | name: synchronized |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "3.0.0" |
| | | term_glyph: |
| | | dependency: transitive |
| | | description: |
| | | name: term_glyph |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.2.0" |
| | | test_api: |
| | | dependency: transitive |
| | | description: |
| | | name: test_api |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "0.4.2" |
| | | toast: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: toast |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "0.1.5" |
| | | typed_data: |
| | | dependency: transitive |
| | | description: |
| | | name: typed_data |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.3.0" |
| | | url_launcher: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: url_launcher |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "6.0.20" |
| | | url_launcher_android: |
| | | dependency: transitive |
| | | description: |
| | | name: url_launcher_android |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "6.0.14" |
| | | url_launcher_ios: |
| | | dependency: transitive |
| | | description: |
| | | name: url_launcher_ios |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "6.0.14" |
| | | url_launcher_linux: |
| | | dependency: transitive |
| | | description: |
| | | name: url_launcher_linux |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "3.0.0" |
| | | url_launcher_macos: |
| | | dependency: transitive |
| | | description: |
| | | name: url_launcher_macos |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "3.0.0" |
| | | url_launcher_platform_interface: |
| | | dependency: transitive |
| | | description: |
| | | name: url_launcher_platform_interface |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.5" |
| | | url_launcher_web: |
| | | dependency: transitive |
| | | description: |
| | | name: url_launcher_web |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.0.7" |
| | | url_launcher_windows: |
| | | dependency: transitive |
| | | description: |
| | | name: url_launcher_windows |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "3.0.0" |
| | | uuid: |
| | | dependency: transitive |
| | | description: |
| | | name: uuid |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "3.0.6" |
| | | vector_math: |
| | | dependency: transitive |
| | | description: |
| | | name: vector_math |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.1.0" |
| | | webview_flutter: |
| | | dependency: "direct dev" |
| | | description: |
| | | name: webview_flutter |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.8.0" |
| | | webview_flutter_android: |
| | | dependency: transitive |
| | | description: |
| | | name: webview_flutter_android |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.8.3" |
| | | webview_flutter_platform_interface: |
| | | dependency: transitive |
| | | description: |
| | | name: webview_flutter_platform_interface |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "1.8.1" |
| | | webview_flutter_wkwebview: |
| | | dependency: transitive |
| | | description: |
| | | name: webview_flutter_wkwebview |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.7.1" |
| | | win32: |
| | | dependency: transitive |
| | | description: |
| | | name: win32 |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "2.3.6" |
| | | xdg_directories: |
| | | dependency: transitive |
| | | description: |
| | | name: xdg_directories |
| | | url: "https://pub.flutter-io.cn" |
| | | source: hosted |
| | | version: "0.2.0+1" |
| | | sdks: |
| | | dart: ">=2.14.0 <3.0.0" |
| | | flutter: ">=2.5.0" |
New file |
| | |
| | | name: flutter_module |
| | | description: A new Flutter module. |
| | | |
| | | # The following defines the version and build number for your application. |
| | | # A version number is three numbers separated by dots, like 1.2.43 |
| | | # followed by an optional build number separated by a +. |
| | | # Both the version and the builder number may be overridden in flutter |
| | | # build by specifying --build-name and --build-number, respectively. |
| | | # In Android, build-name is used as versionName while build-number used as versionCode. |
| | | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning |
| | | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. |
| | | # Read more about iOS versioning at |
| | | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html |
| | | # |
| | | # This version is used _only_ for the Runner app, which is used if you just do |
| | | # a `flutter run` or a `flutter make-host-app-editable`. It has no impact |
| | | # on any other native host app that you embed your Flutter project into. |
| | | version: 1.0.0+1 |
| | | |
| | | environment: |
| | | sdk: ">=2.12.0 <3.0.0" |
| | | |
| | | dependencies: |
| | | flutter: |
| | | sdk: flutter |
| | | |
| | | # The following adds the Cupertino Icons font to your application. |
| | | # Use with the CupertinoIcons class for iOS style icons. |
| | | cupertino_icons: ^1.0.2 |
| | | |
| | | dev_dependencies: |
| | | flutter_test: |
| | | sdk: flutter |
| | | flutter_lints: ^1.0.0 |
| | | cupertino_icons: ^1.0.3 |
| | | permission_handler: ^8.2.6 |
| | | |
| | | |
| | | shared_preferences: ^2.0.8 |
| | | |
| | | oktoast: ^3.1.5 |
| | | |
| | | dio: ^4.0.4 |
| | | |
| | | #轮播图插件 |
| | | flutter_swiper_null_safety: ^1.0.2 |
| | | |
| | | toast: ^0.1.5 |
| | | |
| | | webview_flutter: ^2.8.0 |
| | | |
| | | flutter_widget_from_html_core: ^0.8.3 |
| | | |
| | | #时间日期选择 |
| | | flutter_datetime_picker: ^1.5.1 |
| | | #二维码生成 |
| | | qr_flutter: ^4.0.0 |
| | | |
| | | #分享组件 |
| | | share_plus: ^3.0.4 |
| | | path_provider: ^2.0.6 |
| | | |
| | | #微信登录 |
| | | fluwx_no_pay: ^3.6.1+5 |
| | | |
| | | event_bus: ^2.0.0 |
| | | |
| | | #极光推送 |
| | | # jpush_flutter: ^2.1.8 |
| | | |
| | | #获取设备信息 |
| | | device_info: ^2.0.3 |
| | | |
| | | #加密 |
| | | crypto: ^3.0.1 |
| | | |
| | | flutter_spinkit: ^5.1.0 |
| | | |
| | | #下拉刷新 |
| | | pull_to_refresh: ^2.0.0 |
| | | |
| | | url_launcher: ^6.0.17 |
| | | |
| | | package_info: ^2.0.2 |
| | | |
| | | launch_review: ^3.0.1 |
| | | |
| | | date_format: ^2.0.4 |
| | | |
| | | #截图插件 |
| | | screenshot: ^1.2.3 |
| | | |
| | | #网络图片加载框架 |
| | | cached_network_image: ^3.2.0 |
| | | |
| | | #图片选择 |
| | | image_picker: ^0.8.4+9 |
| | | #图片裁剪 |
| | | image_cropper: ^1.5.0 |
| | | |
| | | sqflite: ^2.0.2 |
| | | |
| | | #保存图片到相册 |
| | | image_gallery_saver: ^1.7.1 |
| | | |
| | | flutter_boost: |
| | | git: |
| | | url: 'https://github.com/alibaba/flutter_boost.git' |
| | | ref: 'v3.0-null-safety-preview.18' |
| | | |
| | | |
| | | # For information on the generic Dart part of this file, see the |
| | | # following page: https://dart.dev/tools/pub/pubspec |
| | | |
| | | flutter: |
| | | # The following line ensures that the Material Icons font is |
| | | # included with your application, so that you can use the icons in |
| | | # the material Icons class. |
| | | uses-material-design: true |
| | | |
| | | # To add Flutter specific assets to your application, add an assets section, |
| | | # like this: |
| | | # assets: |
| | | # - images/a_dot_burr.jpeg |
| | | # - images/a_dot_ham.jpeg |
| | | |
| | | # An image asset can refer to one or more resolution-specific "variants", see |
| | | # https://flutter.dev/assets-and-images/#resolution-aware. |
| | | |
| | | # For details regarding adding assets from package dependencies, see |
| | | # https://flutter.dev/assets-and-images/#from-packages |
| | | |
| | | # To add Flutter specific custom fonts to your application, add a fonts |
| | | # section here, in this "flutter" section. Each entry in this list should |
| | | # have a "family" key with the font family name, and a "fonts" key with a |
| | | # list giving the asset and other descriptors for the font. For |
| | | # example: |
| | | # fonts: |
| | | # - family: Schyler |
| | | # fonts: |
| | | # - asset: fonts/Schyler-Regular.ttf |
| | | # - asset: fonts/Schyler-Italic.ttf |
| | | # style: italic |
| | | # - family: Trajan Pro |
| | | # fonts: |
| | | # - asset: fonts/TrajanPro.ttf |
| | | # - asset: fonts/TrajanPro_Bold.ttf |
| | | # weight: 700 |
| | | # |
| | | # For details regarding fonts from package dependencies, |
| | | # see https://flutter.dev/custom-fonts/#from-packages |
| | | |
| | | |
| | | # This section identifies your Flutter project as a module meant for |
| | | # embedding in a native host app. These identifiers should _not_ ordinarily |
| | | # be changed after generation - they are used to ensure that the tooling can |
| | | # maintain consistency when adding or modifying assets and plugins. |
| | | # They also do not have any bearing on your native host application's |
| | | # identifiers, which may be completely independent or the same as these. |
| | | module: |
| | | androidX: true |
| | | androidPackage: com.demo.flutter_module |
| | | iosBundleIdentifier: com.demo.flutterModule |
New file |
| | |
| | | |
| | | // Generated file. Do not edit. |
| | | include ':.android' |
New file |
| | |
| | | // This is a basic Flutter widget test. |
| | | // |
| | | // To perform an interaction with a widget in your test, use the WidgetTester |
| | | // utility that Flutter provides. For example, you can send tap and scroll |
| | | // gestures. You can also use WidgetTester to find child widgets in the widget |
| | | // tree, read text, and verify that the values of widget properties are correct. |
| | | |
| | | import 'package:flutter/material.dart'; |
| | | import 'package:flutter_test/flutter_test.dart'; |
| | | |
| | | import 'package:flutter_module/main.dart'; |
| | | |
| | | void main() { |
| | | testWidgets('Counter increments smoke test', (WidgetTester tester) async { |
| | | // Build our app and trigger a frame. |
| | | await tester.pumpWidget(const MyApp()); |
| | | |
| | | // Verify that our counter starts at 0. |
| | | expect(find.text('0'), findsOneWidget); |
| | | expect(find.text('1'), findsNothing); |
| | | |
| | | // Tap the '+' icon and trigger a frame. |
| | | await tester.tap(find.byIcon(Icons.add)); |
| | | await tester.pump(); |
| | | |
| | | // Verify that our counter has incremented. |
| | | expect(find.text('0'), findsNothing); |
| | | expect(find.text('1'), findsOneWidget); |
| | | }); |
| | | } |