This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ViewContainer: View { | |
var flipped: Bool | |
var isReversed: Bool | |
var body: some View { | |
if flipped { | |
ZStack { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String mailPattern = r"^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a-zA-Z0-9])?)*$"; | |
RegExp regEx = RegExp(mailPattern); | |
String mailAddress = "Couldn't find any mail in the foto! Please try again!"; | |
for (TextBlock block in visionText.blocks) { | |
for (TextLine line in block.lines) { | |
if (regEx.hasMatch(line.text)) { | |
mailAddress = line.text; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final TextRecognizer textRecognizer = FirebaseVision.instance.textRecognizer(); | |
final VisionText visionText = await textRecognizer.processImage(visionImage); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
import 'package:firebase_ml_vision/firebase_ml_vision.dart'; | |
final File imageFile = File(filePath); | |
final FirebaseVisionImage visionImage = FirebaseVisionImage.fromFile(imageFile); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:camera/camera.dart'; | |
List<CameraDescription> cameras = await availableCameras(); | |
CameraController controller = CameraController(cameras[0], ResolutionPreset.medium); | |
String filePath = "Photos/image_test.jpg" | |
await controller.takePicture(filePath); |