添加按钮有无选中样式

master
王亚玲 2 years ago
parent 30755b1742
commit e0bade4ec2

@ -0,0 +1,19 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:equatable/equatable.dart';
part 'phone_num_model.g.dart';
@JsonSerializable()
class PhoneNumModel extends Equatable{
final String num;
final int time;
factory PhoneNumModel.fromJson(Map<String, dynamic> json) =>_$PhoneNumModelFromJson(json);
const PhoneNumModel({
required this.num,
required this.time,
});
@override
List<Object?> get props => [num,time,];
}

@ -0,0 +1,13 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'phone_num_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
PhoneNumModel _$PhoneNumModelFromJson(Map<String, dynamic> json) =>
PhoneNumModel(
num: json['num'] as String,
time: json['time'] as int,
);

@ -76,26 +76,26 @@ void onStart(ServiceInstance service) async {
if (flag > 0) { if (flag > 0) {
print("来电拒接/未接"); print("来电拒接/未接");
print("${phoneNum!}:${ref!}"); print("${phoneNum!}:${ref!}");
Telephony.backgroundInstance.sendSms(to: phoneNum!, message: ref!); Telephony.backgroundInstance.sendSms(to: phoneNum!, message: ref);
print("发送成功"); print("发送成功");
} else if(flag==-1){ } else if(flag==-1){
print("来电接听"); print("来电接听");
print("${phoneNum!}:${con!}"); print("${phoneNum!}:${con!}");
Telephony.backgroundInstance.sendSms(to: phoneNum!, message: con!); Telephony.backgroundInstance.sendSms(to: phoneNum!, message: con);
} }
else { else {
if(entry.first.duration!>0){ if(entry.first.duration!>0){
if(callSw!){ if(callSw!){
print(callSw); print(callSw);
print("${phoneNum!}:${call!}"); print("${phoneNum!}:${call!}");
Telephony.backgroundInstance.sendSms(to: phoneNum!, message: call!); Telephony.backgroundInstance.sendSms(to: phoneNum!, message: call);
} }
print("去电接听"); print("去电接听");
}else{ }else{
if(idleSw!){ if(idleSw!){
print(idleSw); print(idleSw);
print("${phoneNum!}:${idle!}"); print("${phoneNum!}:${idle!}");
Telephony.backgroundInstance.sendSms(to: phoneNum!, message: idle!); Telephony.backgroundInstance.sendSms(to: phoneNum!, message: idle);
} }
print("去电未接"); print("去电未接");
} }

@ -0,0 +1,26 @@
import 'package:flutter/material.dart';
import '../../../../model/phone_num_model.dart';
class CallRecordsList extends StatefulWidget {
const CallRecordsList({Key? key}) : super(key: key);
@override
_CallRecordsListState createState() => _CallRecordsListState();
}
class _CallRecordsListState extends State<CallRecordsList> {
List<PhoneNumModel> phoneNum=[];
@override
Widget build(BuildContext context) {
return Container();
}
// _getPhone(){
// return ListView.builder(itemBuilder: (context,index){},itemCount: ,);
// }
}

@ -8,6 +8,7 @@ import 'package:project_telephony/ui/widget/plone_bottom.dart';
import '../../../base/base_style.dart'; import '../../../base/base_style.dart';
import '../../widget/plone_back_button.dart'; import '../../widget/plone_back_button.dart';
import '../../widget/scaffold_theme_widget.dart';
class SpecifyPhonePage extends StatefulWidget { class SpecifyPhonePage extends StatefulWidget {
const SpecifyPhonePage({Key? key}) : super(key: key); const SpecifyPhonePage({Key? key}) : super(key: key);
@ -75,10 +76,20 @@ class _SpecifyPhonePageState extends State<SpecifyPhonePage> {
child: ListView( child: ListView(
children: [ children: [
_getAddPhone("通话记录添加", "通过本机通话记录添加号码", () { _getAddPhone("通话记录添加", "通过本机通话记录添加号码", () {
Get.to(() => ScaffoldThemeWidget(
bottom: '添加',
title: '从通话记录添加',
isBorder: true,
isOpacity: false,
child: Container(
width: 100.w,
height: 100.w,
color: Colors.red,
),
));
}), }),
_getAddPhone("通迅录添加", "通过本机通讯录添加号码", () { _getAddPhone("通迅录添加", "通过本机通讯录添加号码", () {
Get.to(()=>(const ExcludeContactsPage())); Get.to(() => (const ExcludeContactsPage()));
}), }),
_getAddPhone( _getAddPhone(
"添加单个或批量号码", "通过输入号码段添加批量号码", () {}), "添加单个或批量号码", "通过输入号码段添加批量号码", () {}),

@ -1,13 +1,13 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:project_telephony/utils/headers.dart'; import 'package:project_telephony/utils/headers.dart';
import 'package:project_telephony/utils/user_tool.dart'; import 'package:project_telephony/utils/user_tool.dart';
import 'package:provider/provider.dart';
import '../../base/base_style.dart'; import '../../base/base_style.dart';
import '../../constants/api.dart'; import '../../constants/api.dart';
import '../../model/network/api_client.dart'; import '../../model/network/api_client.dart';
import '../../model/network/base_model.dart'; import '../../model/network/base_model.dart';
import '../../providers/user_provider.dart';
import '../../utils/toast/cloud_toast.dart'; import '../../utils/toast/cloud_toast.dart';
import '../widget/plone_back_button.dart'; import '../widget/plone_back_button.dart';
import '../widget/plone_bottom.dart'; import '../widget/plone_bottom.dart';

@ -20,9 +20,12 @@ class ScaffoldThemeWidget extends StatefulWidget {
final String title; final String title;
final Widget child; final Widget child;
final String bottom; final String bottom;
final bool isBorder;
final bool isOpacity;
const ScaffoldThemeWidget( const ScaffoldThemeWidget(
{Key? key, required this.title, required this.child, required this.bottom}) {Key? key, required this.title, required this.child, required this.bottom, this.isBorder = false, this.isOpacity = true
})
: super(key: key); : super(key: key);
@override @override
@ -58,6 +61,8 @@ class _ScaffoldThemeWidgetState extends State<ScaffoldThemeWidget> {
onTap: () async { onTap: () async {
}, },
border:widget.isBorder,
opacity: widget.isOpacity ? 1 : 0.4,
text: widget.bottom, text: widget.bottom,
).paddingOnly(bottom: 30.w), ).paddingOnly(bottom: 30.w),
); );

Loading…
Cancel
Save