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 |
26
README.md
26
README.md
|
@ -1,17 +1,27 @@
|
||||||
# kochkomplize
|
# kochkomplize
|
||||||
|
Helfer zur Digitalisierung von alten Kochrezepten.
|
||||||
|
|
||||||
**Bild/Skizze:**
|
**Bild/Ablauf:**
|
||||||
Ein Bild wie die Applikation aussehen soll findet man unter assets/images mit dem Namen skizze.png
|
![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:**
|
**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)
|
||||||
2. Es soll möglich sein Rezepte abzuspeichern und neue anzulegen.
|
2. Es soll möglich sein Rezepte abzuspeichern und neue anzulegen.
|
||||||
3. Man soll Bilder für Rezepte hochladen können.
|
3. Man soll Bilder für Rezepte hochladen können.
|
||||||
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.
|
||||||
|
|
||||||
|
**Eingesetzte Technologien:**
|
||||||
|
Flutter
|
||||||
|
Dart
|
||||||
|
Firebase
|
||||||
|
|
||||||
|
|
||||||
6. Bonus: Texterkennung wenn die Packages es auch für Web zulassen.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
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
|
|
70
pubspec.yaml
70
pubspec.yaml
|
@ -1,38 +1,32 @@
|
||||||
name: kochkomplize
|
name: kochkomplize
|
||||||
description: "Kochhilfe mit Rezepten und Texterkennung"
|
description: "Kochhilfe mit Rezepten und Texterkennung"
|
||||||
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||||
|
|
||||||
version: 1.0.0+1
|
version: 1.0.0+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.2.0 <4.0.0'
|
sdk: '>=3.2.0 <4.0.0'
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
#sqflite: ^2.3.0
|
firebase_core: ^2.24.2
|
||||||
#sqlite3_flutter_libs: ^0.5.18
|
firebase_database: ^10.4.0
|
||||||
#sqlite3: ^2.3.0
|
firebase_storage: ^11.6.0
|
||||||
firebase_core: ^2.24.2
|
path_provider: ^2.1.2
|
||||||
firebase_database: ^10.4.0
|
image_picker: ^1.0.7
|
||||||
firebase_storage: ^11.6.0
|
path: ^1.8.0
|
||||||
path_provider: ^2.1.2
|
|
||||||
image_picker: ^1.0.7
|
dev_dependencies:
|
||||||
#cloud_firestore: ^4.14.0
|
flutter_test:
|
||||||
#ocr_scan_text: 1.3.1
|
sdk: flutter
|
||||||
google_mlkit_text_recognition: ^0.11.0
|
flutter_lints: ^2.0.0
|
||||||
path: ^1.8.0
|
|
||||||
|
flutter:
|
||||||
dev_dependencies:
|
uses-material-design: true
|
||||||
flutter_test:
|
assets:
|
||||||
sdk: flutter
|
- assets/images/
|
||||||
flutter_lints: ^2.0.0
|
- assets/database/Kochkomplize.db
|
||||||
|
|
||||||
flutter:
|
|
||||||
uses-material-design: true
|
|
||||||
assets:
|
|
||||||
- assets/images/
|
|
||||||
- assets/database/Kochkomplize.db
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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/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/recipesoverview.dart';
|
import 'package:kochkomplize/menu.dart';
|
||||||
|
import 'package:kochkomplize/recipeformpage.dart';
|
||||||
void main() {
|
|
||||||
testWidgets('Menu navigation test', (WidgetTester tester) async {
|
void main() {
|
||||||
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));
|
|
||||||
await tester.pumpAndSettle();
|
// Verwenden Sie einen GlobalKey, um auf den Scaffold zuzugreifen
|
||||||
|
GlobalKey<ScaffoldState> scaffoldKey = GlobalKey();
|
||||||
// Wähle einen Menüpunkt
|
|
||||||
await tester.tap(find.text('Meine Rezepte'));
|
await tester.pumpWidget(MaterialApp(home: Scaffold(key: scaffoldKey, drawer: Menu(onMenuItemSelected: onMenuItemSelectedMock))));
|
||||||
await tester.pumpAndSettle();
|
|
||||||
|
// Öffnen Sie den Drawer programmatisch
|
||||||
// Überprüfe, ob das richtige Widget angezeigt wird
|
scaffoldKey.currentState!.openDrawer();
|
||||||
expect(find.byType(RecipesOverview), findsOneWidget);
|
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');
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
Loading…
Reference in New Issue