Skip to content

Commit

Permalink
Upgrade gradle & Fix warnings & Change share plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
And96 committed Jun 9, 2022
1 parent 91385ca commit d7fc24e
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 9 deletions.
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:7.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
9 changes: 5 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:back_button_interceptor/back_button_interceptor.dart';
import 'package:share/share.dart';
import 'package:share_plus/share_plus.dart';
import 'package:shared_preferences/shared_preferences.dart';

Future main() async {
Expand Down Expand Up @@ -277,6 +277,7 @@ class _HomeScreenState extends State<HomeScreen> with WidgetsBindingObserver {
webViewController!.setOptions(options: getInAppWebViewGroupOptions());
webViewController!.loadUrl(
urlRequest: URLRequest(url: Uri.parse(value.toString())));
removeElements(webViewController);
}
}, onError: (err) {
print("getLinkStream error: $err");
Expand Down Expand Up @@ -807,11 +808,11 @@ class _HomeScreenState extends State<HomeScreen> with WidgetsBindingObserver {
webViewController?.loadUrl(
urlRequest: URLRequest(url: address));
}
//removeElements(controller);
removeElements(controller);
},
onLoadStop: (controller, url) async {
setState(() {
// removeElements(controller);
removeElements(controller);
});
},
onLoadStart: (controller, url) {
Expand Down Expand Up @@ -865,7 +866,7 @@ class _HomeScreenState extends State<HomeScreen> with WidgetsBindingObserver {
controller.clearCache();
}
}*/
if (progress == 30) {
if (progress >= 80 && progress <= 95) {
if (webViewController != null) {
removeElements(controller);
controller.clearCache();
Expand Down
46 changes: 44 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ packages:
name: flutter_launcher_icons
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.2"
version: "0.9.3"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -254,6 +254,48 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
share_plus:
dependency: "direct main"
description:
name: share_plus
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.7"
share_plus_linux:
dependency: transitive
description:
name: share_plus_linux
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
share_plus_macos:
dependency: transitive
description:
name: share_plus_macos
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
share_plus_platform_interface:
dependency: transitive
description:
name: share_plus_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.3"
share_plus_web:
dependency: transitive
description:
name: share_plus_web
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
share_plus_windows:
dependency: transitive
description:
name: share_plus_windows
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
shared_preferences:
dependency: "direct main"
description:
Expand Down Expand Up @@ -370,7 +412,7 @@ packages:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.2"
version: "6.1.3"
url_launcher_android:
dependency: transitive
description:
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# 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
version: 1.2.1+1
version: 1.2.2+1

environment:
sdk: ">=2.12.0 <3.0.0"
Expand All @@ -32,6 +32,7 @@ dependencies:
share: ^2.0.4
shared_preferences: ^2.0.8
restart_app: ^1.1.0
share_plus: ^4.0.7

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit d7fc24e

Please sign in to comment.