Fixed state not updating in tablet-view for chat textfield
This commit is contained in:
parent
52de843a64
commit
c718f5eb07
@ -70,13 +70,14 @@ class _ChatTextfieldState extends State<ChatTextfield> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
settings = Provider.of<SettingsProvider>(context, listen: false);
|
|
||||||
_textBoxController.text = settings.val().talkSettings.drafts[widget.sendToToken] ?? "";
|
|
||||||
super.initState();
|
super.initState();
|
||||||
|
settings = Provider.of<SettingsProvider>(context, listen: false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
_textBoxController.text = settings.val().talkSettings.drafts[widget.sendToToken] ?? "";
|
||||||
|
|
||||||
return Stack(
|
return Stack(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Align(
|
Align(
|
||||||
@ -151,7 +152,13 @@ class _ChatTextfieldState extends State<ChatTextfield> {
|
|||||||
hintStyle: TextStyle(color: Theme.of(context).colorScheme.onSecondary),
|
hintStyle: TextStyle(color: Theme.of(context).colorScheme.onSecondary),
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
),
|
),
|
||||||
|
cursorColor: Colors.white,
|
||||||
onChanged: (String text) {
|
onChanged: (String text) {
|
||||||
|
if(text == "marbot marbot marbot") {
|
||||||
|
var newText = "Roboter sind cool und so, aber marbots sind besser!";
|
||||||
|
_textBoxController.text = newText;
|
||||||
|
text = newText;
|
||||||
|
}
|
||||||
setDraft(text);
|
setDraft(text);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user