no message
This commit is contained in:
parent
c955f1859a
commit
bf0a5f5ff1
|
|
@ -14,3 +14,7 @@ A few resources to get you started if this is your first Flutter project:
|
||||||
For help getting started with Flutter development, view the
|
For help getting started with Flutter development, view the
|
||||||
[online documentation](https://docs.flutter.dev/), which offers tutorials,
|
[online documentation](https://docs.flutter.dev/), which offers tutorials,
|
||||||
samples, guidance on mobile development, and a full API reference.
|
samples, guidance on mobile development, and a full API reference.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
fvm flutter build apk --release --no-tree-shake-icons
|
||||||
|
|
@ -19,7 +19,7 @@ class JobHandwritingDrawingTrajectoryProviderHandle extends StateNotifier<List<G
|
||||||
|
|
||||||
// 查看原稿
|
// 查看原稿
|
||||||
final jobHandwritingStudentManuscriptProvider = StateNotifierProvider<JobHandwritingStudentManuscriptHandle, ShowStudentMmanuscript>(
|
final jobHandwritingStudentManuscriptProvider = StateNotifierProvider<JobHandwritingStudentManuscriptHandle, ShowStudentMmanuscript>(
|
||||||
(ref) => JobHandwritingStudentManuscriptHandle(ShowStudentMmanuscript(false)));
|
(ref) => JobHandwritingStudentManuscriptHandle(ShowStudentMmanuscript(true)));
|
||||||
|
|
||||||
class JobHandwritingStudentManuscriptHandle extends StateNotifier<ShowStudentMmanuscript> {
|
class JobHandwritingStudentManuscriptHandle extends StateNotifier<ShowStudentMmanuscript> {
|
||||||
JobHandwritingStudentManuscriptHandle(ShowStudentMmanuscript progress) : super(progress);
|
JobHandwritingStudentManuscriptHandle(ShowStudentMmanuscript progress) : super(progress);
|
||||||
|
|
|
||||||
|
|
@ -391,9 +391,8 @@ class _HandwritingDrawBoxState extends ConsumerState<HandwritingDrawBox> with Ev
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_vnHandWritings = ValueNotifier<List<GestureHandwritingRecording>>([]);
|
_vnHandWritings = ValueNotifier<List<GestureHandwritingRecording>>([]);
|
||||||
_vnPrimaryHandWritings = ValueNotifier<List<GestureHandwritingRecording>>([]);
|
_vnPrimaryHandWritings = ValueNotifier<List<GestureHandwritingRecording>>(_packagedHandwritingDataAll);
|
||||||
_jobHandwritingDrawingTrajectoryListener1 = ref.read(jobHandwritingStudentManuscriptProvider.notifier).addListener((state) {
|
_jobHandwritingDrawingTrajectoryListener1 = ref.read(jobHandwritingStudentManuscriptProvider.notifier).addListener((state) {
|
||||||
print('点击进入了');
|
|
||||||
// 查看原稿控制
|
// 查看原稿控制
|
||||||
if (state.showManuscript) {
|
if (state.showManuscript) {
|
||||||
// 查看原稿
|
// 查看原稿
|
||||||
|
|
@ -590,6 +589,9 @@ class _HandwritingDrawBoxState extends ConsumerState<HandwritingDrawBox> with Ev
|
||||||
|
|
||||||
_packagedHandwritingDatas.add(newTrajectoryData); // 分组数据
|
_packagedHandwritingDatas.add(newTrajectoryData); // 分组数据
|
||||||
_packagedHandwritingDataAll.addAll(newTrajectoryData); // 不分组数据
|
_packagedHandwritingDataAll.addAll(newTrajectoryData); // 不分组数据
|
||||||
|
try {
|
||||||
|
Future.delayed(Duration.zero, () => ref.read(jobHandwritingStudentManuscriptProvider.notifier).setVal(ShowStudentMmanuscript(true)));
|
||||||
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
Future.delayed(Duration.zero, () => eventFire(model: JobHandwritingGetReadyBus())); // 通知外部可以播放笔迹
|
Future.delayed(Duration.zero, () => eventFire(model: JobHandwritingGetReadyBus())); // 通知外部可以播放笔迹
|
||||||
}
|
}
|
||||||
|
|
@ -625,47 +627,6 @@ class _HandwritingDrawBoxState extends ConsumerState<HandwritingDrawBox> with Ev
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class HandWritingDrawingPainter1 extends CustomPainter {
|
|
||||||
final ValueNotifier<List<GestureHandwritingRecording>> ctrl;
|
|
||||||
HandWritingDrawingPainter1({required this.ctrl}) : super(repaint: ctrl);
|
|
||||||
//[定义画笔]
|
|
||||||
final Paint paintBrush = Paint()
|
|
||||||
//画笔颜色
|
|
||||||
..color = Colors.black
|
|
||||||
//画笔笔触类型
|
|
||||||
..strokeCap = StrokeCap.round
|
|
||||||
//是否启动抗锯齿
|
|
||||||
..isAntiAlias = true
|
|
||||||
//绘画风格,默认为填充
|
|
||||||
// ..style = PaintingStyle.fill
|
|
||||||
//画笔的宽度
|
|
||||||
..style = PaintingStyle.stroke
|
|
||||||
..strokeWidth = 0.5.r;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void paint(Canvas canvas, Size size) {
|
|
||||||
// canvas.drawPoints(PointMode.points, thePoints, paintBrush);
|
|
||||||
|
|
||||||
var points = ctrl.value;
|
|
||||||
var _length = points.length;
|
|
||||||
for (int i = 0; i < _length; i++) {
|
|
||||||
GestureHandwritingRecording item = points[i];
|
|
||||||
GestureHandwritingRecording? nextItem = i + 1 < _length ? points[i + 1] : null;
|
|
||||||
|
|
||||||
Offset offsetData = item.data;
|
|
||||||
Offset? nextOffsetData = nextItem?.data;
|
|
||||||
if (nextOffsetData != null && item.stroke == nextItem?.stroke) {
|
|
||||||
canvas.drawLine(offsetData, nextOffsetData, paintBrush);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool shouldRepaint(covariant CustomPainter oldDelegate) {
|
|
||||||
return false; // 如果 oldDelegate 不是 MyCustomPainter 的实例,则总是重绘
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class HandWritingDrawingPainter extends CustomPainter {
|
class HandWritingDrawingPainter extends CustomPainter {
|
||||||
final ValueNotifier<List<GestureHandwritingRecording>> ctrl;
|
final ValueNotifier<List<GestureHandwritingRecording>> ctrl;
|
||||||
HandWritingDrawingPainter({required this.ctrl}) : super(repaint: ctrl);
|
HandWritingDrawingPainter({required this.ctrl}) : super(repaint: ctrl);
|
||||||
|
|
@ -804,126 +765,126 @@ Widget $bottomPlaybar(BuildContext context, int timeConsuming, int pauseCount, L
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
height: 62.h,
|
height: 62.h,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 10.h),
|
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
color: Color.fromRGBO(0, 0, 0, 0.4),
|
color: Color.fromRGBO(0, 0, 0, 0.4),
|
||||||
child: Column(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Container(alignment: Alignment.centerRight, child: StudentManuscriptBtn()), // 查看原稿按钮
|
if (usePlaybar.handWritingReady.value)
|
||||||
Row(
|
InkWell(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
onTap: () => easyThrottle('job_handwriting_play_pause', () {
|
||||||
children: [
|
if (usePlaybar.handwritingDuration.value == 0) return ToastUtils.showInfo('没有笔迹');
|
||||||
if (usePlaybar.handWritingReady.value)
|
|
||||||
InkWell(
|
|
||||||
onTap: () => easyThrottle('job_handwriting_play_pause', () {
|
|
||||||
if (usePlaybar.handwritingDuration.value == 0) return ToastUtils.showInfo('没有笔迹');
|
|
||||||
|
|
||||||
usePlaybar.playPause.value = !usePlaybar.playPause.value;
|
usePlaybar.playPause.value = !usePlaybar.playPause.value;
|
||||||
usePlaybar.eventFire(model: JobHandwritingPlaybarBus(usePlaybar.playPause.value));
|
usePlaybar.eventFire(model: JobHandwritingPlaybarBus(usePlaybar.playPause.value));
|
||||||
}),
|
}),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
!usePlaybar.playPause.value ? Icons.play_circle_outline : Icons.pause_circle_outline,
|
!usePlaybar.playPause.value ? Icons.play_circle_outline : Icons.pause_circle_outline,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
size: 28.r,
|
size: 28.r,
|
||||||
),
|
|
||||||
)
|
|
||||||
else
|
|
||||||
SpinKitPouringHourGlassRefined(size: 40.sp, color: Colors.white),
|
|
||||||
SizedBox(width: 6.w),
|
|
||||||
Expanded(
|
|
||||||
child: LayoutBuilder(builder: (context, constraints) {
|
|
||||||
final double containerWidth = constraints.maxWidth; // 展示区域总宽度
|
|
||||||
var unitScale = containerWidth / timeConsuming; // 单位刻度
|
|
||||||
var pauseIntervalsLength = pauseIntervals.length;
|
|
||||||
|
|
||||||
List<Widget> pauseTickMarks = pauseIntervals.asMap().keys.map((e) {
|
|
||||||
bool isLast = e == pauseIntervalsLength - 1;
|
|
||||||
bool isFirst = e == 0;
|
|
||||||
var item = pauseIntervals[e];
|
|
||||||
return Positioned(
|
|
||||||
top: 0,
|
|
||||||
left: unitScale * item.startTime,
|
|
||||||
child: Container(
|
|
||||||
width: unitScale * (item.apart ?? 0),
|
|
||||||
height: 8.h,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Color.fromRGBO(202, 201, 201, 1),
|
|
||||||
borderRadius: isFirst
|
|
||||||
? BorderRadius.only(topLeft: Radius.circular(8.r), bottomLeft: Radius.circular(10.r))
|
|
||||||
: (isLast ? BorderRadius.only(topRight: Radius.circular(8.r), bottomRight: Radius.circular(10.r)) : null),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}).toList();
|
|
||||||
|
|
||||||
return Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Stack(
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
height: 8.h,
|
|
||||||
width: containerWidth,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
// color: Color.fromRGBO(146, 146, 146, 1),
|
|
||||||
color: Colors.white,
|
|
||||||
borderRadius: BorderRadius.circular(50.r),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
...pauseTickMarks,
|
|
||||||
Container(
|
|
||||||
height: 8.h,
|
|
||||||
width: containerWidth,
|
|
||||||
// color: Theme.of(context).primaryColor,
|
|
||||||
child: SliderTheme(
|
|
||||||
data: SliderTheme.of(context).copyWith(
|
|
||||||
trackHeight: 8.h, // 轨道高度
|
|
||||||
trackShape: RoundedRectSliderTrackShape(), // 轨道形状,可以自定义
|
|
||||||
activeTrackColor: Theme.of(context).primaryColor, // 激活的轨道颜色
|
|
||||||
inactiveTrackColor: Colors.transparent, // 未激活的轨道颜色
|
|
||||||
thumbShape: RoundSliderThumbShape(enabledThumbRadius: 0, disabledThumbRadius: 0),
|
|
||||||
thumbColor: Colors.white, // 滑块颜色
|
|
||||||
overlayShape: RoundSliderOverlayShape(overlayRadius: 0),
|
|
||||||
overlayColor: Colors.black54, // 滑块外圈颜色
|
|
||||||
// valueIndicatorShape: PaddleSliderValueIndicatorShape(), // 标签形状,可以自定义
|
|
||||||
),
|
|
||||||
child: Slider(
|
|
||||||
value: (usePlaybar.handwritingDuration.value - usePlaybar.useTime.value).toDouble(),
|
|
||||||
min: 0.0,
|
|
||||||
max: usePlaybar.handwritingDuration.value.toDouble(),
|
|
||||||
inactiveColor: Colors.transparent,
|
|
||||||
onChangeEnd: (value) {
|
|
||||||
if (!usePlaybar.handWritingReady.value) return;
|
|
||||||
usePlaybar.playTimingSuspend(); // 暂停计时器得暂停
|
|
||||||
usePlaybar.eventFire(model: JobHandwritingDragProgressBarBus(value.toInt(), usePlaybar.handwritingDuration.value));
|
|
||||||
usePlaybar.useTime.value = usePlaybar.handwritingDuration.value - value.toInt();
|
|
||||||
},
|
|
||||||
onChanged: (double value) {
|
|
||||||
if (!usePlaybar.handWritingReady.value) return;
|
|
||||||
usePlaybar.useTime.value = usePlaybar.handwritingDuration.value - value.toInt();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
SizedBox(height: 4.h),
|
|
||||||
SizedBox(
|
|
||||||
width: containerWidth,
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
quickText('累计停顿:$pauseCount次', color: Colors.white, size: 7.sp),
|
|
||||||
quickText(convertSeconds(usePlaybar.useTime.value)?.toString() ?? '', color: Colors.white, size: 7.sp),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
),
|
),
|
||||||
SizedBox(width: 16.w),
|
)
|
||||||
|
else
|
||||||
|
SpinKitPouringHourGlassRefined(size: 40.sp, color: Colors.white),
|
||||||
|
SizedBox(width: 6.w),
|
||||||
|
Expanded(
|
||||||
|
child: LayoutBuilder(builder: (context, constraints) {
|
||||||
|
final double containerWidth = constraints.maxWidth; // 展示区域总宽度
|
||||||
|
var unitScale = containerWidth / timeConsuming; // 单位刻度
|
||||||
|
var pauseIntervalsLength = pauseIntervals.length;
|
||||||
|
|
||||||
|
List<Widget> pauseTickMarks = pauseIntervals.asMap().keys.map((e) {
|
||||||
|
bool isLast = e == pauseIntervalsLength - 1;
|
||||||
|
bool isFirst = e == 0;
|
||||||
|
var item = pauseIntervals[e];
|
||||||
|
return Positioned(
|
||||||
|
top: 0,
|
||||||
|
left: unitScale * item.startTime,
|
||||||
|
child: Container(
|
||||||
|
width: unitScale * (item.apart ?? 0),
|
||||||
|
height: 10.h,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color.fromRGBO(202, 201, 201, 1),
|
||||||
|
borderRadius: isFirst
|
||||||
|
? BorderRadius.only(topLeft: Radius.circular(8.r), bottomLeft: Radius.circular(10.r))
|
||||||
|
: (isLast ? BorderRadius.only(topRight: Radius.circular(8.r), bottomRight: Radius.circular(10.r)) : null),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList();
|
||||||
|
|
||||||
|
return Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Stack(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: 10.h,
|
||||||
|
width: containerWidth,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
// color: Color.fromRGBO(146, 146, 146, 1),
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(50.r),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
...pauseTickMarks,
|
||||||
|
Container(
|
||||||
|
height: 10.h,
|
||||||
|
width: containerWidth,
|
||||||
|
// color: Theme.of(context).primaryColor,
|
||||||
|
child: SliderTheme(
|
||||||
|
data: SliderTheme.of(context).copyWith(
|
||||||
|
trackHeight: 10.h, // 轨道高度
|
||||||
|
trackShape: RoundedRectSliderTrackShape(), // 轨道形状,可以自定义
|
||||||
|
activeTrackColor: Theme.of(context).primaryColor, // 激活的轨道颜色
|
||||||
|
inactiveTrackColor: Colors.transparent, // 未激活的轨道颜色
|
||||||
|
thumbShape: RoundSliderThumbShape(enabledThumbRadius: 0, disabledThumbRadius: 0),
|
||||||
|
thumbColor: Colors.white, // 滑块颜色
|
||||||
|
overlayShape: RoundSliderOverlayShape(overlayRadius: 0),
|
||||||
|
overlayColor: Colors.black54, // 滑块外圈颜色
|
||||||
|
// valueIndicatorShape: PaddleSliderValueIndicatorShape(), // 标签形状,可以自定义
|
||||||
|
),
|
||||||
|
child: Slider(
|
||||||
|
value: (usePlaybar.handwritingDuration.value - usePlaybar.useTime.value).toDouble(),
|
||||||
|
min: 0.0,
|
||||||
|
max: usePlaybar.handwritingDuration.value.toDouble(),
|
||||||
|
inactiveColor: Colors.transparent,
|
||||||
|
onChangeEnd: (value) {
|
||||||
|
if (!usePlaybar.handWritingReady.value) return;
|
||||||
|
usePlaybar.playTimingSuspend(); // 暂停计时器得暂停
|
||||||
|
usePlaybar.eventFire(model: JobHandwritingDragProgressBarBus(value.toInt(), usePlaybar.handwritingDuration.value));
|
||||||
|
usePlaybar.useTime.value = usePlaybar.handwritingDuration.value - value.toInt();
|
||||||
|
},
|
||||||
|
onChanged: (double value) {
|
||||||
|
if (!usePlaybar.handWritingReady.value) return;
|
||||||
|
usePlaybar.useTime.value = usePlaybar.handwritingDuration.value - value.toInt();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 8.h),
|
||||||
|
SizedBox(
|
||||||
|
width: containerWidth,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
quickText('累计停顿:$pauseCount次', color: Colors.white, size: 7.sp),
|
||||||
|
quickText(convertSeconds(usePlaybar.useTime.value)?.toString() ?? '', color: Colors.white, size: 7.sp),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
SizedBox(width: 16.w),
|
||||||
|
Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () => easyThrottle('job_handwriting_speed', () {
|
onTap: () => easyThrottle('job_handwriting_speed', () {
|
||||||
var theIndex = PlaybackSpeed.values.indexOf(usePlaybar.constantFastSpeed.value);
|
var theIndex = PlaybackSpeed.values.indexOf(usePlaybar.constantFastSpeed.value);
|
||||||
|
|
@ -944,8 +905,10 @@ Widget $bottomPlaybar(BuildContext context, int timeConsuming, int pauseCount, L
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
SizedBox(height: 7.h),
|
||||||
|
StudentManuscriptBtn(),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -957,15 +920,17 @@ class StudentManuscriptBtn extends ConsumerWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
|
var _showVal = ref.watch(jobHandwritingStudentManuscriptProvider);
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () => easyThrottle('job_handwriting_udent_manuscript', () {
|
onTap: () => easyThrottle('job_handwriting_udent_manuscript', () {
|
||||||
var showManuscript = ref.read(jobHandwritingStudentManuscriptProvider).showManuscript;
|
var showManuscript = ref.read(jobHandwritingStudentManuscriptProvider).showManuscript;
|
||||||
ref.read(jobHandwritingStudentManuscriptProvider.notifier).setVal(ShowStudentMmanuscript(!showManuscript));
|
ref.read(jobHandwritingStudentManuscriptProvider.notifier).setVal(ShowStudentMmanuscript(!showManuscript));
|
||||||
}),
|
}),
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 2.w, vertical: 1.h),
|
padding: EdgeInsets.symmetric(horizontal: 3.w, vertical: 1.5.h),
|
||||||
decoration: BoxDecoration(color: Colors.grey, borderRadius: BorderRadius.circular(4.r)),
|
decoration:
|
||||||
child: quickText('学生原稿', color: Colors.white, size: 8.sp),
|
BoxDecoration(color: _showVal.showManuscript ? Theme.of(context).primaryColor : Colors.grey, borderRadius: BorderRadius.circular(4.r)),
|
||||||
|
child: quickText('学生原稿', color: Colors.white, size: 8.sp, align: TextAlign.center),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||||
# Read more about iOS versioning at
|
# Read more about iOS versioning at
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
version: 1.0.106
|
version: 1.0.107+2
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.17.1 <3.0.0"
|
sdk: ">=2.17.1 <3.0.0"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue