diff --git a/lib/pages/add_story/add_story.dart b/lib/pages/add_story/add_story.dart index cf4c15eca..23e43cedb 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 5508c301e..84b0f4c8b 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