Compare commits
14 Commits
Author | SHA1 | Date |
---|---|---|
Thomas Hassenstein | bc0cba7286 | |
Thomas Hassenstein | 388e2deb61 | |
Thomas Hassenstein | 06e62dc7e5 | |
Thomas Hassenstein | d409005e4c | |
Thomas Hassenstein | 83b02eca1a | |
Thomas Hassenstein | e3d9c8666c | |
Thomas Hassenstein | 684d7fc15c | |
Thomas Hassenstein | b89ff0770e | |
Thomas Hassenstein | 918b51258d | |
Thomas Hassenstein | 5d7eb7ec3b | |
Thomas Hassenstein | 6fc8322202 | |
Thomas Hassenstein | daec63e58b | |
Thomas Hassenstein | f7f1d8855a | |
Thomas Hassenstein | 81105d0067 |
16
README.md
16
README.md
|
@ -1,7 +1,11 @@
|
|||
# kochkomplize
|
||||
Helfer zur Digitalisierung von alten Kochrezepten.
|
||||
|
||||
**Bild/Skizze:**
|
||||
Ein Bild wie die Applikation aussehen soll findet man unter assets/images mit dem Namen skizze.png
|
||||
**Bild/Ablauf:**
|
||||
![Startseite](assets/images/Kochkomplize_Startseite.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:**
|
||||
1. Die App soll grundsätzlich im Browser als auch auf Mobilen Endgeräten laufen. (entweder iOS oder Android)
|
||||
|
@ -10,8 +14,14 @@ Ein Bild wie die Applikation aussehen soll findet man unter assets/images mit de
|
|||
4. Es soll möglich sein alte handgeschriebene Texte Bildern zu importieren.
|
||||
5. Rezepte sollen gelöscht werden können.
|
||||
|
||||
|
||||
6. Bonus: Texterkennung wenn die Packages es auch für Web zulassen.
|
||||
|
||||
**Eingesetzte Technologien:**
|
||||
Flutter
|
||||
Dart
|
||||
Firebase
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 64 KiB |
Binary file not shown.
After Width: | Height: | Size: 76 KiB |
Binary file not shown.
After Width: | Height: | Size: 71 KiB |
Binary file not shown.
After Width: | Height: | Size: 325 KiB |
|
@ -1,11 +0,0 @@
|
|||
// 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,17 +11,11 @@ dependencies:
|
|||
flutter:
|
||||
sdk: flutter
|
||||
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_database: ^10.4.0
|
||||
firebase_storage: ^11.6.0
|
||||
path_provider: ^2.1.2
|
||||
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
|
||||
|
||||
dev_dependencies:
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
// 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));
|
||||
// });
|
||||
//
|
||||
// }
|
|
@ -1,22 +0,0 @@
|
|||
// 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,21 +1,108 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:kochkomplize/main.dart';
|
||||
import 'package:kochkomplize/recipesoverview.dart';
|
||||
import 'package:kochkomplize/menu.dart';
|
||||
import 'package:kochkomplize/recipeformpage.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Menu navigation test', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(const MyApp());
|
||||
|
||||
// Öffne das Menü
|
||||
await tester.tap(find.byIcon(Icons.menu));
|
||||
testWidgets('Menu renders correctly', (WidgetTester tester) async {
|
||||
void onMenuItemSelectedMock(String item) {}
|
||||
|
||||
// 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();
|
||||
expect(selectedMenuItem, 'Startseite');
|
||||
|
||||
// Wähle einen Menüpunkt
|
||||
// Wiederholen Sie den Vorgang für 'Meine Rezepte'
|
||||
scaffoldKey.currentState!.openDrawer();
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text('Meine Rezepte'));
|
||||
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