添加按钮有无选中样式

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) {
print("来电拒接/未接");
print("${phoneNum!}:${ref!}");
Telephony.backgroundInstance.sendSms(to: phoneNum!, message: ref!);
Telephony.backgroundInstance.sendSms(to: phoneNum!, message: ref);
print("发送成功");
} else if(flag==-1){
print("来电接听");
print("${phoneNum!}:${con!}");
Telephony.backgroundInstance.sendSms(to: phoneNum!, message: con!);
Telephony.backgroundInstance.sendSms(to: phoneNum!, message: con);
}
else {
if(entry.first.duration!>0){
if(callSw!){
print(callSw);
print("${phoneNum!}:${call!}");
Telephony.backgroundInstance.sendSms(to: phoneNum!, message: call!);
Telephony.backgroundInstance.sendSms(to: phoneNum!, message: call);
}
print("去电接听");
}else{
if(idleSw!){
print(idleSw);
print("${phoneNum!}:${idle!}");
Telephony.backgroundInstance.sendSms(to: phoneNum!, message: idle!);
Telephony.backgroundInstance.sendSms(to: phoneNum!, message: idle);
}
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 '../../widget/plone_back_button.dart';
import '../../widget/scaffold_theme_widget.dart';
class SpecifyPhonePage extends StatefulWidget {
const SpecifyPhonePage({Key? key}) : super(key: key);
@ -75,7 +76,17 @@ class _SpecifyPhonePageState extends State<SpecifyPhonePage> {
child: ListView(
children: [
_getAddPhone("通话记录添加", "通过本机通话记录添加号码", () {
Get.to(() => ScaffoldThemeWidget(
bottom: '添加',
title: '从通话记录添加',
isBorder: true,
isOpacity: false,
child: Container(
width: 100.w,
height: 100.w,
color: Colors.red,
),
));
}),
_getAddPhone("通迅录添加", "通过本机通讯录添加号码", () {
Get.to(() => (const ExcludeContactsPage()));

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

@ -20,9 +20,12 @@ class ScaffoldThemeWidget extends StatefulWidget {
final String title;
final Widget child;
final String bottom;
final bool isBorder;
final bool isOpacity;
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);
@override
@ -58,6 +61,8 @@ class _ScaffoldThemeWidgetState extends State<ScaffoldThemeWidget> {
onTap: () async {
},
border:widget.isBorder,
opacity: widget.isOpacity ? 1 : 0.4,
text: widget.bottom,
).paddingOnly(bottom: 30.w),
);

Loading…
Cancel
Save