Compare commits
No commits in common. "master" and "detached" have entirely different histories.
16
README.md
16
README.md
|
@ -1,11 +1,7 @@
|
||||||
# kochkomplize
|
# kochkomplize
|
||||||
Helfer zur Digitalisierung von alten Kochrezepten.
|
|
||||||
|
|
||||||
**Bild/Ablauf:**
|
**Bild/Skizze:**
|
||||||
![Startseite](assets/images/Kochkomplize_Startseite.PNG)
|
Ein Bild wie die Applikation aussehen soll findet man unter assets/images mit dem Namen skizze.png
|
||||||
![Rezept Übersicht](assets/images/Kochkomplize_Rezept_Overview.PNG)
|
|
||||||
![Rezept anlegen](assets/images/Kochkomplize_Rezept_anlegen.PNG)
|
|
||||||
![Rezept löschen](assets/images/Kochkomplize_Löschen.PNG)
|
|
||||||
|
|
||||||
**Funktionalität:**
|
**Funktionalität:**
|
||||||
1. Die App soll grundsätzlich im Browser als auch auf Mobilen Endgeräten laufen. (entweder iOS oder Android)
|
1. Die App soll grundsätzlich im Browser als auch auf Mobilen Endgeräten laufen. (entweder iOS oder Android)
|
||||||
|
@ -14,14 +10,8 @@ Helfer zur Digitalisierung von alten Kochrezepten.
|
||||||
4. Es soll möglich sein alte handgeschriebene Texte Bildern zu importieren.
|
4. Es soll möglich sein alte handgeschriebene Texte Bildern zu importieren.
|
||||||
5. Rezepte sollen gelöscht werden können.
|
5. Rezepte sollen gelöscht werden können.
|
||||||
|
|
||||||
|
|
||||||
6. Bonus: Texterkennung wenn die Packages es auch für Web zulassen.
|
6. Bonus: Texterkennung wenn die Packages es auch für Web zulassen.
|
||||||
|
|
||||||
**Eingesetzte Technologien:**
|
|
||||||
Flutter
|
|
||||||
Dart
|
|
||||||
Firebase
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 64 KiB |
Binary file not shown.
Before Width: | Height: | Size: 76 KiB |
Binary file not shown.
Before Width: | Height: | Size: 71 KiB |
Binary file not shown.
Before Width: | Height: | Size: 325 KiB |
|
@ -0,0 +1,11 @@
|
||||||
|
// import 'dart:io';
|
||||||
|
// import 'package:flutter/material.dart';
|
||||||
|
// import 'package:image_picker/image_picker.dart';
|
||||||
|
// import 'package:google_mlkit_text_recognition/google_mlkit_text_recognition.dart';
|
||||||
|
// import 'menu_content.dart';
|
||||||
|
//import 'package:ocr_scan_text/ocr_scan_text.dart';
|
||||||
|
|
||||||
|
|
||||||
|
//todo https://pub.dev/packages/ocr_scan_text/install
|
||||||
|
//todo https://pub.dev/packages/google_mlkit_text_recognition/install
|
||||||
|
//todo https://pub.dev/packages/flutter_tesseract_ocr
|
|
@ -11,11 +11,17 @@ dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
|
#sqflite: ^2.3.0
|
||||||
|
#sqlite3_flutter_libs: ^0.5.18
|
||||||
|
#sqlite3: ^2.3.0
|
||||||
firebase_core: ^2.24.2
|
firebase_core: ^2.24.2
|
||||||
firebase_database: ^10.4.0
|
firebase_database: ^10.4.0
|
||||||
firebase_storage: ^11.6.0
|
firebase_storage: ^11.6.0
|
||||||
path_provider: ^2.1.2
|
path_provider: ^2.1.2
|
||||||
image_picker: ^1.0.7
|
image_picker: ^1.0.7
|
||||||
|
#cloud_firestore: ^4.14.0
|
||||||
|
#ocr_scan_text: 1.3.1
|
||||||
|
google_mlkit_text_recognition: ^0.11.0
|
||||||
path: ^1.8.0
|
path: ^1.8.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
// import 'package:flutter/material.dart';
|
||||||
|
// import 'package:flutter_test/flutter_test.dart';
|
||||||
|
// import 'package:kochkomplize/main.dart';
|
||||||
|
// import 'package:kochkomplize/menu.dart';
|
||||||
|
//
|
||||||
|
// Widget buildMenu() {
|
||||||
|
// return MaterialApp(
|
||||||
|
// home: Scaffold(
|
||||||
|
// body: Menu(onMenuItemSelected: (menuItem) {}),
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// void main() {
|
||||||
|
// testWidgets('Check menu text', (WidgetTester tester) async {
|
||||||
|
// await tester.pumpWidget(buildMenu());
|
||||||
|
// expect(find.text('Meine Rezepte'), findsOneWidget);
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// testWidgets('Check number of list items', (WidgetTester tester) async {
|
||||||
|
// await tester.pumpWidget(const MyApp());
|
||||||
|
// expect(find.byType(GestureDetector), findsNWidgets(2));
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// }
|
|
@ -0,0 +1,22 @@
|
||||||
|
// import 'package:flutter_test/flutter_test.dart';
|
||||||
|
// import 'package:firebase_core/firebase_core.dart';
|
||||||
|
// import 'package:kochkomplize/main.dart';
|
||||||
|
// import 'package:kochkomplize/recipesoverview.dart';
|
||||||
|
// import 'package:kochkomplize/startpage.dart';
|
||||||
|
//
|
||||||
|
// void main() {
|
||||||
|
// test('_MyHomePageState should update selected menu content', () {
|
||||||
|
// final state = _MyHomePageState();
|
||||||
|
//
|
||||||
|
// state._onMenuItemSelected('Meine Rezepte');
|
||||||
|
// expect(state._selectedMenuContent, isInstanceOf<RecipesOverview>());
|
||||||
|
//
|
||||||
|
// state._onMenuItemSelected('Startseite');
|
||||||
|
// expect(state._selectedMenuContent, isInstanceOf<Startpage>());
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// test('Firebase initializes correctly', () async {
|
||||||
|
// await main(); // Ihr main-Methodenaufruf
|
||||||
|
// expect(Firebase.apps.length, isNonZero);
|
||||||
|
// });
|
||||||
|
// }
|
|
@ -1,108 +1,21 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:kochkomplize/main.dart';
|
import 'package:kochkomplize/main.dart';
|
||||||
import 'package:kochkomplize/menu.dart';
|
import 'package:kochkomplize/recipesoverview.dart';
|
||||||
import 'package:kochkomplize/recipeformpage.dart';
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
testWidgets('Menu navigation test', (WidgetTester tester) async {
|
||||||
|
await tester.pumpWidget(const MyApp());
|
||||||
|
|
||||||
testWidgets('Menu renders correctly', (WidgetTester tester) async {
|
// Öffne das Menü
|
||||||
void onMenuItemSelectedMock(String item) {}
|
await tester.tap(find.byIcon(Icons.menu));
|
||||||
|
|
||||||
// Verwenden Sie einen GlobalKey, um auf den Scaffold zuzugreifen
|
|
||||||
GlobalKey<ScaffoldState> scaffoldKey = GlobalKey();
|
|
||||||
|
|
||||||
await tester.pumpWidget(MaterialApp(home: Scaffold(key: scaffoldKey, drawer: Menu(onMenuItemSelected: onMenuItemSelectedMock))));
|
|
||||||
|
|
||||||
// Öffnen Sie den Drawer programmatisch
|
|
||||||
scaffoldKey.currentState!.openDrawer();
|
|
||||||
await tester.pumpAndSettle(); // Warten, bis die Animation abgeschlossen ist
|
|
||||||
|
|
||||||
// Überprüfen Sie nun, ob die Elemente im Drawer vorhanden sind
|
|
||||||
expect(find.byType(Drawer), findsOneWidget);
|
|
||||||
expect(find.text('Hauptmenü'), findsOneWidget);
|
|
||||||
expect(find.text('Startseite'), findsOneWidget);
|
|
||||||
expect(find.text('Meine Rezepte'), findsOneWidget);
|
|
||||||
});
|
|
||||||
|
|
||||||
testWidgets('Tapping each menu item calls onMenuItemSelected with correct item', (WidgetTester tester) async {
|
|
||||||
String selectedMenuItem = '';
|
|
||||||
|
|
||||||
void onMenuItemSelectedMock(String item) {
|
|
||||||
selectedMenuItem = item;
|
|
||||||
}
|
|
||||||
|
|
||||||
GlobalKey<ScaffoldState> scaffoldKey = GlobalKey();
|
|
||||||
|
|
||||||
await tester.pumpWidget(MaterialApp(home: Scaffold(key: scaffoldKey, drawer: Menu(onMenuItemSelected: onMenuItemSelectedMock))));
|
|
||||||
|
|
||||||
scaffoldKey.currentState!.openDrawer();
|
|
||||||
await tester.pumpAndSettle(); // Warten, bis die Animation abgeschlossen ist
|
|
||||||
|
|
||||||
// Tippen Sie auf das Menüelement 'Startseite' und überprüfen Sie die Funktionalität
|
|
||||||
await tester.tap(find.text('Startseite'));
|
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
expect(selectedMenuItem, 'Startseite');
|
|
||||||
|
|
||||||
// Wiederholen Sie den Vorgang für 'Meine Rezepte'
|
// Wähle einen Menüpunkt
|
||||||
scaffoldKey.currentState!.openDrawer();
|
|
||||||
await tester.pumpAndSettle();
|
|
||||||
await tester.tap(find.text('Meine Rezepte'));
|
await tester.tap(find.text('Meine Rezepte'));
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
expect(selectedMenuItem, 'Meine Rezepte');
|
|
||||||
|
|
||||||
// Hier können Sie weitere Tests für andere Menüpunkte hinzufügen
|
|
||||||
});
|
|
||||||
|
|
||||||
testWidgets('Drawer closes after an item is selected', (WidgetTester tester) async {
|
|
||||||
void onMenuItemSelectedMock(String item) {}
|
|
||||||
|
|
||||||
GlobalKey<ScaffoldState> scaffoldKey = GlobalKey();
|
|
||||||
|
|
||||||
await tester.pumpWidget(MaterialApp(home: Scaffold(key: scaffoldKey, drawer: Menu(onMenuItemSelected: onMenuItemSelectedMock))));
|
|
||||||
|
|
||||||
scaffoldKey.currentState!.openDrawer();
|
|
||||||
await tester.pumpAndSettle();
|
|
||||||
|
|
||||||
await tester.tap(find.text('Startseite'));
|
|
||||||
await tester.pumpAndSettle();
|
|
||||||
|
|
||||||
// Überprüfen Sie, ob der Drawer geschlossen ist
|
|
||||||
expect(scaffoldKey.currentState!.isDrawerOpen, isFalse);
|
|
||||||
});
|
|
||||||
|
|
||||||
testWidgets('Drawer header renders correctly', (WidgetTester tester) async {
|
|
||||||
// Erstellen Sie eine Mock-Funktion, die einen String als Parameter erwartet
|
|
||||||
void onMenuItemSelectedMock(String item) {}
|
|
||||||
|
|
||||||
GlobalKey<ScaffoldState> scaffoldKey = GlobalKey();
|
|
||||||
|
|
||||||
await tester.pumpWidget(MaterialApp(
|
|
||||||
home: Scaffold(key: scaffoldKey, drawer: Menu(onMenuItemSelected: onMenuItemSelectedMock))
|
|
||||||
));
|
|
||||||
|
|
||||||
scaffoldKey.currentState!.openDrawer();
|
|
||||||
await tester.pumpAndSettle();
|
|
||||||
|
|
||||||
// Überprüfen Sie, ob der DrawerHeader vorhanden ist
|
|
||||||
expect(find.byType(DrawerHeader), findsOneWidget);
|
|
||||||
expect(find.text('Hauptmenü'), findsOneWidget);
|
|
||||||
});
|
|
||||||
|
|
||||||
testWidgets('Recipeformpage has form fields', (WidgetTester tester) async {
|
|
||||||
await tester.pumpWidget(const MaterialApp(home: Recipeformpage()));
|
|
||||||
|
|
||||||
// Prüfen Sie, ob die Formularfelder vorhanden sind
|
|
||||||
expect(find.byType(TextFormField), findsWidgets);
|
|
||||||
// Prüfen Sie den Speichern-Button
|
|
||||||
expect(find.byType(FloatingActionButton), findsOneWidget);
|
|
||||||
});
|
|
||||||
|
|
||||||
testWidgets('MyHomePage renders correctly', (WidgetTester tester) async {
|
|
||||||
await tester.pumpWidget(const MaterialApp(home: MyHomePage(title: 'Kochkomplize')));
|
|
||||||
|
|
||||||
// Überprüfen Sie, ob der Titel korrekt angezeigt wird
|
|
||||||
expect(find.text('Kochkomplize'), findsOneWidget);
|
|
||||||
|
|
||||||
|
// Überprüfe, ob das richtige Widget angezeigt wird
|
||||||
|
expect(find.byType(RecipesOverview), findsOneWidget);
|
||||||
});
|
});
|
||||||
}
|
}
|
Loading…
Reference in New Issue