From 0934d4b7df83608071f456a34e42800a1a6a6c77 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Wed, 12 Jan 2022 14:58:36 +0100 Subject: [PATCH] chore: Make color change of stories on editing complete --- lib/pages/add_story/add_story.dart | 6 +++--- lib/pages/add_story/add_story_view.dart | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pages/add_story/add_story.dart b/lib/pages/add_story/add_story.dart index cf4c15ec..23e43ced 100644 --- a/lib/pages/add_story/add_story.dart +++ b/lib/pages/add_story/add_story.dart @@ -39,11 +39,11 @@ class AddStoryController extends State { bool get hasMedia => image != null || video != null; - void updateColors(String text) => hasMedia + void updateColors() => hasMedia ? null : setState(() { - backgroundColor = text.color; - backgroundColorDark = text.darkColor; + backgroundColor = controller.text.color; + backgroundColorDark = controller.text.darkColor; }); void importMedia() async { diff --git a/lib/pages/add_story/add_story_view.dart b/lib/pages/add_story/add_story_view.dart index 5508c301..84b0f4c8 100644 --- a/lib/pages/add_story/add_story_view.dart +++ b/lib/pages/add_story/add_story_view.dart @@ -98,7 +98,7 @@ class AddStoryView extends StatelessWidget { color: Colors.white, backgroundColor: !controller.hasMedia ? null : Colors.black, ), - onChanged: controller.updateColors, + onEditingComplete: controller.updateColors, decoration: InputDecoration( border: InputBorder.none, hintText: controller.hasMedia