任务发布修改 播放语音组件

pull/1/head
张萌 3 years ago
parent c24905ea5f
commit b5bcee3842

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 841 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 B

File diff suppressed because it is too large Load Diff

@ -5,8 +5,10 @@
// ignore_for_file: directives_ordering
// ignore_for_file: lines_longer_than_80_chars
import 'package:audio_session/audio_session_web.dart';
import 'package:device_info_plus_web/device_info_plus_web.dart';
import 'package:image_picker_for_web/image_picker_for_web.dart';
import 'package:just_audio_web/just_audio_web.dart';
import 'package:package_info_plus_web/package_info_plus_web.dart';
import 'package:url_launcher_web/url_launcher_web.dart';
@ -14,8 +16,10 @@ import 'package:flutter_web_plugins/flutter_web_plugins.dart';
// ignore: public_member_api_docs
void registerPlugins(Registrar registrar) {
AudioSessionWeb.registerWith(registrar);
DeviceInfoPlusPlugin.registerWith(registrar);
ImagePickerPlugin.registerWith(registrar);
JustAudioPlugin.registerWith(registrar);
PackageInfoPlugin.registerWith(registrar);
UrlLauncherPlugin.registerWith(registrar);
registrar.registerMessageHandler();

@ -1,3 +1,4 @@
import 'package:aku_new_community/model/common/img_model.dart';
import 'package:json_annotation/json_annotation.dart';
part 'hall_list_model.g.dart';
@ -5,36 +6,40 @@ part 'hall_list_model.g.dart';
@JsonSerializable()
class HallListModel {
final int id;
final String title;
final String code;
final int status;
final String updateDate;
final int type;
final int sex;
final int serviceObject;
final String content;
final String appointmentDate;
final String appointmentAddress;
final String readyStartTime;
final String readyEndTime;
final String? accessAddress;
final String? accessAddressDetail;
final int? serviceTime;
final String remarks;
final String voiceUrl;
final List<ImgModel>? imgList;
final int rewardType;
final int reward;
final int createType;
final String? createName;
final String createDate;
factory HallListModel.fromJson(Map<String, dynamic> json) =>
_$HallListModelFromJson(json);
const HallListModel({
required this.id,
required this.title,
required this.code,
required this.status,
required this.updateDate,
required this.type,
required this.sex,
required this.serviceObject,
required this.content,
required this.appointmentDate,
required this.appointmentAddress,
required this.readyStartTime,
required this.readyEndTime,
this.accessAddress,
this.accessAddressDetail,
this.serviceTime,
required this.remarks,
required this.voiceUrl,
this.imgList,
required this.rewardType,
required this.reward,
required this.createType,
this.createName,
required this.createDate,
});
}

@ -9,17 +9,21 @@ part of 'hall_list_model.dart';
HallListModel _$HallListModelFromJson(Map<String, dynamic> json) =>
HallListModel(
id: json['id'] as int,
title: json['title'] as String,
code: json['code'] as String,
status: json['status'] as int,
updateDate: json['updateDate'] as String,
type: json['type'] as int,
sex: json['sex'] as int,
serviceObject: json['serviceObject'] as int,
content: json['content'] as String,
appointmentDate: json['appointmentDate'] as String,
appointmentAddress: json['appointmentAddress'] as String,
readyStartTime: json['readyStartTime'] as String,
readyEndTime: json['readyEndTime'] as String,
accessAddress: json['accessAddress'] as String?,
accessAddressDetail: json['accessAddressDetail'] as String?,
serviceTime: json['serviceTime'] as int?,
remarks: json['remarks'] as String,
voiceUrl: json['voiceUrl'] as String,
imgList: (json['imgList'] as List<dynamic>?)
?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),
rewardType: json['rewardType'] as int,
reward: json['reward'] as int,
createType: json['createType'] as int,
createName: json['createName'] as String?,
createDate: json['createDate'] as String,
);

@ -1,3 +1,4 @@
import 'package:aku_new_community/model/common/img_model.dart';
import 'package:json_annotation/json_annotation.dart';
part 'my_take_task_list_model.g.dart';
@ -5,37 +6,41 @@ part 'my_take_task_list_model.g.dart';
@JsonSerializable()
class MyTakeTaskListModel {
final int id;
final String title;
final String code;
final int status;
final String updateDate;
final int type;
final int sex;
final int serviceObject;
final String content;
final String appointmentDate;
final String appointmentAddress;
final String readyStartTime;
final String readyEndTime;
final String? accessAddress;
final String? accessAddressDetail;
final int? serviceTime;
final String remarks;
final String voiceUrl;
final List<ImgModel>? imgList;
final int rewardType;
final int reward;
final int createType;
final String? createName;
final String createDate;
factory MyTakeTaskListModel.fromJson(Map<String, dynamic> json) =>
_$MyTakeTaskListModelFromJson(json);
const MyTakeTaskListModel({
required this.id,
required this.title,
required this.code,
required this.status,
required this.updateDate,
required this.type,
required this.sex,
required this.serviceObject,
required this.content,
required this.appointmentDate,
required this.appointmentAddress,
required this.readyStartTime,
required this.readyEndTime,
this.accessAddress,
this.accessAddressDetail,
this.serviceTime,
required this.remarks,
required this.voiceUrl,
this.imgList,
required this.rewardType,
required this.reward,
required this.createType,
this.createName,
required this.createDate,
});
}

@ -9,17 +9,21 @@ part of 'my_take_task_list_model.dart';
MyTakeTaskListModel _$MyTakeTaskListModelFromJson(Map<String, dynamic> json) =>
MyTakeTaskListModel(
id: json['id'] as int,
title: json['title'] as String,
code: json['code'] as String,
status: json['status'] as int,
updateDate: json['updateDate'] as String,
type: json['type'] as int,
sex: json['sex'] as int,
serviceObject: json['serviceObject'] as int,
content: json['content'] as String,
appointmentDate: json['appointmentDate'] as String,
appointmentAddress: json['appointmentAddress'] as String,
readyStartTime: json['readyStartTime'] as String,
readyEndTime: json['readyEndTime'] as String,
accessAddress: json['accessAddress'] as String?,
accessAddressDetail: json['accessAddressDetail'] as String?,
serviceTime: json['serviceTime'] as int?,
remarks: json['remarks'] as String,
voiceUrl: json['voiceUrl'] as String,
imgList: (json['imgList'] as List<dynamic>?)
?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),
rewardType: json['rewardType'] as int,
reward: json['reward'] as int,
createType: json['createType'] as int,
createName: json['createName'] as String?,
createDate: json['createDate'] as String,
);

@ -1,3 +1,4 @@
import 'package:aku_new_community/model/common/img_model.dart';
import 'package:json_annotation/json_annotation.dart';
part 'my_task_list_model.g.dart';
@ -5,36 +6,40 @@ part 'my_task_list_model.g.dart';
@JsonSerializable()
class MyTaskListModel {
final int id;
final String title;
final String code;
final int status;
final String updateDate;
final int type;
final int sex;
final int serviceObject;
final String content;
final String appointmentDate;
final String appointmentAddress;
final String readyStartTime;
final String readyEndTime;
final String? accessAddress;
final String? accessAddressDetail;
final int? serviceTime;
final String remarks;
final String voiceUrl;
final List<ImgModel>? imgList;
final int rewardType;
final int reward;
final int createType;
final String? createName;
final String createDate;
factory MyTaskListModel.fromJson(Map<String, dynamic> json) =>
_$MyTaskListModelFromJson(json);
const MyTaskListModel({
required this.id,
required this.title,
required this.code,
required this.status,
required this.updateDate,
required this.type,
required this.sex,
required this.serviceObject,
required this.content,
required this.appointmentDate,
required this.appointmentAddress,
required this.readyStartTime,
required this.readyEndTime,
this.accessAddress,
this.accessAddressDetail,
this.serviceTime,
required this.remarks,
required this.voiceUrl,
this.imgList,
required this.rewardType,
required this.reward,
required this.createType,
this.createName,
required this.createDate,
});
}

@ -9,17 +9,21 @@ part of 'my_task_list_model.dart';
MyTaskListModel _$MyTaskListModelFromJson(Map<String, dynamic> json) =>
MyTaskListModel(
id: json['id'] as int,
title: json['title'] as String,
code: json['code'] as String,
status: json['status'] as int,
updateDate: json['updateDate'] as String,
type: json['type'] as int,
sex: json['sex'] as int,
serviceObject: json['serviceObject'] as int,
content: json['content'] as String,
appointmentDate: json['appointmentDate'] as String,
appointmentAddress: json['appointmentAddress'] as String,
readyStartTime: json['readyStartTime'] as String,
readyEndTime: json['readyEndTime'] as String,
accessAddress: json['accessAddress'] as String?,
accessAddressDetail: json['accessAddressDetail'] as String?,
serviceTime: json['serviceTime'] as int?,
remarks: json['remarks'] as String,
voiceUrl: json['voiceUrl'] as String,
imgList: (json['imgList'] as List<dynamic>?)
?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),
rewardType: json['rewardType'] as int,
reward: json['reward'] as int,
createType: json['createType'] as int,
createName: json['createName'] as String?,
createDate: json['createDate'] as String,
);

@ -87,7 +87,11 @@ class _HomePageState extends State<HomePage>
_refreshController = EasyRefreshController();
_swiperController.addListener(() {
//onChangeIndex_currentSwiperIndexindex1+1index;
_swiperBarColor((_currentSwiperIndex + 1) % 3);
if (_swiperModels.length <= 1) {
_swiperBarColor(0);
} else {
_swiperBarColor((_currentSwiperIndex + 1) % 3);
}
});
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(statusBarColor: Colors.transparent));

@ -1,15 +1,18 @@
import 'package:flutter/material.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/models/task/hall_list_model.dart';
import 'package:aku_new_community/ui/service/hall/hall_detail_page.dart';
import 'package:aku_new_community/ui/service/task_map.dart';
import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/buttons/card_bottom_button.dart';
import 'package:aku_new_community/widget/views/bee_grid_image_view.dart';
import 'package:aku_new_community/widget/voice_player.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
import '../task_func.dart';
class HallCard extends StatelessWidget {
@ -27,10 +30,7 @@ class HallCard extends StatelessWidget {
width: 100.w,
height: 50.w,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFFFF7E6),
borderRadius: BorderRadius.circular(8.w),
),
color: Color(0xFFFFF7E6),
child: '#${TaskMap.typeToString[model.type]}'
.text
.size(28.sp)
@ -43,6 +43,28 @@ class HallCard extends StatelessWidget {
'${model.reward}'.text.size(32.sp).color(Colors.red).make()
],
);
var appointment = Row(
children: [
Container(
width: 40.w,
height: 40.w,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFFA8C16),
borderRadius: BorderRadius.circular(8.w)),
child: Text(
'',
style: TextStyle(color: Colors.white, fontSize: 24.sp),
),
),
24.w.widthBox,
'${DateUtil.formatDateStr(model.readyEndTime, format: 'MM月dd日 HH:mm')}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
],
);
return GestureDetector(
onTap: () {
Get.to(() => HallDetailPage(model: model));
@ -57,24 +79,31 @@ class HallCard extends StatelessWidget {
child: Column(
children: [
head,
34.w.heightBox,
24.w.heightBox,
BeeDivider.horizontal(),
24.w.heightBox,
appointment,
20.w.heightBox,
Row(
children: [
Assets.icons.clockCircle.image(width: 36.w, height: 36.w),
Assets.icons.watch.image(width: 40.w, height: 40.w),
24.w.widthBox,
'${DateUtil.formatDateStr(model.appointmentDate)}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
'${model.serviceTime ?? '0'}'
.richText
.withTextSpanChildren([
' 分钟'.textSpan.size(28.sp).color(Colors.black).make(),
])
.size(28.sp)
.color(Color(0xFFFA8C16))
.make(),
],
),
20.w.heightBox,
24.w.heightBox,
Row(
children: [
Assets.icons.environment.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${model.appointmentAddress}'
'${model.accessAddress}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
@ -91,20 +120,22 @@ class HallCard extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'#${TaskMap.typeToString[model.type]}'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
16.w.heightBox,
model.content.text
model.remarks.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
24.w.heightBox,
VoicePlayer(
url: model.voiceUrl,
),
24.w.heightBox,
BeeGridImageView(
urls: model.imgList?.map((e) => e.url).toList() ?? []),
],
),
),
40.w.heightBox,
24.w.heightBox,
BeeDivider.horizontal(),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [

@ -1,14 +1,12 @@
import 'package:flutter/material.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/models/task/hall_list_model.dart';
import 'package:aku_new_community/ui/service/task_map.dart';
import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class HallDetailPage extends StatefulWidget {
final HallListModel model;
@ -71,28 +69,6 @@ class _HallDetailPageState extends State<HallDetailPage> {
),
),
Spacer(),
// Padding(
// padding: EdgeInsets.only(right: 32.w),
// child: MaterialButton(
// color: Colors.white,
// elevation: 0,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(8.w),
// ),
// onPressed: () async {
// var re = await TaskFunc.cancel(
// taskId: widget.model.id);
// if (re) {
// Get.back();
// }
// },
// child: '取消订单'
// .text
// .size(24.sp)
// .color(Colors.black.withOpacity(0.65))
// .make(),
// ),
// )
],
),
],
@ -150,7 +126,7 @@ class _HallDetailPageState extends State<HallDetailPage> {
.color(Colors.black.withOpacity(0.45))
.make(),
Spacer(),
'${DateUtil.formatDateStr(widget.model.createDate)}'
'${DateUtil.formatDateStr(widget.model.updateDate)}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
@ -201,7 +177,7 @@ class _HallDetailPageState extends State<HallDetailPage> {
children: [
Assets.icons.clockCircle.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${DateUtil.formatDateStr(widget.model.appointmentDate)}'
'${DateUtil.formatDateStr(widget.model.readyEndTime)}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
@ -213,7 +189,7 @@ class _HallDetailPageState extends State<HallDetailPage> {
children: [
Assets.icons.environment.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${widget.model.appointmentAddress}'
'${widget.model.accessAddress}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
@ -236,7 +212,7 @@ class _HallDetailPageState extends State<HallDetailPage> {
.color(Colors.black.withOpacity(0.85))
.make(),
16.w.heightBox,
widget.model.content.text
widget.model.remarks.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.make(),

@ -1,13 +1,11 @@
import 'package:aku_new_community/constants/sars_api.dart';
import 'package:aku_new_community/models/task/hall_list_model.dart';
import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/src/extensions/num_ext.dart';
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/sars_api.dart';
import 'package:aku_new_community/models/task/hall_list_model.dart';
import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart';
import 'hall_card.dart';
class HallView extends StatefulWidget {
@ -29,9 +27,11 @@ class _HallViewState extends State<HallView> {
@override
Widget build(BuildContext context) {
return BeeListView(
path: API.manager.task.hallList,
path: SARSAPI.task.list,
controller: _refreshController,
extraParams: {},
extraParams: {
'taskModel': 1,
},
convert: (json) =>
json.rows.map((e) => HallListModel.fromJson(e)).toList(),
builder: (models) {

@ -1,10 +1,3 @@
import 'package:flutter/material.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_new_community/extensions/widget_list_ext.dart';
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/models/task/my_take_task_list_model.dart';
@ -12,6 +5,12 @@ import 'package:aku_new_community/ui/service/my_take_task/my_take_task_detail_pa
import 'package:aku_new_community/ui/service/task_map.dart';
import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/buttons/card_bottom_button.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
import '../task_func.dart';
class MyTakeTaskCard extends StatelessWidget {
@ -38,7 +37,7 @@ class MyTakeTaskCard extends StatelessWidget {
children: [
Row(
children: [
'接单时间 ${DateUtil.formatDateStr(model.createDate)}'
'接单时间 ${DateUtil.formatDateStr(model.updateDate)}'
.text
.size(26.sp)
.color(Colors.black.withOpacity(0.45))
@ -59,7 +58,7 @@ class MyTakeTaskCard extends StatelessWidget {
children: [
Assets.icons.clockCircle.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${DateUtil.formatDateStr(model.appointmentDate)}'
'${DateUtil.formatDateStr(model.readyEndTime)}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
@ -71,7 +70,7 @@ class MyTakeTaskCard extends StatelessWidget {
children: [
Assets.icons.environment.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${model.appointmentAddress}'
'${model.accessAddress}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
@ -94,7 +93,7 @@ class MyTakeTaskCard extends StatelessWidget {
.color(Colors.black.withOpacity(0.85))
.make(),
16.w.heightBox,
model.content.text
model.remarks.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.make(),

@ -1,14 +1,12 @@
import 'package:flutter/material.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/models/task/my_take_task_list_model.dart';
import 'package:aku_new_community/ui/service/task_map.dart';
import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class MyTakeTaskDetailPage extends StatefulWidget {
final MyTakeTaskListModel model;
@ -150,7 +148,7 @@ class _MyTakeTaskDetailPageState extends State<MyTakeTaskDetailPage> {
.color(Colors.black.withOpacity(0.45))
.make(),
Spacer(),
'${DateUtil.formatDateStr(widget.model.createDate)}'
'${DateUtil.formatDateStr(widget.model.updateDate)}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
@ -201,7 +199,7 @@ class _MyTakeTaskDetailPageState extends State<MyTakeTaskDetailPage> {
children: [
Assets.icons.clockCircle.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${DateUtil.formatDateStr(widget.model.appointmentDate)}'
'${DateUtil.formatDateStr(widget.model.readyEndTime)}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
@ -213,7 +211,7 @@ class _MyTakeTaskDetailPageState extends State<MyTakeTaskDetailPage> {
children: [
Assets.icons.environment.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${widget.model.appointmentAddress}'
'${widget.model.accessAddress}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
@ -236,7 +234,7 @@ class _MyTakeTaskDetailPageState extends State<MyTakeTaskDetailPage> {
.color(Colors.black.withOpacity(0.85))
.make(),
16.w.heightBox,
widget.model.content.text
widget.model.remarks.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.make(),

@ -1,14 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/sars_api.dart';
import 'package:aku_new_community/models/task/my_take_task_list_model.dart';
import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart';
import 'package:aku_new_community/ui/service/my_take_task/my_take_task_card.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class MyTakeTaskView extends StatefulWidget {
const MyTakeTaskView({Key? key}) : super(key: key);
@ -29,8 +26,11 @@ class _MyTakeTaskViewState extends State<MyTakeTaskView> {
@override
Widget build(BuildContext context) {
return BeeListView(
path: API.manager.task.myTakeTask,
path: SARSAPI.task.list,
controller: _refreshController,
extraParams: {
'taskModel': 2,
},
convert: (json) =>
json.rows.map((e) => MyTakeTaskListModel.fromJson(e)).toList(),
builder: (models) {

@ -1,15 +1,14 @@
import 'package:flutter/material.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/models/task/my_task_list_model.dart';
import 'package:aku_new_community/ui/service/my_task/my_task_detail_page.dart';
import 'package:aku_new_community/ui/service/task_map.dart';
import 'package:aku_new_community/widget/buttons/card_bottom_button.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
import '../task_func.dart';
class MyTaskCard extends StatelessWidget {
@ -65,7 +64,7 @@ class MyTaskCard extends StatelessWidget {
children: [
Assets.icons.clockCircle.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${DateUtil.formatDateStr(model.appointmentDate)}'
'${DateUtil.formatDateStr(model.readyEndTime)}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
@ -77,7 +76,7 @@ class MyTaskCard extends StatelessWidget {
children: [
Assets.icons.environment.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${model.appointmentAddress}'
'${model.accessAddress}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
@ -100,7 +99,7 @@ class MyTaskCard extends StatelessWidget {
.color(Colors.black.withOpacity(0.85))
.make(),
16.w.heightBox,
model.content.text
model.remarks.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.make(),

@ -1,14 +1,12 @@
import 'package:flutter/material.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/models/task/my_task_list_model.dart';
import 'package:aku_new_community/ui/service/task_map.dart';
import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class MyTaskDetailPage extends StatefulWidget {
final MyTaskListModel model;
@ -150,7 +148,7 @@ class _MyTaskDetailPageState extends State<MyTaskDetailPage> {
.color(Colors.black.withOpacity(0.45))
.make(),
Spacer(),
'${DateUtil.formatDateStr(widget.model.createDate)}'
'${DateUtil.formatDateStr(widget.model.updateDate)}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
@ -201,7 +199,7 @@ class _MyTaskDetailPageState extends State<MyTaskDetailPage> {
children: [
Assets.icons.clockCircle.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${DateUtil.formatDateStr(widget.model.appointmentDate)}'
'${DateUtil.formatDateStr(widget.model.readyEndTime)}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
@ -213,7 +211,7 @@ class _MyTaskDetailPageState extends State<MyTaskDetailPage> {
children: [
Assets.icons.environment.image(width: 36.w, height: 36.w),
24.w.widthBox,
'${widget.model.appointmentAddress}'
'${widget.model.accessAddress}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
@ -236,7 +234,7 @@ class _MyTaskDetailPageState extends State<MyTaskDetailPage> {
.color(Colors.black.withOpacity(0.85))
.make(),
16.w.heightBox,
widget.model.content.text
widget.model.remarks.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.make(),

@ -1,14 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/sars_api.dart';
import 'package:aku_new_community/models/task/my_task_list_model.dart';
import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart';
import 'package:aku_new_community/ui/service/my_task/my_task_card.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class MyTaskView extends StatefulWidget {
const MyTaskView({Key? key}) : super(key: key);
@ -29,8 +26,11 @@ class _MyTaskViewState extends State<MyTaskView> {
@override
Widget build(BuildContext context) {
return BeeListView(
path: API.manager.task.myTask,
path: SARSAPI.task.list,
controller: _refreshController,
extraParams: {
'taskModel': 2,
},
convert: (json) =>
json.rows.map((e) => MyTaskListModel.fromJson(e)).toList(),
builder: (models) {

@ -0,0 +1,180 @@
import 'dart:async';
import 'dart:math';
import 'package:aku_new_community/constants/sars_api.dart';
import 'package:aku_new_community/extensions/num_ext.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:just_audio/just_audio.dart';
class VoicePlayer extends StatefulWidget {
final String url;
const VoicePlayer({Key? key, required this.url}) : super(key: key);
@override
_VoicePlayerState createState() => _VoicePlayerState();
}
class _VoicePlayerState extends State<VoicePlayer>
with SingleTickerProviderStateMixin {
final double width = 150.w;
final double height = 45.w;
late Animation<int> animation;
late AnimationController controller;
late Tween<int> _rotation;
bool inAnimate = false;
final player = AudioPlayer();
Timer? _timer;
int _voiceLength = 0;
void stopPlay() {
inAnimate = false;
controller.stop();
player.stop();
_timer?.cancel();
_timer = null;
if (mounted) {
setState(() {});
}
}
void startPlay() {
inAnimate = true;
controller.forward();
player.play();
_timer = Timer.periodic(Duration(seconds: 1), (timer) async {
_voiceLength--;
if (_voiceLength <= 0) {
_voiceLength = (player.duration?.inSeconds) ?? 0;
_timer?.cancel();
_timer = null;
controller.stop();
inAnimate = false;
}
if (mounted) {
setState(() {});
}
});
}
@override
void initState() {
controller = AnimationController(
vsync: this,
duration: Duration(seconds: 1),
);
_rotation = IntTween(begin: 1, end: 3);
animation = _rotation
.animate(CurvedAnimation(parent: controller, curve: Curves.decelerate))
..addListener(() {
// _current = animation.value;
if (mounted) {
setState(() {});
}
})
..addStatusListener((status) {
if (status == AnimationStatus.completed) {
controller.repeat();
} else if (status == AnimationStatus.dismissed) {
controller.forward();
}
});
Future.delayed(Duration(milliseconds: 0), () async {
await player.setUrl(SARSAPI.image(widget.url));
var length = await player.load();
_voiceLength = length?.inSeconds ?? 0;
if (mounted) {
setState(() {});
}
});
super.initState();
}
@override
void dispose() {
stopPlay();
player.dispose();
controller.dispose();
animation.removeListener(() {});
animation.removeStatusListener((status) {});
super.dispose();
}
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
if (player.playing) {
stopPlay();
} else {
startPlay();
}
},
child: Material(
color: Colors.transparent,
child: Container(
width: width,
// height: height,
padding: EdgeInsets.symmetric(vertical: 14.w, horizontal: 20.w),
decoration: BoxDecoration(
color: Color(0xFFFFE7BA),
borderRadius: BorderRadius.circular(8.w)),
child: Row(
children: [
CustomPaint(
painter: VoicePlayerPainter(inAnimate ? animation.value : 3),
),
40.wb,
Text('${_voiceLength}\"'),
],
),
),
),
);
}
}
class VoicePlayerPainter extends CustomPainter {
final int tween;
VoicePlayerPainter(this.tween);
@override
void paint(Canvas canvas, Size size) {
var startAngel = -pi / 4;
var sweepAngel = pi / 2;
var paint = Paint()
..color = Colors.black
..style = PaintingStyle.fill;
canvas.drawArc(
Rect.fromCircle(center: Offset(0, size.height / 2), radius: 5),
startAngel,
sweepAngel,
true,
paint);
paint.style = PaintingStyle.stroke;
paint.strokeWidth = 2;
if (tween >= 2) {
canvas.drawArc(
Rect.fromCircle(center: Offset(0, size.height / 2), radius: 8),
startAngel,
sweepAngel,
false,
paint);
}
if (tween >= 3) {
canvas.drawArc(
Rect.fromCircle(center: Offset(0, size.height / 2), radius: 12),
startAngel,
sweepAngel,
false,
paint);
}
}
@override
bool shouldRepaint(covariant CustomPainter oldDelegate) {
return true;
}
}

@ -5,7 +5,9 @@
import FlutterMacOS
import Foundation
import audio_session
import device_info_plus_macos
import just_audio
import package_info
import package_info_plus_macos
import path_provider_macos
@ -13,7 +15,9 @@ import sqflite
import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin"))
FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin"))
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))

@ -71,6 +71,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.8.2"
audio_session:
dependency: transitive
description:
name: audio_session
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.6+1"
auto_size_text_pk:
dependency: transitive
description:
@ -690,6 +697,27 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "6.1.4"
just_audio:
dependency: "direct main"
description:
name: just_audio
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.9.20"
just_audio_platform_interface:
dependency: transitive
description:
name: just_audio_platform_interface
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.1.0"
just_audio_web:
dependency: transitive
description:
name: just_audio_web
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.4.4"
logger:
dependency: transitive
description:

@ -115,6 +115,8 @@ dependencies:
sms_autofill: ^2.2.0
#提取图片主色
palette_generator: ^0.3.2
#音频播放
just_audio: ^0.9.20
dev_dependencies:

Loading…
Cancel
Save