update greeting
This commit is contained in:
@@ -17,10 +17,18 @@ class PartScreen extends StatefulWidget {
|
||||
|
||||
class _PartScreenState extends State<PartScreen> {
|
||||
final ScrollController _scrollController = ScrollController();
|
||||
bool _isInitialized = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
final messageService = Provider.of<MessageService>(context, listen: false);
|
||||
messageService.initializeEmpty();
|
||||
setState(() {
|
||||
_isInitialized = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -54,6 +62,9 @@ class _PartScreenState extends State<PartScreen> {
|
||||
backgroundColor: Colors.transparent,
|
||||
body: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
if (!_isInitialized) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
final double minHeight = constraints.maxHeight * 0.18;
|
||||
final double maxHeight = constraints.maxHeight * 0.4;
|
||||
final double chatWidth = constraints.maxWidth * 0.94;
|
||||
@@ -74,9 +85,13 @@ class _PartScreenState extends State<PartScreen> {
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () {
|
||||
Provider.of<MessageService>(context, listen: false)
|
||||
.abortReply();
|
||||
final messageService = context.read<MessageService>();
|
||||
if (widget.onHide != null) widget.onHide!();
|
||||
setState(() {
|
||||
_isInitialized = true;
|
||||
});
|
||||
messageService.abortReply();
|
||||
messageService.initializeEmpty();
|
||||
},
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
|
||||
Reference in New Issue
Block a user