From a13bac7a6c5103f2947cefe0dcd3fe3765eb1d02 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sat, 15 Jan 2022 12:01:14 +0100 Subject: [PATCH] chore: Finetune add story page --- lib/pages/add_story/add_story.dart | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/lib/pages/add_story/add_story.dart b/lib/pages/add_story/add_story.dart index 23e43ced..277b9391 100644 --- a/lib/pages/add_story/add_story.dart +++ b/lib/pages/add_story/add_story.dart @@ -4,9 +4,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; -import 'package:adaptive_dialog/adaptive_dialog.dart'; import 'package:file_picker_cross/file_picker_cross.dart'; -import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:future_loading_dialog/future_loading_dialog.dart'; import 'package:image_picker/image_picker.dart'; import 'package:matrix/matrix.dart'; @@ -47,23 +45,9 @@ class AddStoryController extends State { }); void importMedia() async { - final type = await showModalActionSheet( - context: context, - actions: [ - SheetAction( - label: L10n.of(context)!.pickImage, - key: FileTypeCross.image, - icon: Icons.photo_album_outlined, - ), - SheetAction( - label: L10n.of(context)!.sendVideo, - key: FileTypeCross.video, - icon: Icons.video_camera_back_outlined, - ), - ], + final picked = await FilePickerCross.importFromStorage( + type: FileTypeCross.image, ); - if (type == null) return; - final picked = await FilePickerCross.importFromStorage(type: type); final fileName = picked.fileName; if (fileName == null) return; setState(() { @@ -189,6 +173,12 @@ class AddStoryController extends State { } } + @override + void dispose() { + videoPlayerController?.dispose(); + super.dispose(); + } + @override Widget build(BuildContext context) => AddStoryView(this); }