feat: richtextfield

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-06-27 12:02:32 +08:00
parent 721bf2d59f
commit 6f2570c5be
26 changed files with 7154 additions and 870 deletions

View File

@@ -0,0 +1,29 @@
import 'package:PiliPlus/pages/common/publish/common_publish_page.dart';
import 'package:flutter/material.dart';
abstract class CommonTextPubPage extends CommonPublishPage<String> {
const CommonTextPubPage({
super.key,
super.initialValue,
super.onSave,
});
}
abstract class CommonTextPubPageState<T extends CommonTextPubPage>
extends CommonPublishPageState<T> {
@override
late final TextEditingController editController =
TextEditingController(text: widget.initialValue);
@override
void initPubState() {
if (widget.initialValue?.trim().isNotEmpty == true) {
enablePublish.value = true;
}
}
@override
void onSave() {
widget.onSave?.call(editController.text);
}
}