update
This commit is contained in:
parent
5164d55905
commit
6f54a6f9fc
65 changed files with 313 additions and 137 deletions
|
|
@ -1,3 +1,6 @@
|
|||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
|
|
@ -19,6 +22,7 @@ import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
|||
import 'package:pharmacy_mobile/widgets/title_widget.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
import 'package:flutter_image_compress/flutter_image_compress.dart';
|
||||
|
||||
class AddMedicinePage extends StatefulWidget {
|
||||
const AddMedicinePage({super.key});
|
||||
|
|
@ -66,6 +70,17 @@ class _AddMedicinePageState extends State<AddMedicinePage> {
|
|||
}
|
||||
}
|
||||
|
||||
// Future<Uint8List> compressFile(XFile file) async {
|
||||
// var result = await FlutterImageCompress.compressWithFile(
|
||||
// file.path,
|
||||
// minWidth: 1020,
|
||||
// minHeight: 765,
|
||||
// quality: 90,
|
||||
// format: CompressFormat.webp,
|
||||
// );
|
||||
// return result;
|
||||
// }
|
||||
|
||||
void _getGenerics() async {
|
||||
_genericNameList = await _refGenericNames.getList();
|
||||
_checkResult(_genericNameList, 'Generics');
|
||||
|
|
@ -155,7 +170,7 @@ class _AddMedicinePageState extends State<AddMedicinePage> {
|
|||
return;
|
||||
}
|
||||
|
||||
imageUrl = await _storage.uploadImage(storageName, image, '$imageName.webp');
|
||||
imageUrl = await _storage.uploadImage(context, storageName, image, '$imageName.webp');
|
||||
|
||||
setState(() {
|
||||
if (imageUrl.isEmpty) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue