Compare commits
No commits in common. "master" and "detached" have entirely different histories.
26
README.md
26
README.md
|
@ -1,27 +1,17 @@
|
||||||
# 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)
|
||||||
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.
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
|
70
pubspec.yaml
70
pubspec.yaml
|
@ -1,32 +1,38 @@
|
||||||
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
|
||||||
firebase_core: ^2.24.2
|
#sqflite: ^2.3.0
|
||||||
firebase_database: ^10.4.0
|
#sqlite3_flutter_libs: ^0.5.18
|
||||||
firebase_storage: ^11.6.0
|
#sqlite3: ^2.3.0
|
||||||
path_provider: ^2.1.2
|
firebase_core: ^2.24.2
|
||||||
image_picker: ^1.0.7
|
firebase_database: ^10.4.0
|
||||||
path: ^1.8.0
|
firebase_storage: ^11.6.0
|
||||||
|
path_provider: ^2.1.2
|
||||||
dev_dependencies:
|
image_picker: ^1.0.7
|
||||||
flutter_test:
|
#cloud_firestore: ^4.14.0
|
||||||
sdk: flutter
|
#ocr_scan_text: 1.3.1
|
||||||
flutter_lints: ^2.0.0
|
google_mlkit_text_recognition: ^0.11.0
|
||||||
|
path: ^1.8.0
|
||||||
flutter:
|
|
||||||
uses-material-design: true
|
dev_dependencies:
|
||||||
assets:
|
flutter_test:
|
||||||
- assets/images/
|
sdk: flutter
|
||||||
- assets/database/Kochkomplize.db
|
flutter_lints: ^2.0.0
|
||||||
|
|
||||||
|
flutter:
|
||||||
|
uses-material-design: true
|
||||||
|
assets:
|
||||||
|
- assets/images/
|
||||||
|
- assets/database/Kochkomplize.db
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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 {
|
|
||||||
void onMenuItemSelectedMock(String item) {}
|
// Öffne das Menü
|
||||||
|
await tester.tap(find.byIcon(Icons.menu));
|
||||||
// Verwenden Sie einen GlobalKey, um auf den Scaffold zuzugreifen
|
await tester.pumpAndSettle();
|
||||||
GlobalKey<ScaffoldState> scaffoldKey = GlobalKey();
|
|
||||||
|
// Wähle einen Menüpunkt
|
||||||
await tester.pumpWidget(MaterialApp(home: Scaffold(key: scaffoldKey, drawer: Menu(onMenuItemSelected: onMenuItemSelectedMock))));
|
await tester.tap(find.text('Meine Rezepte'));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
// Öffnen Sie den Drawer programmatisch
|
|
||||||
scaffoldKey.currentState!.openDrawer();
|
// Überprüfe, ob das richtige Widget angezeigt wird
|
||||||
await tester.pumpAndSettle(); // Warten, bis die Animation abgeschlossen ist
|
expect(find.byType(RecipesOverview), findsOneWidget);
|
||||||
|
});
|
||||||
// Ü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