bugfix in creatview and regenerated linux folde
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -837,7 +837,6 @@ Temporary Items
|
|||||||
linux/flutter/generated_plugin_registrant.cc
|
linux/flutter/generated_plugin_registrant.cc
|
||||||
linux/flutter/generated_plugin_registrant.h
|
linux/flutter/generated_plugin_registrant.h
|
||||||
linux/flutter/generated_plugins.cmake
|
linux/flutter/generated_plugins.cmake
|
||||||
linux/flutter/CMakeLists.txt
|
|
||||||
|
|
||||||
|
|
||||||
### ---------------------------- References ---------------------------- ###
|
### ---------------------------- References ---------------------------- ###
|
||||||
|
|||||||
25
.metadata
25
.metadata
@@ -4,7 +4,7 @@
|
|||||||
# This file should be version controlled and should not be manually edited.
|
# This file should be version controlled and should not be manually edited.
|
||||||
|
|
||||||
version:
|
version:
|
||||||
revision: "ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a"
|
revision: "2f708eb8396e362e280fac22cf171c2cb467343c"
|
||||||
channel: "stable"
|
channel: "stable"
|
||||||
|
|
||||||
project_type: app
|
project_type: app
|
||||||
@@ -13,26 +13,11 @@ project_type: app
|
|||||||
migration:
|
migration:
|
||||||
platforms:
|
platforms:
|
||||||
- platform: root
|
- platform: root
|
||||||
create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
|
create_revision: 2f708eb8396e362e280fac22cf171c2cb467343c
|
||||||
base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
|
base_revision: 2f708eb8396e362e280fac22cf171c2cb467343c
|
||||||
- platform: android
|
|
||||||
create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
|
|
||||||
base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
|
|
||||||
- platform: ios
|
|
||||||
create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
|
|
||||||
base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
|
|
||||||
- platform: linux
|
- platform: linux
|
||||||
create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
|
create_revision: 2f708eb8396e362e280fac22cf171c2cb467343c
|
||||||
base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
|
base_revision: 2f708eb8396e362e280fac22cf171c2cb467343c
|
||||||
- platform: macos
|
|
||||||
create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
|
|
||||||
base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
|
|
||||||
- platform: web
|
|
||||||
create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
|
|
||||||
base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
|
|
||||||
- platform: windows
|
|
||||||
create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
|
|
||||||
base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
|
|
||||||
|
|
||||||
# User provided section
|
# User provided section
|
||||||
|
|
||||||
|
|||||||
@@ -13,13 +13,13 @@ class AddRecipeInfoWidget extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _AddRecipeInfoWidgetState extends State<AddRecipeInfoWidget> {
|
class _AddRecipeInfoWidgetState extends State<AddRecipeInfoWidget> {
|
||||||
late Recipe? recipe;
|
late RecipeProvider recipeProvider;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
recipe = Provider.of<RecipeProvider>(context, listen: true).recipe;
|
recipeProvider = Provider.of<RecipeProvider>(context, listen: true);
|
||||||
|
|
||||||
if (recipe == null) {
|
if (recipeProvider.recipe == null) {
|
||||||
return const Center(
|
return const Center(
|
||||||
child: CircularProgressIndicator(),
|
child: CircularProgressIndicator(),
|
||||||
);
|
);
|
||||||
@@ -28,34 +28,37 @@ class _AddRecipeInfoWidgetState extends State<AddRecipeInfoWidget> {
|
|||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
TextFormField(
|
TextFormField(
|
||||||
|
initialValue: recipeProvider.recipe!.title,
|
||||||
onTapOutside: (event) => FocusScope.of(context).unfocus(),
|
onTapOutside: (event) => FocusScope.of(context).unfocus(),
|
||||||
onChanged: (value) => recipe!.title = value,
|
onChanged: (value) => recipeProvider.recipe!.title = value,
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
label: Text('Title'),
|
label: Text('Title'),
|
||||||
),
|
),
|
||||||
style: TextStyle(color: Theme.of(context).colorScheme.onBackground),
|
style: TextStyle(color: Theme.of(context).colorScheme.onBackground),
|
||||||
),
|
),
|
||||||
TextFormField(
|
TextFormField(
|
||||||
|
initialValue: recipeProvider.recipe!.description,
|
||||||
onTapOutside: (event) => FocusScope.of(context).unfocus(),
|
onTapOutside: (event) => FocusScope.of(context).unfocus(),
|
||||||
minLines: 1,
|
minLines: 1,
|
||||||
maxLines: 4,
|
maxLines: 4,
|
||||||
onChanged: (value) => recipe!.description = value,
|
onChanged: (value) => recipeProvider.recipe!.description = value,
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
label: Text('Description'),
|
label: Text('Description'),
|
||||||
),
|
),
|
||||||
style: TextStyle(color: Theme.of(context).colorScheme.onBackground),
|
style: TextStyle(color: Theme.of(context).colorScheme.onBackground),
|
||||||
),
|
),
|
||||||
DropdownMenu<Difficulty>(
|
DropdownMenu<Difficulty>(
|
||||||
|
initialSelection: recipeProvider.recipe!.difficulty,
|
||||||
dropdownMenuEntries: DifficultyUtil.getDropdownList(),
|
dropdownMenuEntries: DifficultyUtil.getDropdownList(),
|
||||||
onSelected: (value) =>
|
onSelected: (value) => recipeProvider.recipe!.difficulty =
|
||||||
recipe!.difficulty = value ?? Difficulty.notSelected,
|
value ?? Difficulty.notSelected,
|
||||||
label: const Text('Difficulty'),
|
label: const Text('Difficulty'),
|
||||||
textStyle:
|
textStyle:
|
||||||
TextStyle(color: Theme.of(context).colorScheme.onBackground),
|
TextStyle(color: Theme.of(context).colorScheme.onBackground),
|
||||||
),
|
),
|
||||||
// ElevatedButton(
|
// ElevatedButton(
|
||||||
// onPressed: _openIngredientBottomSheet,
|
// onPressed: _openIngredientBottomSheet,
|
||||||
// child: const Text('Add Ingredient'),
|
// child: const Text('Add Ingred ient'),
|
||||||
// ),
|
// ),
|
||||||
// Expanded(
|
// Expanded(
|
||||||
// child: ListView.separated(
|
// child: ListView.separated(
|
||||||
|
|||||||
88
linux/flutter/CMakeLists.txt
Normal file
88
linux/flutter/CMakeLists.txt
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
# This file controls Flutter-level build steps. It should not be edited.
|
||||||
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
|
||||||
|
set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
|
||||||
|
|
||||||
|
# Configuration provided via flutter tool.
|
||||||
|
include(${EPHEMERAL_DIR}/generated_config.cmake)
|
||||||
|
|
||||||
|
# TODO: Move the rest of this into files in ephemeral. See
|
||||||
|
# https://github.com/flutter/flutter/issues/57146.
|
||||||
|
|
||||||
|
# Serves the same purpose as list(TRANSFORM ... PREPEND ...),
|
||||||
|
# which isn't available in 3.10.
|
||||||
|
function(list_prepend LIST_NAME PREFIX)
|
||||||
|
set(NEW_LIST "")
|
||||||
|
foreach(element ${${LIST_NAME}})
|
||||||
|
list(APPEND NEW_LIST "${PREFIX}${element}")
|
||||||
|
endforeach(element)
|
||||||
|
set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# === Flutter Library ===
|
||||||
|
# System-level dependencies.
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
|
||||||
|
pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
|
||||||
|
pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
|
||||||
|
|
||||||
|
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so")
|
||||||
|
|
||||||
|
# Published to parent scope for install step.
|
||||||
|
set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
|
||||||
|
set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
|
||||||
|
set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
|
||||||
|
set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE)
|
||||||
|
|
||||||
|
list(APPEND FLUTTER_LIBRARY_HEADERS
|
||||||
|
"fl_basic_message_channel.h"
|
||||||
|
"fl_binary_codec.h"
|
||||||
|
"fl_binary_messenger.h"
|
||||||
|
"fl_dart_project.h"
|
||||||
|
"fl_engine.h"
|
||||||
|
"fl_json_message_codec.h"
|
||||||
|
"fl_json_method_codec.h"
|
||||||
|
"fl_message_codec.h"
|
||||||
|
"fl_method_call.h"
|
||||||
|
"fl_method_channel.h"
|
||||||
|
"fl_method_codec.h"
|
||||||
|
"fl_method_response.h"
|
||||||
|
"fl_plugin_registrar.h"
|
||||||
|
"fl_plugin_registry.h"
|
||||||
|
"fl_standard_message_codec.h"
|
||||||
|
"fl_standard_method_codec.h"
|
||||||
|
"fl_string_codec.h"
|
||||||
|
"fl_value.h"
|
||||||
|
"fl_view.h"
|
||||||
|
"flutter_linux.h"
|
||||||
|
)
|
||||||
|
list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/")
|
||||||
|
add_library(flutter INTERFACE)
|
||||||
|
target_include_directories(flutter INTERFACE
|
||||||
|
"${EPHEMERAL_DIR}"
|
||||||
|
)
|
||||||
|
target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}")
|
||||||
|
target_link_libraries(flutter INTERFACE
|
||||||
|
PkgConfig::GTK
|
||||||
|
PkgConfig::GLIB
|
||||||
|
PkgConfig::GIO
|
||||||
|
)
|
||||||
|
add_dependencies(flutter flutter_assemble)
|
||||||
|
|
||||||
|
# === Flutter tool backend ===
|
||||||
|
# _phony_ is a non-existent file to force this command to run every time,
|
||||||
|
# since currently there's no way to get a full input/output list from the
|
||||||
|
# flutter tool.
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/_phony_
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E env
|
||||||
|
${FLUTTER_TOOL_ENVIRONMENT}
|
||||||
|
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
|
||||||
|
${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
|
add_custom_target(flutter_assemble DEPENDS
|
||||||
|
"${FLUTTER_LIBRARY}"
|
||||||
|
${FLUTTER_LIBRARY_HEADERS}
|
||||||
|
)
|
||||||
30
test/widget_test.dart
Normal file
30
test/widget_test.dart
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
// This is a basic Flutter widget test.
|
||||||
|
//
|
||||||
|
// To perform an interaction with a widget in your test, use the WidgetTester
|
||||||
|
// utility in the flutter_test package. For example, you can send tap and scroll
|
||||||
|
// gestures. You can also use WidgetTester to find child widgets in the widget
|
||||||
|
// tree, read text, and verify that the values of widget properties are correct.
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
|
import 'package:rezepte/main.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
||||||
|
// Build our app and trigger a frame.
|
||||||
|
await tester.pumpWidget(const MyApp());
|
||||||
|
|
||||||
|
// Verify that our counter starts at 0.
|
||||||
|
expect(find.text('0'), findsOneWidget);
|
||||||
|
expect(find.text('1'), findsNothing);
|
||||||
|
|
||||||
|
// Tap the '+' icon and trigger a frame.
|
||||||
|
await tester.tap(find.byIcon(Icons.add));
|
||||||
|
await tester.pump();
|
||||||
|
|
||||||
|
// Verify that our counter has incremented.
|
||||||
|
expect(find.text('0'), findsNothing);
|
||||||
|
expect(find.text('1'), findsOneWidget);
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user