5 |
Libraries Used
6 |
7 | - Design UI -> Figma
8 | - State Management -> Provider
9 | - Authentification -> Firebase Auth
10 | - Design Pattern -> MVVM
11 |
12 |
13 |
14 |
Features
15 |
16 |
Splash Page - Login Page - Register Page
17 |
23 |
24 |
25 |
Home Page - Menu Page - Profil Page
26 |
31 |
32 |
Reservation Page - Menu - Review - Date
33 |
39 |
40 |
Notifications Page - Favorite Page
41 |
42 |

43 |

44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/lib/feature/reservation_page/viewModel/reservation_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:intl/intl.dart';
3 | import 'package:restaurant_app/feature/reservation_page/model/reservation_model.dart';
4 | import 'package:restaurant_app/products/mixin/reservation_category.dart';
5 |
6 | class ReservationViewModel extends ChangeNotifier {
7 | List
toTimeList = [
8 | "1",
9 | "2",
10 | "3",
11 | "4",
12 | "5",
13 | "6",
14 | "7",
15 | "8",
16 | "9",
17 | "10",
18 | "11",
19 | "12",
20 | "13",
21 | "14"
22 | ];
23 |
24 | List toTimeListSelect = [
25 | false,
26 | true,
27 | false,
28 | false,
29 | false,
30 | false,
31 | false,
32 | false,
33 | false,
34 | false,
35 | false,
36 | false,
37 | false,
38 | false,
39 | ];
40 |
41 | var formattedDate = DateFormat(' h:mm a, d MMM, EEEE').format(DateTime.now());
42 | String selectedToTime = "2";
43 | int selectedCategoryIndex = 0;
44 |
45 | double restoInfoHeight = 200 + 170 - kToolbarHeight;
46 |
47 | updateToList(int index) {
48 | toTimeListSelect[index] = !toTimeListSelect[index];
49 | toTimeListSelect[index] == true
50 | ? selectedToTime = toTimeList[index]
51 | : selectedToTime = ' ';
52 | notifyListeners();
53 |
54 | for (int i = 0; i < toTimeListSelect.length; i++) {
55 | toTimeListSelect[i] = false;
56 | notifyListeners();
57 | }
58 | toTimeListSelect[index] = !toTimeListSelect[index];
59 | toTimeListSelect[index] == true
60 | ? selectedToTime = toTimeList[index]
61 | : selectedToTime = ' ';
62 | notifyListeners();
63 | }
64 |
65 | dateToList(DateTime dateTime) {
66 | formattedDate = dateTime as String;
67 | notifyListeners();
68 | }
69 |
70 | scrollToCategory(int index) {
71 | if (selectedCategoryIndex != index) {
72 | int totalItems = 0;
73 |
74 | for (var i = 0; i < index; i++) {
75 | totalItems += allCategoryMenus[i].items.length;
76 | }
77 | scrollController.animateTo(
78 | restoInfoHeight + (116 * totalItems) + (50 * index),
79 | duration: const Duration(milliseconds: 500),
80 | curve: Curves.ease,
81 | );
82 |
83 | selectedCategoryIndex = index;
84 | notifyListeners();
85 | }
86 | }
87 |
88 | updateCategoryIndexOnScroll(double offset) {
89 | for (var i = 0; i < allCategoryMenus.length; i++) {
90 | if (i == 0) {
91 | if ((offset < breackPoints.first) & (selectedCategoryIndex != 0)) {
92 | selectedCategoryIndex = 0;
93 | notifyListeners();
94 | }
95 | } else {
96 | if ((breackPoints[i - 1] <= offset) & (offset < breackPoints[i])) {
97 | if (selectedCategoryIndex != i) {
98 | selectedCategoryIndex = i;
99 | notifyListeners();
100 | }
101 | }
102 | }
103 | }
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/lib/products/component/time_container_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:kartal/kartal.dart';
3 | import 'package:restaurant_app/core/constants/app_colors.dart';
4 | import 'package:restaurant_app/core/extensions/extension.dart';
5 |
6 | class TimeContainer extends StatefulWidget {
7 | const TimeContainer({Key? key}) : super(key: key);
8 |
9 | @override
10 | State createState() => _TimeContainerState();
11 | }
12 |
13 | class _TimeContainerState extends State {
14 | @override
15 | Widget build(BuildContext context) {
16 | return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
17 | SingleChildScrollView(
18 | scrollDirection: Axis.horizontal,
19 | child: Padding(
20 | padding: context.paddingLowHorizontalVertical,
21 | child: Row(children: [
22 | const TimeWidget(
23 | time: '11:00',
24 | ),
25 | SizedBox(
26 | width: context.dynamicWidth(0.03),
27 | ),
28 | const TimeWidget(
29 | time: '11:15',
30 | ),
31 | SizedBox(
32 | width: context.dynamicWidth(0.03),
33 | ),
34 | const TimeWidget(
35 | time: '11:30',
36 | ),
37 | SizedBox(
38 | width: context.dynamicWidth(0.03),
39 | ),
40 | const TimeWidget(
41 | time: '11:45',
42 | ),
43 | SizedBox(
44 | width: context.dynamicWidth(0.03),
45 | ),
46 | const TimeWidget(
47 | time: '12:00',
48 | ),
49 | SizedBox(
50 | width: context.dynamicWidth(0.03),
51 | ),
52 | const TimeWidget(
53 | time: '12:15',
54 | ),
55 | SizedBox(
56 | width: context.dynamicWidth(0.03),
57 | ),
58 | const TimeWidget(
59 | time: '12:30',
60 | ),
61 | SizedBox(
62 | width: context.dynamicWidth(0.03),
63 | ),
64 | const TimeWidget(
65 | time: '12:45',
66 | ),
67 | SizedBox(
68 | width: context.dynamicWidth(0.03),
69 | ),
70 | ]),
71 | ),
72 | ),
73 | ]);
74 | }
75 | }
76 |
77 | class TimeWidget extends StatelessWidget {
78 | final String time;
79 | const TimeWidget({
80 | Key? key,
81 | required this.time,
82 | }) : super(key: key);
83 |
84 | @override
85 | Widget build(BuildContext context) {
86 | return Container(
87 | height: context.dynamicHeight(0.05),
88 | width: context.dynamicWidth(0.18),
89 | decoration: context.timeDecoraiton,
90 | child: Center(
91 | child: Text(
92 | time,
93 | style: Theme.of(context).textTheme.titleLarge?.copyWith(
94 | color: AppColors.white,
95 | ),
96 | )),
97 | );
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/linux/flutter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # This file controls Flutter-level build steps. It should not be edited.
2 | cmake_minimum_required(VERSION 3.10)
3 |
4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
5 |
6 | # Configuration provided via flutter tool.
7 | include(${EPHEMERAL_DIR}/generated_config.cmake)
8 |
9 | # TODO: Move the rest of this into files in ephemeral. See
10 | # https://github.com/flutter/flutter/issues/57146.
11 |
12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...),
13 | # which isn't available in 3.10.
14 | function(list_prepend LIST_NAME PREFIX)
15 | set(NEW_LIST "")
16 | foreach(element ${${LIST_NAME}})
17 | list(APPEND NEW_LIST "${PREFIX}${element}")
18 | endforeach(element)
19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE)
20 | endfunction()
21 |
22 | # === Flutter Library ===
23 | # System-level dependencies.
24 | find_package(PkgConfig REQUIRED)
25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
28 |
29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so")
30 |
31 | # Published to parent scope for install step.
32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE)
36 |
37 | list(APPEND FLUTTER_LIBRARY_HEADERS
38 | "fl_basic_message_channel.h"
39 | "fl_binary_codec.h"
40 | "fl_binary_messenger.h"
41 | "fl_dart_project.h"
42 | "fl_engine.h"
43 | "fl_json_message_codec.h"
44 | "fl_json_method_codec.h"
45 | "fl_message_codec.h"
46 | "fl_method_call.h"
47 | "fl_method_channel.h"
48 | "fl_method_codec.h"
49 | "fl_method_response.h"
50 | "fl_plugin_registrar.h"
51 | "fl_plugin_registry.h"
52 | "fl_standard_message_codec.h"
53 | "fl_standard_method_codec.h"
54 | "fl_string_codec.h"
55 | "fl_value.h"
56 | "fl_view.h"
57 | "flutter_linux.h"
58 | )
59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/")
60 | add_library(flutter INTERFACE)
61 | target_include_directories(flutter INTERFACE
62 | "${EPHEMERAL_DIR}"
63 | )
64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}")
65 | target_link_libraries(flutter INTERFACE
66 | PkgConfig::GTK
67 | PkgConfig::GLIB
68 | PkgConfig::GIO
69 | )
70 | add_dependencies(flutter flutter_assemble)
71 |
72 | # === Flutter tool backend ===
73 | # _phony_ is a non-existent file to force this command to run every time,
74 | # since currently there's no way to get a full input/output list from the
75 | # flutter tool.
76 | add_custom_command(
77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_
79 | COMMAND ${CMAKE_COMMAND} -E env
80 | ${FLUTTER_TOOL_ENVIRONMENT}
81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}
83 | VERBATIM
84 | )
85 | add_custom_target(flutter_assemble DEPENDS
86 | "${FLUTTER_LIBRARY}"
87 | ${FLUTTER_LIBRARY_HEADERS}
88 | )
89 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/lib/products/component/reservation_appbar.dart:
--------------------------------------------------------------------------------
1 | import 'package:carousel_slider/carousel_slider.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:restaurant_app/core/constants/app_colors.dart';
4 | import 'package:restaurant_app/core/constants/app_string.dart';
5 | import 'package:restaurant_app/core/constants/image_const.dart';
6 | import 'package:kartal/kartal.dart';
7 | import 'package:restaurant_app/core/extensions/extension.dart';
8 |
9 | class RestaruantAppBar extends StatelessWidget {
10 | const RestaruantAppBar({
11 | Key? key,
12 | }) : super(key: key);
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | List list = [
17 | const PngImage(name: ImageItems.resto4),
18 | const PngImage(name: ImageItems.resto1),
19 | ];
20 | return SliverAppBar(
21 | expandedHeight: context.dynamicHeight(0.21),
22 | backgroundColor: AppColors.white,
23 | elevation: 0,
24 | pinned: true,
25 | flexibleSpace: FlexibleSpaceBar(
26 | background: _stackWidget(list, context),
27 | ),
28 | leading: Padding(
29 | padding: context.paddingNormalLeft,
30 | child: CircleAvatar(
31 | backgroundColor: AppColors.white,
32 | child: IconButton(
33 | icon: const Icon(Icons.arrow_back_ios_rounded),
34 | onPressed: () {},
35 | ),
36 | ),
37 | ),
38 | actions: [
39 | CircleAvatar(
40 | backgroundColor: AppColors.white,
41 | child: IconButton(
42 | icon: const Icon(Icons.bookmark_outline),
43 | onPressed: () {},
44 | ),
45 | ),
46 | Padding(
47 | padding: context.paddingLowHorizontal,
48 | child: CircleAvatar(
49 | backgroundColor: AppColors.white,
50 | child: IconButton(
51 | icon: const Icon(Icons.share),
52 | onPressed: () {},
53 | ),
54 | ),
55 | ),
56 | ],
57 | );
58 | }
59 |
60 | Stack _stackWidget(List list, BuildContext context) {
61 | return Stack(
62 | children: [
63 | CarouselSlider(
64 | options: CarouselOptions(
65 | viewportFraction: 1.0,
66 | enlargeCenterPage: false,
67 | ),
68 | items: list
69 | .map((item) => SizedBox(
70 | height: context.dynamicHeight(0.10),
71 | width: MediaQuery.of(context).size.width,
72 | child: item))
73 | .toList(),
74 | ),
75 | Padding(
76 | padding: context.pagePaddingTop,
77 | child: Center(
78 | child: Container(
79 | height: context.dynamicHeight(0.04),
80 | width: context.dynamicWidth(0.40),
81 | decoration: context.middelDecoraiton,
82 | child: Center(
83 | child: Text(
84 | StringConstant.seeAll,
85 | style: Theme.of(context).textTheme.titleMedium?.copyWith(
86 | color: AppColors.white,
87 | ),
88 | ),
89 | ),
90 | ),
91 | ),
92 | ),
93 | ],
94 | );
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/lib/products/component/reservation_categories.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:restaurant_app/core/constants/app_colors.dart';
3 | import 'package:restaurant_app/core/extensions/extension.dart';
4 | import 'package:restaurant_app/feature/reservation_page/model/reservation_model.dart';
5 |
6 | class RestaurantCategories extends SliverPersistentHeaderDelegate {
7 | final ValueChanged onChanged;
8 | final int selectedIndex;
9 | RestaurantCategories({
10 | required this.onChanged,
11 | required this.selectedIndex,
12 | });
13 |
14 | @override
15 | Widget build(
16 | BuildContext context, double shrinkOffset, bool overlapsContent) {
17 | return Container(
18 | height: 52,
19 | color: AppColors.white,
20 | child: Categories(onChanged: onChanged, selectedIndex: selectedIndex));
21 | }
22 |
23 | @override
24 | double get maxExtent => 52;
25 |
26 | @override
27 | double get minExtent => 52;
28 |
29 | @override
30 | bool shouldRebuild(covariant SliverPersistentHeaderDelegate oldDelegate) {
31 | return true;
32 | }
33 | }
34 |
35 | class Categories extends StatefulWidget {
36 | final ValueChanged onChanged;
37 | final int selectedIndex;
38 | const Categories(
39 | {Key? key, required this.onChanged, required this.selectedIndex})
40 | : super(key: key);
41 |
42 | @override
43 | State createState() => _CategoriesState();
44 | }
45 |
46 | class _CategoriesState extends State {
47 | late ScrollController controller;
48 |
49 | @override
50 | void initState() {
51 | controller = ScrollController();
52 | super.initState();
53 | }
54 |
55 | @override
56 | void didUpdateWidget(covariant Categories oldWidget) {
57 | controller.animateTo(80.0 * widget.selectedIndex,
58 | duration: const Duration(milliseconds: 200), curve: Curves.ease);
59 | super.didUpdateWidget(oldWidget);
60 | }
61 |
62 | @override
63 | void dispose() {
64 | controller.dispose();
65 | super.dispose();
66 | }
67 |
68 | @override
69 | Widget build(BuildContext context) {
70 | return Column(
71 | children: [
72 | SingleChildScrollView(
73 | controller: controller,
74 | scrollDirection: Axis.horizontal,
75 | child: Row(
76 | children: List.generate(
77 | allCategoryMenus.length,
78 | (index) => Padding(
79 | padding: context.pagePaddingLeft,
80 | child: TextButton(
81 | onPressed: () {
82 | widget.onChanged(index);
83 | },
84 | style: TextButton.styleFrom(
85 | foregroundColor: widget.selectedIndex == index
86 | ? AppColors.poppypower
87 | : AppColors.chanceofrain),
88 | child: Text(
89 | allCategoryMenus[index].category,
90 | style: const TextStyle(fontSize: 20),
91 | ),
92 | ),
93 | ),
94 | ),
95 | ),
96 | ),
97 | ],
98 | );
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/lib/products/component/register.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:kartal/kartal.dart';
3 | import 'package:restaurant_app/core/constants/app_colors.dart';
4 | import 'package:restaurant_app/core/constants/app_string.dart';
5 |
6 | import 'package:restaurant_app/core/extensions/extension.dart';
7 |
8 | import 'package:restaurant_app/products/mixin/validation.dart';
9 |
10 | class RegisterComponent extends StatefulWidget {
11 | const RegisterComponent({Key? key}) : super(key: key);
12 |
13 | @override
14 | State createState() => _RegisterComponentState();
15 | }
16 |
17 | class _RegisterComponentState extends State with Validation {
18 | @override
19 | Widget build(BuildContext context) {
20 | return Column(
21 | crossAxisAlignment: CrossAxisAlignment.start,
22 | children: [
23 | Container(
24 | padding: context.pagePaddingLetfTopRigth,
25 | child: Text(
26 | StringConstant.registerText,
27 | style: Theme.of(context).textTheme.headlineMedium?.copyWith(
28 | color: AppColors.blueMetallic, fontWeight: FontWeight.bold),
29 | )),
30 | SizedBox(
31 | height: context.dynamicHeight(0.03),
32 | ),
33 | Container(
34 | height: context.dynamicHeight(0.45),
35 | width: context.dynamicWidth(0.85),
36 | decoration: context.boxDecoraiton,
37 | child: Padding(
38 | padding: context.largePadding,
39 | child: Column(children: [
40 | SizedBox(
41 | height: context.dynamicHeight(0.02),
42 | ),
43 | Form(
44 | key: formKey,
45 | child: Padding(
46 | padding: context.pagePadding,
47 | child: Column(
48 | mainAxisAlignment: MainAxisAlignment.center,
49 | crossAxisAlignment: CrossAxisAlignment.center,
50 | children: [
51 | fullNameField,
52 | emailField,
53 | passwordField,
54 | ],
55 | ),
56 | ),
57 | ),
58 | SizedBox(
59 | height: context.dynamicHeight(0.03),
60 | ),
61 | Material(
62 | child: Container(
63 | color: AppColors.palatinateBlue,
64 | height: context.dynamicHeight(0.06),
65 | width: context.dynamicWidth(0.60),
66 | child: MaterialButton(
67 | onPressed: () {
68 | signUp(emailEditingController.text,
69 | passwordEditingController.text);
70 | },
71 | child: Text(
72 | StringConstant.continu,
73 | textAlign: TextAlign.center,
74 | style: Theme.of(context).textTheme.titleLarge?.copyWith(
75 | color: AppColors.white,
76 | fontWeight: FontWeight.bold,
77 | ),
78 | )),
79 | ),
80 | )
81 | ]),
82 | ),
83 | ),
84 | ],
85 | );
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/windows/runner/Runner.rc:
--------------------------------------------------------------------------------
1 | // Microsoft Visual C++ generated resource script.
2 | //
3 | #pragma code_page(65001)
4 | #include "resource.h"
5 |
6 | #define APSTUDIO_READONLY_SYMBOLS
7 | /////////////////////////////////////////////////////////////////////////////
8 | //
9 | // Generated from the TEXTINCLUDE 2 resource.
10 | //
11 | #include "winres.h"
12 |
13 | /////////////////////////////////////////////////////////////////////////////
14 | #undef APSTUDIO_READONLY_SYMBOLS
15 |
16 | /////////////////////////////////////////////////////////////////////////////
17 | // English (United States) resources
18 |
19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
21 |
22 | #ifdef APSTUDIO_INVOKED
23 | /////////////////////////////////////////////////////////////////////////////
24 | //
25 | // TEXTINCLUDE
26 | //
27 |
28 | 1 TEXTINCLUDE
29 | BEGIN
30 | "resource.h\0"
31 | END
32 |
33 | 2 TEXTINCLUDE
34 | BEGIN
35 | "#include ""winres.h""\r\n"
36 | "\0"
37 | END
38 |
39 | 3 TEXTINCLUDE
40 | BEGIN
41 | "\r\n"
42 | "\0"
43 | END
44 |
45 | #endif // APSTUDIO_INVOKED
46 |
47 |
48 | /////////////////////////////////////////////////////////////////////////////
49 | //
50 | // Icon
51 | //
52 |
53 | // Icon with lowest ID value placed first to ensure application icon
54 | // remains consistent on all systems.
55 | IDI_APP_ICON ICON "resources\\app_icon.ico"
56 |
57 |
58 | /////////////////////////////////////////////////////////////////////////////
59 | //
60 | // Version
61 | //
62 |
63 | #ifdef FLUTTER_BUILD_NUMBER
64 | #define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER
65 | #else
66 | #define VERSION_AS_NUMBER 1,0,0
67 | #endif
68 |
69 | #ifdef FLUTTER_BUILD_NAME
70 | #define VERSION_AS_STRING #FLUTTER_BUILD_NAME
71 | #else
72 | #define VERSION_AS_STRING "1.0.0"
73 | #endif
74 |
75 | VS_VERSION_INFO VERSIONINFO
76 | FILEVERSION VERSION_AS_NUMBER
77 | PRODUCTVERSION VERSION_AS_NUMBER
78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
79 | #ifdef _DEBUG
80 | FILEFLAGS VS_FF_DEBUG
81 | #else
82 | FILEFLAGS 0x0L
83 | #endif
84 | FILEOS VOS__WINDOWS32
85 | FILETYPE VFT_APP
86 | FILESUBTYPE 0x0L
87 | BEGIN
88 | BLOCK "StringFileInfo"
89 | BEGIN
90 | BLOCK "040904e4"
91 | BEGIN
92 | VALUE "CompanyName", "com.example" "\0"
93 | VALUE "FileDescription", "restaurant_app" "\0"
94 | VALUE "FileVersion", VERSION_AS_STRING "\0"
95 | VALUE "InternalName", "restaurant_app" "\0"
96 | VALUE "LegalCopyright", "Copyright (C) 2022 com.example. All rights reserved." "\0"
97 | VALUE "OriginalFilename", "restaurant_app.exe" "\0"
98 | VALUE "ProductName", "restaurant_app" "\0"
99 | VALUE "ProductVersion", VERSION_AS_STRING "\0"
100 | END
101 | END
102 | BLOCK "VarFileInfo"
103 | BEGIN
104 | VALUE "Translation", 0x409, 1252
105 | END
106 | END
107 |
108 | #endif // English (United States) resources
109 | /////////////////////////////////////////////////////////////////////////////
110 |
111 |
112 |
113 | #ifndef APSTUDIO_INVOKED
114 | /////////////////////////////////////////////////////////////////////////////
115 | //
116 | // Generated from the TEXTINCLUDE 3 resource.
117 | //
118 |
119 |
120 | /////////////////////////////////////////////////////////////////////////////
121 | #endif // not APSTUDIO_INVOKED
122 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
52 |
54 |
60 |
61 |
62 |
63 |
69 |
71 |
77 |
78 |
79 |
80 |
82 |
83 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
52 |
54 |
60 |
61 |
62 |
63 |
69 |
71 |
77 |
78 |
79 |
80 |
82 |
83 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/lib/feature/login_register_page/view/login_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:kartal/kartal.dart';
3 | import 'package:restaurant_app/core/constants/app_colors.dart';
4 | import 'package:restaurant_app/core/constants/app_string.dart';
5 | import 'package:restaurant_app/core/constants/image_const.dart';
6 | import 'package:restaurant_app/core/extensions/extension.dart';
7 | import 'package:restaurant_app/products/component/login.dart';
8 | import 'package:restaurant_app/products/component/register.dart';
9 |
10 | class LoginPage extends StatefulWidget {
11 | const LoginPage({Key? key}) : super(key: key);
12 |
13 | @override
14 | State createState() => _LoginPageState();
15 | }
16 |
17 | class _LoginPageState extends State {
18 | @override
19 | Widget build(BuildContext context) {
20 | return Scaffold(
21 | body: SingleChildScrollView(
22 | child: Stack(
23 | children: [
24 | PngImage(name: ImageItems().loginlogoImage),
25 | Column(
26 | crossAxisAlignment: CrossAxisAlignment.stretch,
27 | children: [
28 | SizedBox(height: context.dynamicHeight(0.05)),
29 | DefaultTabController(
30 | length: 4,
31 | initialIndex: 0,
32 | child: Column(children: [
33 | TabBar(
34 | indicatorColor: AppColors.silverlined.withOpacity(0.02),
35 | labelColor: AppColors.consumedByFire,
36 | unselectedLabelColor: AppColors.blueMetallic,
37 | tabs: const [
38 | Tab(text: StringConstant.login),
39 | Tab(text: StringConstant.register),
40 | Tab(text: ''),
41 | Tab(text: ''),
42 | ],
43 | ),
44 | Container(
45 | height: context.dynamicHeight(0.70),
46 | decoration: const BoxDecoration(
47 | border: Border(
48 | top: BorderSide(
49 | color: AppColors.porpoise, width: 0.5))),
50 | child: TabBarView(children: [
51 | const LoginComponent(),
52 | const RegisterComponent(),
53 | Container(),
54 | Container(),
55 | ]),
56 | ),
57 | ]),
58 | ),
59 | _gmailFacebookWidget(context),
60 | ]),
61 | ],
62 | ),
63 | ),
64 | );
65 | }
66 |
67 | Container _gmailFacebookWidget(BuildContext context) {
68 | return Container(
69 | padding: context.middlePadding,
70 | child: Column(
71 | mainAxisAlignment: MainAxisAlignment.start,
72 | crossAxisAlignment: CrossAxisAlignment.start,
73 | children: [
74 | const Text(StringConstant.loginWith),
75 | SizedBox(
76 | height: context.dynamicHeight(0.02),
77 | ),
78 | Row(
79 | children: [
80 | SvgImage(name: ImageItems().gamil),
81 | SizedBox(
82 | width: context.dynamicWidth(0.03),
83 | ),
84 | SvgImage(name: ImageItems().facebook),
85 | ],
86 | ),
87 | ],
88 | ),
89 | );
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/lib/feature/favorite_page/view/favorite_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:provider/provider.dart';
3 | import 'package:restaurant_app/core/constants/app_colors.dart';
4 | import 'package:restaurant_app/core/constants/app_string.dart';
5 | import 'package:restaurant_app/core/extensions/extension.dart';
6 | import 'package:restaurant_app/feature/favorite_page/viewModel/favorite_view_model.dart';
7 | import 'package:restaurant_app/products/component/favorite_card.dart';
8 | import 'package:kartal/kartal.dart';
9 | import 'package:restaurant_app/products/widgets/app_bar.dart';
10 | import 'package:restaurant_app/products/widgets/bottom_navbar.dart';
11 |
12 | class FavoritePage extends StatelessWidget {
13 | const FavoritePage({Key? key}) : super(key: key);
14 |
15 | @override
16 | Widget build(BuildContext context) {
17 | var favoriList = context.read().favoriModel;
18 | return Scaffold(
19 | bottomNavigationBar: const BottomNavbar(pageid: 3),
20 | floatingActionButton: _floatingActionButton(context),
21 | body: Padding(
22 | padding: context.pagePadding,
23 | child: Stack(
24 | children: [
25 | Padding(
26 | padding: context.pageTopPadding,
27 | child: const AppBarWidget(
28 | color: AppColors.blueMetallic,
29 | ),
30 | ),
31 | Padding(
32 | padding: context.topPadding,
33 | child: Column(
34 | mainAxisAlignment: MainAxisAlignment.start,
35 | crossAxisAlignment: CrossAxisAlignment.start,
36 | children: [
37 | Text(
38 | StringConstant.recomendation,
39 | style: Theme.of(context).textTheme.headlineSmall?.copyWith(
40 | color: AppColors.blueMetallic,
41 | fontWeight: FontWeight.bold),
42 | ),
43 | Expanded(
44 | flex: 3,
45 | child: Consumer(builder: ((context, value, child) {
46 | return GridView.builder(
47 | itemCount: favoriList.length,
48 | gridDelegate:
49 | const SliverGridDelegateWithFixedCrossAxisCount(
50 | crossAxisCount: 2,
51 | ),
52 | itemBuilder: (BuildContext context, index) {
53 | return FavoriteCard(
54 | model: favoriList[index],
55 | );
56 | },
57 | );
58 | })),
59 | ),
60 | ],
61 | ),
62 | ),
63 | ],
64 | ),
65 | ),
66 | );
67 | }
68 |
69 | Padding _floatingActionButton(BuildContext context) {
70 | return Padding(
71 | padding: context.paddingNormalRigth,
72 | child: SizedBox(
73 | height: context.dynamicHeight(0.05),
74 | width: context.dynamicWidth(0.80),
75 | child: FloatingActionButton.extended(
76 | backgroundColor: AppColors.palatinateBlue,
77 | foregroundColor: AppColors.white,
78 | onPressed: () {},
79 | label: Text(
80 | StringConstant.order,
81 | style: Theme.of(context)
82 | .textTheme
83 | .titleLarge
84 | ?.copyWith(color: AppColors.white, fontWeight: FontWeight.bold),
85 | ),
86 | ),
87 | ),
88 | );
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/windows/runner/win32_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_WIN32_WINDOW_H_
2 | #define RUNNER_WIN32_WINDOW_H_
3 |
4 | #include
5 |
6 | #include
7 | #include
8 | #include
9 |
10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be
11 | // inherited from by classes that wish to specialize with custom
12 | // rendering and input handling
13 | class Win32Window {
14 | public:
15 | struct Point {
16 | unsigned int x;
17 | unsigned int y;
18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {}
19 | };
20 |
21 | struct Size {
22 | unsigned int width;
23 | unsigned int height;
24 | Size(unsigned int width, unsigned int height)
25 | : width(width), height(height) {}
26 | };
27 |
28 | Win32Window();
29 | virtual ~Win32Window();
30 |
31 | // Creates and shows a win32 window with |title| and position and size using
32 | // |origin| and |size|. New windows are created on the default monitor. Window
33 | // sizes are specified to the OS in physical pixels, hence to ensure a
34 | // consistent size to will treat the width height passed in to this function
35 | // as logical pixels and scale to appropriate for the default monitor. Returns
36 | // true if the window was created successfully.
37 | bool CreateAndShow(const std::wstring& title,
38 | const Point& origin,
39 | const Size& size);
40 |
41 | // Release OS resources associated with window.
42 | void Destroy();
43 |
44 | // Inserts |content| into the window tree.
45 | void SetChildContent(HWND content);
46 |
47 | // Returns the backing Window handle to enable clients to set icon and other
48 | // window properties. Returns nullptr if the window has been destroyed.
49 | HWND GetHandle();
50 |
51 | // If true, closing this window will quit the application.
52 | void SetQuitOnClose(bool quit_on_close);
53 |
54 | // Return a RECT representing the bounds of the current client area.
55 | RECT GetClientArea();
56 |
57 | protected:
58 | // Processes and route salient window messages for mouse handling,
59 | // size change and DPI. Delegates handling of these to member overloads that
60 | // inheriting classes can handle.
61 | virtual LRESULT MessageHandler(HWND window,
62 | UINT const message,
63 | WPARAM const wparam,
64 | LPARAM const lparam) noexcept;
65 |
66 | // Called when CreateAndShow is called, allowing subclass window-related
67 | // setup. Subclasses should return false if setup fails.
68 | virtual bool OnCreate();
69 |
70 | // Called when Destroy is called.
71 | virtual void OnDestroy();
72 |
73 | private:
74 | friend class WindowClassRegistrar;
75 |
76 | // OS callback called by message pump. Handles the WM_NCCREATE message which
77 | // is passed when the non-client area is being created and enables automatic
78 | // non-client DPI scaling so that the non-client area automatically
79 | // responsponds to changes in DPI. All other messages are handled by
80 | // MessageHandler.
81 | static LRESULT CALLBACK WndProc(HWND const window,
82 | UINT const message,
83 | WPARAM const wparam,
84 | LPARAM const lparam) noexcept;
85 |
86 | // Retrieves a class instance pointer for |window|
87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept;
88 |
89 | bool quit_on_close_ = false;
90 |
91 | // window handle for top level window.
92 | HWND window_handle_ = nullptr;
93 |
94 | // window handle for hosted content.
95 | HWND child_content_ = nullptr;
96 | };
97 |
98 | #endif // RUNNER_WIN32_WINDOW_H_
99 |
--------------------------------------------------------------------------------
/lib/products/component/reviews_title.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:kartal/kartal.dart';
3 | import 'package:restaurant_app/core/constants/app_colors.dart';
4 | import 'package:restaurant_app/core/constants/app_string.dart';
5 | import 'package:restaurant_app/core/extensions/extension.dart';
6 |
7 | import 'package:restaurant_app/products/component/slider_column.dart';
8 |
9 | class ReviewsCategoryItem extends StatelessWidget {
10 | const ReviewsCategoryItem({
11 | Key? key,
12 | required this.title,
13 | required this.items,
14 | }) : super(key: key);
15 |
16 | final String title;
17 | final List items;
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | return Column(
22 | crossAxisAlignment: CrossAxisAlignment.start,
23 | children: [
24 | Column(
25 | crossAxisAlignment: CrossAxisAlignment.start,
26 | children: [
27 | Padding(
28 | padding: context.paddingNormalVertical,
29 | child: Text(
30 | title,
31 | style: Theme.of(context).textTheme.titleLarge?.copyWith(
32 | color: AppColors.black,
33 | fontWeight: FontWeight.w600,
34 | ),
35 | ),
36 | ),
37 | Row(children: [
38 | SizedBox(
39 | height: context.dynamicHeight(0.15),
40 | child: Column(
41 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
42 | children: [
43 | Text(
44 | StringConstant.rating,
45 | style: Theme.of(context).textTheme.titleMedium?.copyWith(
46 | color: AppColors.black,
47 | fontWeight: FontWeight.bold,
48 | ),
49 | ),
50 | Text(
51 | StringConstant.ratingNum,
52 | style:
53 | Theme.of(context).textTheme.headlineMedium?.copyWith(
54 | color: AppColors.black,
55 | fontWeight: FontWeight.bold,
56 | ),
57 | ),
58 | Row(
59 | children: [
60 | for (int i = 0; i < 5; i++)
61 | Icon(Icons.star,
62 | size: 20,
63 | color: i == 4
64 | ? AppColors.black.withOpacity(0.7)
65 | : AppColors.california),
66 | ],
67 | ),
68 | ],
69 | ),
70 | ),
71 | SizedBox(
72 | width: context.dynamicWidth(0.07),
73 | ),
74 | Column(children: const [
75 | SliderColumnWidget(
76 | num: 95,
77 | text: '5',
78 | ),
79 | SliderColumnWidget(
80 | num: 60,
81 | text: '4',
82 | ),
83 | SliderColumnWidget(
84 | num: 50,
85 | text: '3',
86 | ),
87 | SliderColumnWidget(
88 | num: 30,
89 | text: '2',
90 | ),
91 | SliderColumnWidget(
92 | num: 10,
93 | text: '1',
94 | ),
95 | ]),
96 | ]),
97 | ],
98 | ),
99 | ...items,
100 | ],
101 | );
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/lib/products/component/reservation_info.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import 'package:kartal/kartal.dart';
4 | import 'package:restaurant_app/core/constants/app_colors.dart';
5 | import 'package:restaurant_app/core/constants/app_string.dart';
6 | import 'package:restaurant_app/core/extensions/extension.dart';
7 |
8 | class RestaurantInfo extends StatelessWidget {
9 | const RestaurantInfo({
10 | Key? key,
11 | }) : super(key: key);
12 |
13 | @override
14 | Widget build(BuildContext context) {
15 | return Padding(
16 | padding: context.pagePadding,
17 | child: Column(
18 | crossAxisAlignment: CrossAxisAlignment.start,
19 | children: [
20 | Text(
21 | StringConstant.istanbul,
22 | style: Theme.of(context)
23 | .textTheme
24 | .headlineMedium
25 | ?.copyWith(color: AppColors.blueMetallic),
26 | ),
27 | Row(
28 | children: [
29 | for (int i = 0; i < 5; i++)
30 | Icon(Icons.star,
31 | size: 20,
32 | color:
33 | i == 4 ? AppColors.silverlined : AppColors.california),
34 | SizedBox(
35 | width: context.dynamicWidth(0.03),
36 | ),
37 | const Icon(Icons.mode_comment_outlined),
38 | SizedBox(
39 | width: context.dynamicWidth(0.03),
40 | ),
41 | Text(
42 | StringConstant.reviews3,
43 | style: Theme.of(context).textTheme.titleMedium?.copyWith(
44 | color: AppColors.silverlined,
45 | fontWeight: FontWeight.bold,
46 | ),
47 | ),
48 | SizedBox(
49 | width: context.dynamicWidth(0.03),
50 | ),
51 | ],
52 | ),
53 | SizedBox(
54 | height: context.dynamicHeight(0.01),
55 | ),
56 | Row(
57 | children: [
58 | const Icon(Icons.local_atm),
59 | SizedBox(
60 | width: context.dynamicWidth(0.03),
61 | ),
62 | Text(
63 | StringConstant.under,
64 | style: Theme.of(context).textTheme.titleMedium?.copyWith(
65 | color: AppColors.silverlined,
66 | fontWeight: FontWeight.bold,
67 | ),
68 | ),
69 | SizedBox(
70 | width: context.dynamicWidth(0.03),
71 | ),
72 | const Icon(Icons.restaurant),
73 | SizedBox(
74 | width: context.dynamicWidth(0.03),
75 | ),
76 | Text(
77 | StringConstant.turk,
78 | style: Theme.of(context).textTheme.titleMedium?.copyWith(
79 | color: AppColors.silverlined,
80 | fontWeight: FontWeight.bold,
81 | ),
82 | ),
83 | ],
84 | ),
85 | SizedBox(
86 | height: context.dynamicHeight(0.01),
87 | ),
88 | Row(
89 | children: [
90 | const Icon(Icons.location_on_outlined),
91 | SizedBox(
92 | width: context.dynamicWidth(0.03),
93 | ),
94 | Text(
95 | StringConstant.adres,
96 | style: Theme.of(context).textTheme.titleMedium?.copyWith(
97 | color: AppColors.silverlined,
98 | fontWeight: FontWeight.bold,
99 | ),
100 | ),
101 | ],
102 | ),
103 | ],
104 | ),
105 | );
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/windows/flutter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # This file controls Flutter-level build steps. It should not be edited.
2 | cmake_minimum_required(VERSION 3.14)
3 |
4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
5 |
6 | # Configuration provided via flutter tool.
7 | include(${EPHEMERAL_DIR}/generated_config.cmake)
8 |
9 | # TODO: Move the rest of this into files in ephemeral. See
10 | # https://github.com/flutter/flutter/issues/57146.
11 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
12 |
13 | # === Flutter Library ===
14 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
15 |
16 | # Published to parent scope for install step.
17 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
18 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
19 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
20 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE)
21 |
22 | list(APPEND FLUTTER_LIBRARY_HEADERS
23 | "flutter_export.h"
24 | "flutter_windows.h"
25 | "flutter_messenger.h"
26 | "flutter_plugin_registrar.h"
27 | "flutter_texture_registrar.h"
28 | )
29 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/")
30 | add_library(flutter INTERFACE)
31 | target_include_directories(flutter INTERFACE
32 | "${EPHEMERAL_DIR}"
33 | )
34 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib")
35 | add_dependencies(flutter flutter_assemble)
36 |
37 | # === Wrapper ===
38 | list(APPEND CPP_WRAPPER_SOURCES_CORE
39 | "core_implementations.cc"
40 | "standard_codec.cc"
41 | )
42 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/")
43 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN
44 | "plugin_registrar.cc"
45 | )
46 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/")
47 | list(APPEND CPP_WRAPPER_SOURCES_APP
48 | "flutter_engine.cc"
49 | "flutter_view_controller.cc"
50 | )
51 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/")
52 |
53 | # Wrapper sources needed for a plugin.
54 | add_library(flutter_wrapper_plugin STATIC
55 | ${CPP_WRAPPER_SOURCES_CORE}
56 | ${CPP_WRAPPER_SOURCES_PLUGIN}
57 | )
58 | apply_standard_settings(flutter_wrapper_plugin)
59 | set_target_properties(flutter_wrapper_plugin PROPERTIES
60 | POSITION_INDEPENDENT_CODE ON)
61 | set_target_properties(flutter_wrapper_plugin PROPERTIES
62 | CXX_VISIBILITY_PRESET hidden)
63 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter)
64 | target_include_directories(flutter_wrapper_plugin PUBLIC
65 | "${WRAPPER_ROOT}/include"
66 | )
67 | add_dependencies(flutter_wrapper_plugin flutter_assemble)
68 |
69 | # Wrapper sources needed for the runner.
70 | add_library(flutter_wrapper_app STATIC
71 | ${CPP_WRAPPER_SOURCES_CORE}
72 | ${CPP_WRAPPER_SOURCES_APP}
73 | )
74 | apply_standard_settings(flutter_wrapper_app)
75 | target_link_libraries(flutter_wrapper_app PUBLIC flutter)
76 | target_include_directories(flutter_wrapper_app PUBLIC
77 | "${WRAPPER_ROOT}/include"
78 | )
79 | add_dependencies(flutter_wrapper_app flutter_assemble)
80 |
81 | # === Flutter tool backend ===
82 | # _phony_ is a non-existent file to force this command to run every time,
83 | # since currently there's no way to get a full input/output list from the
84 | # flutter tool.
85 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_")
86 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE)
87 | add_custom_command(
88 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
89 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN}
90 | ${CPP_WRAPPER_SOURCES_APP}
91 | ${PHONY_OUTPUT}
92 | COMMAND ${CMAKE_COMMAND} -E env
93 | ${FLUTTER_TOOL_ENVIRONMENT}
94 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
95 | windows-x64 $
96 | VERBATIM
97 | )
98 | add_custom_target(flutter_assemble DEPENDS
99 | "${FLUTTER_LIBRARY}"
100 | ${FLUTTER_LIBRARY_HEADERS}
101 | ${CPP_WRAPPER_SOURCES_CORE}
102 | ${CPP_WRAPPER_SOURCES_PLUGIN}
103 | ${CPP_WRAPPER_SOURCES_APP}
104 | )
105 |
--------------------------------------------------------------------------------
/lib/products/component/login.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:kartal/kartal.dart';
3 | import 'package:restaurant_app/core/constants/app_colors.dart';
4 | import 'package:restaurant_app/core/constants/app_string.dart';
5 |
6 | import 'package:restaurant_app/core/extensions/extension.dart';
7 |
8 | import 'package:restaurant_app/products/mixin/validation.dart';
9 |
10 | class LoginComponent extends StatefulWidget {
11 | const LoginComponent({Key? key}) : super(key: key);
12 |
13 | @override
14 | State createState() => _LoginComponentState();
15 | }
16 |
17 | class _LoginComponentState extends State with Validation {
18 | @override
19 | Widget build(BuildContext context) {
20 | return Column(
21 | crossAxisAlignment: CrossAxisAlignment.start,
22 | children: [
23 | Container(
24 | padding: context.pagePaddingLetfTopRigth,
25 | child: Text(
26 | StringConstant.loginText,
27 | style: Theme.of(context).textTheme.headlineMedium?.copyWith(
28 | color: AppColors.blueMetallic, fontWeight: FontWeight.bold),
29 | )),
30 | SizedBox(
31 | height: context.dynamicHeight(0.06),
32 | ),
33 | Container(
34 | height: context.dynamicHeight(0.45),
35 | width: context.dynamicWidth(0.85),
36 | decoration: context.boxDecoraiton,
37 | child: Padding(
38 | padding: context.largePadding,
39 | child:
40 | Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
41 | Text(
42 | StringConstant.emailText,
43 | style: Theme.of(context).textTheme.titleLarge?.copyWith(
44 | color: AppColors.silverlined,
45 | fontWeight: FontWeight.w600,
46 | ),
47 | ),
48 | SizedBox(
49 | height: context.dynamicHeight(0.02),
50 | ),
51 | Form(
52 | key: formKey,
53 | child: Column(
54 | children: [
55 | emailField,
56 | passwordField,
57 | ],
58 | ),
59 | ),
60 | SizedBox(
61 | height: context.dynamicHeight(0.07),
62 | ),
63 | Material(
64 | child: Container(
65 | color: AppColors.palatinateBlue,
66 | height: context.dynamicHeight(0.06),
67 | width: context.dynamicWidth(0.60),
68 | child: MaterialButton(
69 | onPressed: () {
70 | signIn(emailEditingController.text,
71 | passwordEditingController.text);
72 | },
73 | child: Row(
74 | mainAxisAlignment: MainAxisAlignment.center,
75 | crossAxisAlignment: CrossAxisAlignment.center,
76 | children: [
77 | Text(
78 | StringConstant.continu,
79 | style: Theme.of(context)
80 | .textTheme
81 | .titleLarge
82 | ?.copyWith(
83 | color: AppColors.white,
84 | fontWeight: FontWeight.bold),
85 | ),
86 | SizedBox(
87 | width: context.dynamicWidth(0.03),
88 | ),
89 | const Icon(
90 | Icons.arrow_forward,
91 | color: AppColors.white,
92 | )
93 | ],
94 | )),
95 | ),
96 | )
97 | ]),
98 | ),
99 | ),
100 | ],
101 | );
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/linux/my_application.cc:
--------------------------------------------------------------------------------
1 | #include "my_application.h"
2 |
3 | #include
4 | #ifdef GDK_WINDOWING_X11
5 | #include
6 | #endif
7 |
8 | #include "flutter/generated_plugin_registrant.h"
9 |
10 | struct _MyApplication {
11 | GtkApplication parent_instance;
12 | char** dart_entrypoint_arguments;
13 | };
14 |
15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
16 |
17 | // Implements GApplication::activate.
18 | static void my_application_activate(GApplication* application) {
19 | MyApplication* self = MY_APPLICATION(application);
20 | GtkWindow* window =
21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
22 |
23 | // Use a header bar when running in GNOME as this is the common style used
24 | // by applications and is the setup most users will be using (e.g. Ubuntu
25 | // desktop).
26 | // If running on X and not using GNOME then just use a traditional title bar
27 | // in case the window manager does more exotic layout, e.g. tiling.
28 | // If running on Wayland assume the header bar will work (may need changing
29 | // if future cases occur).
30 | gboolean use_header_bar = TRUE;
31 | #ifdef GDK_WINDOWING_X11
32 | GdkScreen* screen = gtk_window_get_screen(window);
33 | if (GDK_IS_X11_SCREEN(screen)) {
34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen);
35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) {
36 | use_header_bar = FALSE;
37 | }
38 | }
39 | #endif
40 | if (use_header_bar) {
41 | GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
42 | gtk_widget_show(GTK_WIDGET(header_bar));
43 | gtk_header_bar_set_title(header_bar, "restaurant_app");
44 | gtk_header_bar_set_show_close_button(header_bar, TRUE);
45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
46 | } else {
47 | gtk_window_set_title(window, "restaurant_app");
48 | }
49 |
50 | gtk_window_set_default_size(window, 1280, 720);
51 | gtk_widget_show(GTK_WIDGET(window));
52 |
53 | g_autoptr(FlDartProject) project = fl_dart_project_new();
54 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
55 |
56 | FlView* view = fl_view_new(project);
57 | gtk_widget_show(GTK_WIDGET(view));
58 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
59 |
60 | fl_register_plugins(FL_PLUGIN_REGISTRY(view));
61 |
62 | gtk_widget_grab_focus(GTK_WIDGET(view));
63 | }
64 |
65 | // Implements GApplication::local_command_line.
66 | static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) {
67 | MyApplication* self = MY_APPLICATION(application);
68 | // Strip out the first argument as it is the binary name.
69 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);
70 |
71 | g_autoptr(GError) error = nullptr;
72 | if (!g_application_register(application, nullptr, &error)) {
73 | g_warning("Failed to register: %s", error->message);
74 | *exit_status = 1;
75 | return TRUE;
76 | }
77 |
78 | g_application_activate(application);
79 | *exit_status = 0;
80 |
81 | return TRUE;
82 | }
83 |
84 | // Implements GObject::dispose.
85 | static void my_application_dispose(GObject* object) {
86 | MyApplication* self = MY_APPLICATION(object);
87 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev);
88 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object);
89 | }
90 |
91 | static void my_application_class_init(MyApplicationClass* klass) {
92 | G_APPLICATION_CLASS(klass)->activate = my_application_activate;
93 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line;
94 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose;
95 | }
96 |
97 | static void my_application_init(MyApplication* self) {}
98 |
99 | MyApplication* my_application_new() {
100 | return MY_APPLICATION(g_object_new(my_application_get_type(),
101 | "application-id", APPLICATION_ID,
102 | "flags", G_APPLICATION_NON_UNIQUE,
103 | nullptr));
104 | }
105 |
--------------------------------------------------------------------------------
/windows/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Project-level configuration.
2 | cmake_minimum_required(VERSION 3.14)
3 | project(restaurant_app LANGUAGES CXX)
4 |
5 | # The name of the executable created for the application. Change this to change
6 | # the on-disk name of your application.
7 | set(BINARY_NAME "restaurant_app")
8 |
9 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
10 | # versions of CMake.
11 | cmake_policy(SET CMP0063 NEW)
12 |
13 | # Define build configuration option.
14 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
15 | if(IS_MULTICONFIG)
16 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
17 | CACHE STRING "" FORCE)
18 | else()
19 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
20 | set(CMAKE_BUILD_TYPE "Debug" CACHE
21 | STRING "Flutter build mode" FORCE)
22 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
23 | "Debug" "Profile" "Release")
24 | endif()
25 | endif()
26 | # Define settings for the Profile build mode.
27 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
28 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
29 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")
30 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")
31 |
32 | # Use Unicode for all projects.
33 | add_definitions(-DUNICODE -D_UNICODE)
34 |
35 | # Compilation settings that should be applied to most targets.
36 | #
37 | # Be cautious about adding new options here, as plugins use this function by
38 | # default. In most cases, you should add new options to specific targets instead
39 | # of modifying this function.
40 | function(APPLY_STANDARD_SETTINGS TARGET)
41 | target_compile_features(${TARGET} PUBLIC cxx_std_17)
42 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
43 | target_compile_options(${TARGET} PRIVATE /EHsc)
44 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
45 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>")
46 | endfunction()
47 |
48 | # Flutter library and tool build rules.
49 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
50 | add_subdirectory(${FLUTTER_MANAGED_DIR})
51 |
52 | # Application build; see runner/CMakeLists.txt.
53 | add_subdirectory("runner")
54 |
55 | # Generated plugin build rules, which manage building the plugins and adding
56 | # them to the application.
57 | include(flutter/generated_plugins.cmake)
58 |
59 |
60 | # === Installation ===
61 | # Support files are copied into place next to the executable, so that it can
62 | # run in place. This is done instead of making a separate bundle (as on Linux)
63 | # so that building and running from within Visual Studio will work.
64 | set(BUILD_BUNDLE_DIR "$")
65 | # Make the "install" step default, as it's required to run.
66 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
67 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
68 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
69 | endif()
70 |
71 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
72 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}")
73 |
74 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
75 | COMPONENT Runtime)
76 |
77 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
78 | COMPONENT Runtime)
79 |
80 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
81 | COMPONENT Runtime)
82 |
83 | if(PLUGIN_BUNDLED_LIBRARIES)
84 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
85 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
86 | COMPONENT Runtime)
87 | endif()
88 |
89 | # Fully re-copy the assets directory on each build to avoid having stale files
90 | # from a previous install.
91 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
92 | install(CODE "
93 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
94 | " COMPONENT Runtime)
95 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
96 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
97 |
98 | # Install the AOT library on non-Debug builds only.
99 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
100 | CONFIGURATIONS Profile;Release
101 | COMPONENT Runtime)
102 |
--------------------------------------------------------------------------------
/lib/core/extensions/extension.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:restaurant_app/core/constants/app_colors.dart';
3 |
4 | extension ContextExtension on BuildContext {
5 | MediaQueryData get mediaQuery => MediaQuery.of(this);
6 | }
7 |
8 | extension MediaQueryExtension on BuildContext {
9 | double get height => mediaQuery.size.height;
10 | double get width => mediaQuery.size.width;
11 |
12 | double get lowValue => height * 0.01;
13 | double get normalValue => height * 0.02;
14 | }
15 |
16 | extension PaddingExtensionAll on BuildContext {
17 | EdgeInsets get pagePadding => const EdgeInsets.all(10.0);
18 | EdgeInsets get cardPadding => const EdgeInsets.all(8.0);
19 | EdgeInsets get personPadding => const EdgeInsets.all(6.0);
20 |
21 | EdgeInsets get largePadding => const EdgeInsets.all(30.0);
22 | EdgeInsets get pagePaddingTopLeft =>
23 | const EdgeInsets.only(top: 90.0, left: 30.0);
24 | EdgeInsets get pagePaddingLeftTop => const EdgeInsets.only(left: 9, top: 2);
25 | EdgeInsets get pagePaddingLeftTopRigth =>
26 | const EdgeInsets.only(left: 8, right: 8, top: 8);
27 | EdgeInsets get pagePaddingTopLef =>
28 | const EdgeInsets.only(left: 145, top: 105);
29 | EdgeInsets get appPaddingTopLeft =>
30 | const EdgeInsets.only(top: 20.0, left: 10.0);
31 | EdgeInsets get pagePaddingBottomTop =>
32 | const EdgeInsets.only(bottom: 16, top: 10);
33 | EdgeInsets get pagePaddingBottom => const EdgeInsets.only(bottom: 16);
34 | EdgeInsets get pagePaddingTop => const EdgeInsets.only(top: 170);
35 | EdgeInsets get pagePaddingLeft => const EdgeInsets.only(left: 8);
36 | EdgeInsets get middlePadding => const EdgeInsets.only(left: 20.0);
37 | EdgeInsets get dashPadding => const EdgeInsets.only(left: 20, top: 50);
38 | EdgeInsets get pagePaddingRigth => const EdgeInsets.only(right: 20);
39 | EdgeInsets get pagePaddingLetfTopRigth =>
40 | const EdgeInsets.only(left: 30, right: 150, top: 30);
41 | EdgeInsets get likePadding => const EdgeInsets.only(right: 140);
42 | EdgeInsets get pagePaddingAll =>
43 | const EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10);
44 | EdgeInsets get topPadding => const EdgeInsets.only(top: 80);
45 | EdgeInsets get pageTopPadding => const EdgeInsets.only(top: 20);
46 | }
47 |
48 | extension BorderExtension on BuildContext {
49 | BorderRadius get radiusAll => const BorderRadius.all(Radius.circular(10));
50 | }
51 |
52 | extension DecorationExtension on BuildContext {
53 | BoxDecoration get boxDecoraiton => BoxDecoration(
54 | color: AppColors.white, borderRadius: BorderRadius.circular(5));
55 | BoxDecoration get smallDecoraiton => BoxDecoration(
56 | color: AppColors.flataluminum, borderRadius: BorderRadius.circular(5));
57 | BoxDecoration get cardDecoraiton => BoxDecoration(
58 | color: AppColors.california, borderRadius: BorderRadius.circular(3));
59 | BoxDecoration get middelDecoraiton => BoxDecoration(
60 | color: AppColors.black.withOpacity(0.5),
61 | borderRadius: BorderRadius.circular(20));
62 | BoxDecoration get colormiddelDecoraiton => BoxDecoration(
63 | color: AppColors.white,
64 | borderRadius: BorderRadius.circular(20),
65 | border: Border.all(
66 | color: AppColors.darkGrey,
67 | width: 2.0,
68 | ),
69 | );
70 | BoxDecoration get slidermiddelDecoraiton => BoxDecoration(
71 | color: AppColors.black.withOpacity(0.3),
72 | borderRadius: BorderRadius.circular(20),
73 | border:
74 | Border.all(color: AppColors.darkGrey.withOpacity(0.03), width: 1.0));
75 | BoxDecoration get sliderDecoraiton => BoxDecoration(
76 | color: AppColors.poppypower, borderRadius: BorderRadius.circular(20));
77 |
78 | BoxDecoration get timeDecoraiton => BoxDecoration(
79 | color: AppColors.poppypower, borderRadius: BorderRadius.circular(5));
80 | }
81 |
82 | extension PaddingExtensionOnly on BuildContext {
83 | EdgeInsets get paddingNormalLeft => EdgeInsets.only(left: normalValue);
84 | EdgeInsets get paddingNormalRigth => EdgeInsets.only(right: normalValue);
85 | }
86 |
87 | extension PaddingExtensionSymetric on BuildContext {
88 | EdgeInsets get paddingNormalVertical =>
89 | EdgeInsets.symmetric(vertical: normalValue);
90 | EdgeInsets get paddingLowHorizontalVertical =>
91 | const EdgeInsets.symmetric(horizontal: 10, vertical: 10);
92 | EdgeInsets get paddingLowVertical => EdgeInsets.symmetric(vertical: lowValue);
93 | EdgeInsets get paddingLowHorizontal =>
94 | EdgeInsets.symmetric(horizontal: lowValue);
95 | }
96 |
--------------------------------------------------------------------------------