Erweiterungen
This commit is contained in:
1 parent
5c3cee2d92
commit
07b9d71eb3
17 files changed
+323
-18
No files matched your search
@@ -1,6 +1,9 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:stadtbote/tools/constants.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
@@ -160,6 +163,17 @@ class Util {
|
||||
borderRadius: BorderRadius.all(Radius.circular(20.0)),
|
||||
);
|
||||
}
|
||||
|
||||
static Future<File?> capturePhoto() async {
|
||||
final imagePicker = ImagePicker();
|
||||
final pickedFile = await imagePicker.pickImage(source: ImageSource.camera);
|
||||
|
||||
if (pickedFile != null) {
|
||||
return File(pickedFile.path);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Widget getDefaultButton(String text, Function() onPressed, {Image? image, double? buttonHeight}) {
|
||||
|
||||
Reference in new issue
Block a user