王亚玲 2 years ago
parent 14e44092d8
commit 8fd5a9614a

@ -58,6 +58,11 @@ android {
// signingConfig signingConfigs.release
// }
}
lintOptions {
disable 'InvalidPackage'
checkReleaseBuilds false
abortOnError false
}
}
flutter {

@ -30,9 +30,9 @@
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
<uses-permission android:name="android.permission.INTERNET"/>
</application>
<!-- <uses-permission android:name="android.permission.INTERNET"/>-->
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.READ_SMS"/>
<uses-permission android:name="android.permission.RECEIVE_SMS"/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 544 B

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 721 B

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -35,6 +35,9 @@ class $AssetsIconsGen {
/// File path: assets/icons/privacy.png
AssetGenImage get privacy => const AssetGenImage('assets/icons/privacy.png');
/// File path: assets/icons/sms.png
AssetGenImage get sms => const AssetGenImage('assets/icons/sms.png');
/// File path: assets/icons/switch1.png
AssetGenImage get switch1 => const AssetGenImage('assets/icons/switch1.png');

@ -0,0 +1,18 @@
/// GENERATED CODE - DO NOT MODIFY BY HAND
/// *****************************************************
/// FlutterGen
/// *****************************************************
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: directives_ordering,unnecessary_import
class FontFamily {
FontFamily._();
/// Font family: BlackItalic
static const String blackItalic = 'BlackItalic';
/// Font family: SemiBold
static const String semiBold = 'SemiBold';
}

@ -105,6 +105,7 @@ class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
// PowerLogger.start(context, debug: true);
final service = FlutterBackgroundService();
// JPush jPush=JPush();
// jPush.setup(

@ -1,10 +1,18 @@
// import 'dart:async';
// import android.app.PendingIntent;
// import android.telephony.SmsManager;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:project_telephony/base/base_style.dart';
import 'package:project_telephony/ui/home/content_details_page.dart';
import 'package:project_telephony/ui/widget/centertipsalterwidget.dart';
import 'package:project_telephony/ui/widget/plone_back_button.dart';
import 'package:project_telephony/utils/headers.dart';
import 'package:telephony/telephony.dart';
import '../user/privacy_rights_page.dart';
class ContentPage extends StatefulWidget {
final bool? isAnswer; //truefalse
@ -15,6 +23,17 @@ class ContentPage extends StatefulWidget {
}
class _ContentPageState extends State<ContentPage> {
// static const platform=const MethodChannel("sendSms");
// Future<Null> sendSms( String text) async{
// print("sendSMS");
// try{
// final String result=await platform.invokeMethod('send',<String,dynamic> {"phone":"+8613486828191","msg":text});
// print(result);
// } on PlatformException catch(e){
// print(e.toString());
// }
// }
// SmsManager smsManager = SmsManager.getDefault();
int _select = 0;
List<String> textList = ['欢迎你的来电', '祝您生活愉快', '感谢您的来电我们会尽快处理的', '自定义短信内容'];
List<String> textList1 = ['自定义短信内容'];
@ -60,7 +79,26 @@ class _ContentPageState extends State<ContentPage> {
textList.setAll(index, {textContent});
},
));
} else {}
} else {
bool? permissionsGranted = await telephony.requestPhonePermissions;
// print(permissionsGranted);
// if(permissionsGranted!){
// print(content);
// // sendSms(content);
// telephony.sendSms(
// to: "13395740386",
// message: content,
// );
// }else{
// print(content);
// }
print(content);
// sendSms(content);
telephony.sendSms(
to: "13486828191",
message: content,
);
}
setState(() {});
// print("这是数据" + textList[_s lect]);

@ -15,6 +15,7 @@ class PrivacyRightsPage extends StatefulWidget {
}
final Telephony telephony = Telephony.instance;
// late final bool permissionsGranted;
// String body = "";
// @override
@ -90,11 +91,11 @@ class _PrivacyRightsPageState extends State<PrivacyRightsPage> {
// }
_getRights(bool pd) {
return ListView(
children: Permission.values
children: Permission.values
.where((permission) {
return permission == Permission.phone ||
permission == Permission.sms;
})
return permission == Permission.phone ||
permission == Permission.sms;
})
.map((permission) => PermissionWidget(permission))
.toList());
}
@ -165,11 +166,11 @@ class _PermissionState extends State<PermissionWidget> {
Widget build(BuildContext context) {
return ListTile(
title: Text(
_permission.value==8?title[0]:title[1],
_permission.value == 8 ? title[0] : title[1],
style: Theme.of(context).textTheme.titleMedium,
),
subtitle: Text(
_permission.value==8?sub[0]:sub[1],
_permission.value == 8 ? sub[0] : sub[1],
),
trailing: Wrap(
children: [
@ -201,4 +202,4 @@ class _PermissionState extends State<PermissionWidget> {
print(_permissionStatus);
});
}
}
}

@ -30,11 +30,11 @@ final Telephony telephony = Telephony.instance;
class _UserPageState extends State<UserPage> {
bool vle = false;
bool tooken = true;
bool tooken = false;
@override
void initState() {
super.initState();
PowerLogger.start(context, debug: true);
}
@override
@ -55,8 +55,10 @@ class _UserPageState extends State<UserPage> {
_getSwitch(Assets.icons.switch1.path, "功能开关", true),
_getSwitch(Assets.icons.privacy.path, "隐私政策", false),
_getSwitch(Assets.icons.permissions.path, "权限说明", false),
_getSwitch(Assets.icons.sms.path, "短信标签", false),
// const Spacer(),
182.hb,
tooken?
PloneBottom(
border: false,
onTap: () {
@ -66,7 +68,7 @@ class _UserPageState extends State<UserPage> {
color1: const Color(0xFFEBF5FF),
color2: const Color(0xFFEBF5FF),
text: "退出登录",
)
):const SizedBox(),
]),
);
}

@ -96,7 +96,7 @@ dev_dependencies:
pub_semver: ^2.1.0
flutter_gen_runner: ^4.1.3
flutter_lints: ^2.0.0
# patgh: ^1.8.1
# patgh: ^1.8.1
#脚本工具
grinder: ^0.9.1
flutter_native_splash: ^1.1.8+4

@ -37,10 +37,15 @@ buildApkDev() async {
'BUILD_TYPE=Dev',
],
);
String date = DateUtil.formatDate(DateTime.now(), format: 'yy_MM_dd_HH_mm');
String version = await getVersion();
await runAsync('rm', arguments: ['-rf', Config.apkDevDir]);
await runAsync('mkdir', arguments: ['-p', Config.apkDevDir]);
await runAsync('mv', arguments: [
Config.buildPath,
'${Config.apkDevDir}/${Config.packageName}_${version}_beta_$date.apk'

Loading…
Cancel
Save