Merge branch 'krille/story-colors' into 'main'

chore: Make color change of stories on editing complete

See merge request famedly/fluffychat!677
This commit is contained in:
Krille Fear 2022-01-12 16:33:21 +00:00
commit d7bab1456c
2 changed files with 4 additions and 4 deletions

View File

@ -39,11 +39,11 @@ class AddStoryController extends State<AddStoryPage> {
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 {

View File

@ -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