no message

This commit is contained in:
1147192855@qq.com 2024-05-20 15:34:14 +08:00
parent c955f1859a
commit bf0a5f5ff1
4 changed files with 133 additions and 164 deletions

View File

@ -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

View File

@ -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);

View File

@ -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,14 +765,10 @@ 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,
children: [
Container(alignment: Alignment.centerRight, child: StudentManuscriptBtn()), // 稿
Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
if (usePlaybar.handWritingReady.value) if (usePlaybar.handWritingReady.value)
@ -846,7 +803,7 @@ Widget $bottomPlaybar(BuildContext context, int timeConsuming, int pauseCount, L
left: unitScale * item.startTime, left: unitScale * item.startTime,
child: Container( child: Container(
width: unitScale * (item.apart ?? 0), width: unitScale * (item.apart ?? 0),
height: 8.h, height: 10.h,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color.fromRGBO(202, 201, 201, 1), color: Color.fromRGBO(202, 201, 201, 1),
borderRadius: isFirst borderRadius: isFirst
@ -863,7 +820,7 @@ Widget $bottomPlaybar(BuildContext context, int timeConsuming, int pauseCount, L
Stack( Stack(
children: [ children: [
Container( Container(
height: 8.h, height: 10.h,
width: containerWidth, width: containerWidth,
decoration: BoxDecoration( decoration: BoxDecoration(
// color: Color.fromRGBO(146, 146, 146, 1), // color: Color.fromRGBO(146, 146, 146, 1),
@ -873,12 +830,12 @@ Widget $bottomPlaybar(BuildContext context, int timeConsuming, int pauseCount, L
), ),
...pauseTickMarks, ...pauseTickMarks,
Container( Container(
height: 8.h, height: 10.h,
width: containerWidth, width: containerWidth,
// color: Theme.of(context).primaryColor, // color: Theme.of(context).primaryColor,
child: SliderTheme( child: SliderTheme(
data: SliderTheme.of(context).copyWith( data: SliderTheme.of(context).copyWith(
trackHeight: 8.h, // trackHeight: 10.h, //
trackShape: RoundedRectSliderTrackShape(), // trackShape: RoundedRectSliderTrackShape(), //
activeTrackColor: Theme.of(context).primaryColor, // activeTrackColor: Theme.of(context).primaryColor, //
inactiveTrackColor: Colors.transparent, // inactiveTrackColor: Colors.transparent, //
@ -908,7 +865,7 @@ Widget $bottomPlaybar(BuildContext context, int timeConsuming, int pauseCount, L
), ),
], ],
), ),
SizedBox(height: 4.h), SizedBox(height: 8.h),
SizedBox( SizedBox(
width: containerWidth, width: containerWidth,
child: Row( child: Row(
@ -924,6 +881,10 @@ Widget $bottomPlaybar(BuildContext context, int timeConsuming, int pauseCount, L
}), }),
), ),
SizedBox(width: 16.w), 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),
), ),
); );
} }

View File

@ -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"