Browse Source

image

null_safety
fmk 4 years ago
parent
commit
a68b83e1e7
  1. 1
      android/app/build.gradle
  2. 32
      android/app/proguard-android.txt
  3. 2
      android/build.gradle
  4. 32
      lib/home/guide_page.dart
  5. 48
      lib/login/login_page.dart
  6. 2
      lib/main.dart
  7. 8
      pubspec.lock

1
android/app/build.gradle

@ -32,6 +32,7 @@ apply plugin: 'com.huawei.agconnect'
MobSDK {
appKey "m33ee7650da86a"
appSecret "876f2eaebfd2a88c89d5fc294397838c"
spEdition "fp"
ShareSDK {

32
android/app/proguard-android.txt

@ -0,0 +1,32 @@
# Build the ephemeral app in a module project.
# Prevents: Warning: library class <plugin-package> depends on program class io.flutter.plugin.**
# This is due to plugins (libraries) depending on the embedding (the program jar)
-dontwarn io.flutter.plugin.**
# The android.** package is provided by the OS at runtime.
-dontwarn android.**
-keep class cn.sharesdk.**{*;}
-keep class com.sina.**{*;}
-keep class com.mob.**{*;}
-keep class com.bytedance.**{*;}
-dontwarn cn.sharesdk.**
-dontwarn com.sina.**
-dontwarn com.mob.**
#andResGuard {
# whiteList = [
# "R.layout.mob_authorize_*",
# "R.drawable.mobcommon_authorize_*",
# "R.drawable.ssdk_*",
# "R.drawable.ssdk_oks_*",
# "R.string.ssdk_oks_*",
# "R.string.ssdk_*",
# "R.style.mobcommon_*",
# "R.ssdk_strings.*",
# "R.string.mobdemo_authorize_*",
# ]
#}

2
android/build.gradle

@ -44,7 +44,7 @@ allprojects {
url "http://mvn.mob.com/android"
}
maven { url "https://www.jitpack.io" }
maven {url 'https://developer.huawei.com/repo/'}
maven { url 'https://developer.huawei.com/repo/'}
}
}

32
lib/home/guide_page.dart

@ -51,14 +51,15 @@ class _GuidePage extends State<GuidePage> {
SizedBox(
height: 66.h,
),
Padding(
padding: EdgeInsets.only(left: 37.w, right: 37.w),
Container(
alignment: Alignment.center,
child: Text(
S.of(context).yindaoye1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 24.sp,
fontWeight: FontWeight.bold,
color: Color(0XFF32A060)),
fontSize: 24.sp,
fontWeight: FontWeight.bold,
color: Color(0XFF32A060),),
),
),
SizedBox(
@ -73,7 +74,7 @@ class _GuidePage extends State<GuidePage> {
fontSize: 16.sp,
height: 1.5.h,
fontWeight: FontWeight.w500,
color: Color(0XFF727272)),
color: Color(0XFF727272),),
),
),
],
@ -135,14 +136,15 @@ class _GuidePage extends State<GuidePage> {
SizedBox(
height: 66.h,
),
Padding(
padding: EdgeInsets.only(left: 37.w, right: 37.w),
Container(
alignment: Alignment.center,
child: Text(
S.of(context).yindaoye2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 24.sp,
fontWeight: FontWeight.bold,
color: Color(0XFF32A060)),
color: Color(0XFF32A060),),
),
),
SizedBox(
@ -220,14 +222,15 @@ class _GuidePage extends State<GuidePage> {
SizedBox(
height: 66,
),
Padding(
padding: EdgeInsets.only(left: 37.w, right: 37.w),
Container(
alignment: Alignment.center,
child: Text(
S.of(context).yindaoye3,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 24.sp,
fontWeight: FontWeight.bold,
color: Color(0XFF32A060)),
color: Color(0XFF32A060),),
),
),
SizedBox(
@ -302,10 +305,11 @@ class _GuidePage extends State<GuidePage> {
SizedBox(
height: 66.h,
),
Padding(
padding: EdgeInsets.only(left: 104.w, right: 104.w),
Container(
alignment: Alignment.center,
child: Text(
S.of(context).yindaoye4,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 24.sp,
fontWeight: FontWeight.bold,

48
lib/login/login_page.dart

@ -58,7 +58,8 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
isLogin() async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
if (sharedPreferences.getBool("isShowPrivacyPolicy") == null || !sharedPreferences.getBool("isShowPrivacyPolicy")) {
if (sharedPreferences.getBool("isShowPrivacyPolicy") == null ||
!sharedPreferences.getBool("isShowPrivacyPolicy")) {
showAlertDialog();
}
@ -160,12 +161,14 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
_sendCode() async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
if (!sharedPreferences.containsKey("isShowPrivacyPolicy") || !sharedPreferences.getBool("isShowPrivacyPolicy")) {
if (!sharedPreferences.containsKey("isShowPrivacyPolicy") ||
!sharedPreferences.getBool("isShowPrivacyPolicy")) {
showAlertDialog();
return;
}
if (!checkStatus) {
SmartDialog.showToast(S.of(context).gouxuanxieyi, alignment: Alignment.center);
SmartDialog.showToast(S.of(context).gouxuanxieyi,
alignment: Alignment.center);
return;
}
var mobile = _controllerPhone.text;
@ -185,7 +188,8 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
{
btnText = S.of(context).send_code,
_sendCodeStatus = 0,
SmartDialog.showToast("${value.msg}", alignment: Alignment.center),
SmartDialog.showToast("${value.msg}",
alignment: Alignment.center),
refresh()
}
})
@ -230,12 +234,14 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
return;
}
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
if (!sharedPreferences.containsKey("isShowPrivacyPolicy") || !sharedPreferences.getBool("isShowPrivacyPolicy")) {
if (!sharedPreferences.containsKey("isShowPrivacyPolicy") ||
!sharedPreferences.getBool("isShowPrivacyPolicy")) {
showAlertDialog();
return;
}
if (!checkStatus) {
SmartDialog.showToast(S.of(context).gouxuanxieyi, alignment: Alignment.center);
SmartDialog.showToast(S.of(context).gouxuanxieyi,
alignment: Alignment.center);
return;
}
var mobile = _controllerPhone.text;
@ -932,9 +938,10 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
child: Text(
S.of(context).xieyitanchuang,
style: TextStyle(
color: Color(0xff4D4D4D),
fontSize: 18.sp,
fontWeight: FontWeight.bold,),
color: Color(0xff4D4D4D),
fontSize: 18.sp,
fontWeight: FontWeight.bold,
),
),
),
Text.rich(
@ -955,7 +962,8 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
color: Color(0xff32A060)),
recognizer: TapGestureRecognizer()
..onTap = () {
Navigator.of(context).popAndPushNamed('/router/treaty_page');
Navigator.of(context)
.popAndPushNamed('/router/treaty_page');
},
),
]),
@ -984,6 +992,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
GestureDetector(
onTap: () {
Navigator.of(context).pop();
// Navigator.of(context).pop();
},
child: Container(
height: 40.h,
@ -1011,22 +1020,23 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
child: RoundButton(
text: S.of(context).tongyibingjixu,
textColor: Colors.white,
fontSize: 12,
fontSize: 12.sp,
callback: () {
SharedPreferences.getInstance().then((value) {
value.setBool("isShowPrivacyPolicy", true);
});
SharesdkPlugin.uploadPrivacyPermissionStatus(
1,
(success) => {
Navigator.of(context).pop(),
});
1, (success) => {
Navigator.of(context).pop(),
},
);
},
padding: EdgeInsets.only(
top: 10.h,
bottom: 10.h,
left: 21.5.w,
right: 21.5.w),
top: 10.h,
bottom: 10.h,
left: 21.5.w,
right: 21.5.w,
),
backgroup: Color(0xff32A060),
radius: 23,
),

2
lib/main.dart

@ -72,6 +72,8 @@ void main() async {
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
]);
// ignore: invalid_use_of_visible_for_testing_member
SharedPreferences.setMockInitialValues({});
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
Locale locale;
if (sharedPreferences.containsKey("language") &&

8
pubspec.lock

@ -56,7 +56,7 @@ packages:
name: async
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.5.0"
version: "2.6.1"
barcode:
dependency: transitive
description:
@ -879,7 +879,7 @@ packages:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.19"
version: "0.3.0"
timing:
dependency: transitive
description:
@ -1042,7 +1042,7 @@ packages:
name: win32
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.5"
version: "2.2.5"
xdg_directories:
dependency: transitive
description:
@ -1065,5 +1065,5 @@ packages:
source: hosted
version: "3.1.0"
sdks:
dart: ">=2.12.0 <3.0.0"
dart: ">=2.13.0 <3.0.0"
flutter: ">=2.0.0"

Loading…
Cancel
Save