Implement file picker web
This commit is contained in:
parent
3fa51d74a9
commit
6de4081513
9 changed files with 90 additions and 68 deletions
|
|
@ -15,6 +15,7 @@ import 'package:flutter/services.dart';
|
|||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:link_text/link_text.dart';
|
||||
import 'package:memoryfilepicker/memoryfilepicker.dart';
|
||||
import './settings_emotes.dart';
|
||||
|
||||
class ChatDetails extends StatefulWidget {
|
||||
|
|
@ -100,7 +101,7 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
}
|
||||
|
||||
void setAvatarAction(BuildContext context) async {
|
||||
final tempFile = await ImagePicker.pickImage(
|
||||
final tempFile = await MemoryFilePicker.getImage(
|
||||
source: ImageSource.gallery,
|
||||
imageQuality: 50,
|
||||
maxWidth: 1600,
|
||||
|
|
@ -109,7 +110,7 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
final success = await SimpleDialogs(context).tryRequestWithLoadingDialog(
|
||||
widget.room.setAvatar(
|
||||
MatrixFile(
|
||||
bytes: await tempFile.readAsBytes(),
|
||||
bytes: tempFile.bytes,
|
||||
path: tempFile.path,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue