mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
31 lines
729 B
Dart
31 lines
729 B
Dart
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);
|
|
}
|
|
}
|