diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 65f64db..d14e495 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -43,7 +43,7 @@
android:value="2" />
+ android:value="ca-app-pub-8206166796422159~5135681453"/>
diff --git a/android/build.gradle b/android/build.gradle
index 9192654..2139d26 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -29,6 +29,6 @@ subprojects {
project.evaluationDependsOn(':app')
}
-task clean(type: Delete) {
+tasks.register("clean", Delete) {
delete rootProject.buildDir
}
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index 0e67cad..7d8fe5a 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -1,61 +1,61 @@
PODS:
- - Firebase/Analytics (10.6.0):
+ - Firebase/Analytics (10.9.0):
- Firebase/Core
- - Firebase/Core (10.6.0):
+ - Firebase/Core (10.9.0):
- Firebase/CoreOnly
- - FirebaseAnalytics (~> 10.6.0)
- - Firebase/CoreOnly (10.6.0):
- - FirebaseCore (= 10.6.0)
- - Firebase/Crashlytics (10.6.0):
+ - FirebaseAnalytics (~> 10.9.0)
+ - Firebase/CoreOnly (10.9.0):
+ - FirebaseCore (= 10.9.0)
+ - Firebase/Crashlytics (10.9.0):
- Firebase/CoreOnly
- - FirebaseCrashlytics (~> 10.6.0)
- - Firebase/Performance (10.6.0):
+ - FirebaseCrashlytics (~> 10.9.0)
+ - Firebase/Performance (10.9.0):
- Firebase/CoreOnly
- - FirebasePerformance (~> 10.6.0)
- - firebase_analytics (10.1.6):
- - Firebase/Analytics (= 10.6.0)
+ - FirebasePerformance (~> 10.9.0)
+ - firebase_analytics (10.4.1):
+ - Firebase/Analytics (= 10.9.0)
- firebase_core
- Flutter
- - firebase_core (2.8.0):
- - Firebase/CoreOnly (= 10.6.0)
+ - firebase_core (2.13.0):
+ - Firebase/CoreOnly (= 10.9.0)
- Flutter
- - firebase_crashlytics (3.0.17):
- - Firebase/Crashlytics (= 10.6.0)
+ - firebase_crashlytics (3.3.1):
+ - Firebase/Crashlytics (= 10.9.0)
- firebase_core
- Flutter
- - firebase_performance (0.9.0-16):
- - Firebase/Performance (= 10.6.0)
+ - firebase_performance (0.9.2-1):
+ - Firebase/Performance (= 10.9.0)
- firebase_core
- Flutter
- - FirebaseABTesting (10.7.0):
+ - FirebaseABTesting (10.9.0):
- FirebaseCore (~> 10.0)
- - FirebaseAnalytics (10.6.0):
- - FirebaseAnalytics/AdIdSupport (= 10.6.0)
+ - FirebaseAnalytics (10.9.0):
+ - FirebaseAnalytics/AdIdSupport (= 10.9.0)
- FirebaseCore (~> 10.0)
- FirebaseInstallations (~> 10.0)
- - GoogleUtilities/AppDelegateSwizzler (~> 7.8)
- - GoogleUtilities/MethodSwizzler (~> 7.8)
- - GoogleUtilities/Network (~> 7.8)
- - "GoogleUtilities/NSData+zlib (~> 7.8)"
+ - GoogleUtilities/AppDelegateSwizzler (~> 7.11)
+ - GoogleUtilities/MethodSwizzler (~> 7.11)
+ - GoogleUtilities/Network (~> 7.11)
+ - "GoogleUtilities/NSData+zlib (~> 7.11)"
- nanopb (< 2.30910.0, >= 2.30908.0)
- - FirebaseAnalytics/AdIdSupport (10.6.0):
+ - FirebaseAnalytics/AdIdSupport (10.9.0):
- FirebaseCore (~> 10.0)
- FirebaseInstallations (~> 10.0)
- - GoogleAppMeasurement (= 10.6.0)
- - GoogleUtilities/AppDelegateSwizzler (~> 7.8)
- - GoogleUtilities/MethodSwizzler (~> 7.8)
- - GoogleUtilities/Network (~> 7.8)
- - "GoogleUtilities/NSData+zlib (~> 7.8)"
+ - GoogleAppMeasurement (= 10.9.0)
+ - GoogleUtilities/AppDelegateSwizzler (~> 7.11)
+ - GoogleUtilities/MethodSwizzler (~> 7.11)
+ - GoogleUtilities/Network (~> 7.11)
+ - "GoogleUtilities/NSData+zlib (~> 7.11)"
- nanopb (< 2.30910.0, >= 2.30908.0)
- - FirebaseCore (10.6.0):
+ - FirebaseCore (10.9.0):
- FirebaseCoreInternal (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/Logger (~> 7.8)
- - FirebaseCoreExtension (10.7.0):
+ - FirebaseCoreExtension (10.9.0):
- FirebaseCore (~> 10.0)
- - FirebaseCoreInternal (10.7.0):
+ - FirebaseCoreInternal (10.9.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- - FirebaseCrashlytics (10.6.0):
+ - FirebaseCrashlytics (10.9.0):
- FirebaseCore (~> 10.5)
- FirebaseInstallations (~> 10.0)
- FirebaseSessions (~> 10.5)
@@ -63,12 +63,12 @@ PODS:
- GoogleUtilities/Environment (~> 7.8)
- nanopb (< 2.30910.0, >= 2.30908.0)
- PromisesObjC (~> 2.1)
- - FirebaseInstallations (10.7.0):
+ - FirebaseInstallations (10.9.0):
- FirebaseCore (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/UserDefaults (~> 7.8)
- PromisesObjC (~> 2.1)
- - FirebasePerformance (10.6.0):
+ - FirebasePerformance (10.9.0):
- FirebaseCore (~> 10.5)
- FirebaseInstallations (~> 10.0)
- FirebaseRemoteConfig (~> 10.0)
@@ -78,13 +78,13 @@ PODS:
- GoogleUtilities/ISASwizzler (~> 7.8)
- GoogleUtilities/MethodSwizzler (~> 7.8)
- nanopb (< 2.30910.0, >= 2.30908.0)
- - FirebaseRemoteConfig (10.7.0):
+ - FirebaseRemoteConfig (10.9.0):
- FirebaseABTesting (~> 10.0)
- FirebaseCore (~> 10.0)
- FirebaseInstallations (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- - FirebaseSessions (10.7.0):
+ - FirebaseSessions (10.9.0):
- FirebaseCore (~> 10.5)
- FirebaseCoreExtension (~> 10.0)
- FirebaseInstallations (~> 10.0)
@@ -93,56 +93,60 @@ PODS:
- nanopb (< 2.30910.0, >= 2.30908.0)
- PromisesSwift (~> 2.1)
- Flutter (1.0.0)
- - Google-Mobile-Ads-SDK (9.14.0):
+ - FMDB (2.7.5):
+ - FMDB/standard (= 2.7.5)
+ - FMDB/standard (2.7.5)
+ - Google-Mobile-Ads-SDK (10.4.0):
- GoogleAppMeasurement (< 11.0, >= 7.0)
- GoogleUserMessagingPlatform (>= 1.1)
- google_mobile_ads (1.0.0):
- Flutter
- - Google-Mobile-Ads-SDK (~> 9.13)
- - GoogleAppMeasurement (10.6.0):
- - GoogleAppMeasurement/AdIdSupport (= 10.6.0)
- - GoogleUtilities/AppDelegateSwizzler (~> 7.8)
- - GoogleUtilities/MethodSwizzler (~> 7.8)
- - GoogleUtilities/Network (~> 7.8)
- - "GoogleUtilities/NSData+zlib (~> 7.8)"
+ - Google-Mobile-Ads-SDK (~> 10.4.0)
+ - webview_flutter_wkwebview
+ - GoogleAppMeasurement (10.9.0):
+ - GoogleAppMeasurement/AdIdSupport (= 10.9.0)
+ - GoogleUtilities/AppDelegateSwizzler (~> 7.11)
+ - GoogleUtilities/MethodSwizzler (~> 7.11)
+ - GoogleUtilities/Network (~> 7.11)
+ - "GoogleUtilities/NSData+zlib (~> 7.11)"
- nanopb (< 2.30910.0, >= 2.30908.0)
- - GoogleAppMeasurement/AdIdSupport (10.6.0):
- - GoogleAppMeasurement/WithoutAdIdSupport (= 10.6.0)
- - GoogleUtilities/AppDelegateSwizzler (~> 7.8)
- - GoogleUtilities/MethodSwizzler (~> 7.8)
- - GoogleUtilities/Network (~> 7.8)
- - "GoogleUtilities/NSData+zlib (~> 7.8)"
+ - GoogleAppMeasurement/AdIdSupport (10.9.0):
+ - GoogleAppMeasurement/WithoutAdIdSupport (= 10.9.0)
+ - GoogleUtilities/AppDelegateSwizzler (~> 7.11)
+ - GoogleUtilities/MethodSwizzler (~> 7.11)
+ - GoogleUtilities/Network (~> 7.11)
+ - "GoogleUtilities/NSData+zlib (~> 7.11)"
- nanopb (< 2.30910.0, >= 2.30908.0)
- - GoogleAppMeasurement/WithoutAdIdSupport (10.6.0):
- - GoogleUtilities/AppDelegateSwizzler (~> 7.8)
- - GoogleUtilities/MethodSwizzler (~> 7.8)
- - GoogleUtilities/Network (~> 7.8)
- - "GoogleUtilities/NSData+zlib (~> 7.8)"
+ - GoogleAppMeasurement/WithoutAdIdSupport (10.9.0):
+ - GoogleUtilities/AppDelegateSwizzler (~> 7.11)
+ - GoogleUtilities/MethodSwizzler (~> 7.11)
+ - GoogleUtilities/Network (~> 7.11)
+ - "GoogleUtilities/NSData+zlib (~> 7.11)"
- nanopb (< 2.30910.0, >= 2.30908.0)
- - GoogleDataTransport (9.2.1):
+ - GoogleDataTransport (9.2.3):
- GoogleUtilities/Environment (~> 7.7)
- nanopb (< 2.30910.0, >= 2.30908.0)
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUserMessagingPlatform (2.0.1)
- - GoogleUtilities/AppDelegateSwizzler (7.11.0):
+ - GoogleUtilities/AppDelegateSwizzler (7.11.1):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- - GoogleUtilities/Environment (7.11.0):
+ - GoogleUtilities/Environment (7.11.1):
- PromisesObjC (< 3.0, >= 1.2)
- - GoogleUtilities/ISASwizzler (7.11.0)
- - GoogleUtilities/Logger (7.11.0):
+ - GoogleUtilities/ISASwizzler (7.11.1)
+ - GoogleUtilities/Logger (7.11.1):
- GoogleUtilities/Environment
- - GoogleUtilities/MethodSwizzler (7.11.0):
+ - GoogleUtilities/MethodSwizzler (7.11.1):
- GoogleUtilities/Logger
- - GoogleUtilities/Network (7.11.0):
+ - GoogleUtilities/Network (7.11.1):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Reachability
- - "GoogleUtilities/NSData+zlib (7.11.0)"
- - GoogleUtilities/Reachability (7.11.0):
+ - "GoogleUtilities/NSData+zlib (7.11.1)"
+ - GoogleUtilities/Reachability (7.11.1):
- GoogleUtilities/Logger
- - GoogleUtilities/UserDefaults (7.11.0):
+ - GoogleUtilities/UserDefaults (7.11.1):
- GoogleUtilities/Logger
- nanopb (2.30909.0):
- nanopb/decode (= 2.30909.0)
@@ -154,18 +158,23 @@ PODS:
- PromisesObjC (2.2.0)
- PromisesSwift (2.2.0):
- PromisesObjC (= 2.2.0)
- - Sentry/HybridSDK (8.3.3):
- - SentryPrivate (= 8.3.3)
+ - Sentry/HybridSDK (8.7.1):
+ - SentryPrivate (= 8.7.1)
- sentry_flutter (0.0.1):
- Flutter
- FlutterMacOS
- - Sentry/HybridSDK (= 8.3.3)
- - SentryPrivate (8.3.3)
+ - Sentry/HybridSDK (= 8.7.1)
+ - SentryPrivate (8.7.1)
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
+ - sqflite (0.0.3):
+ - Flutter
+ - FMDB (>= 2.7.5)
- url_launcher_ios (0.0.1):
- Flutter
+ - webview_flutter_wkwebview (0.0.1):
+ - Flutter
DEPENDENCIES:
- firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`)
@@ -176,8 +185,10 @@ DEPENDENCIES:
- google_mobile_ads (from `.symlinks/plugins/google_mobile_ads/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- sentry_flutter (from `.symlinks/plugins/sentry_flutter/ios`)
- - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/ios`)
+ - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
+ - sqflite (from `.symlinks/plugins/sqflite/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
+ - webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)
SPEC REPOS:
trunk:
@@ -192,6 +203,7 @@ SPEC REPOS:
- FirebasePerformance
- FirebaseRemoteConfig
- FirebaseSessions
+ - FMDB
- Google-Mobile-Ads-SDK
- GoogleAppMeasurement
- GoogleDataTransport
@@ -221,42 +233,49 @@ EXTERNAL SOURCES:
sentry_flutter:
:path: ".symlinks/plugins/sentry_flutter/ios"
shared_preferences_foundation:
- :path: ".symlinks/plugins/shared_preferences_foundation/ios"
+ :path: ".symlinks/plugins/shared_preferences_foundation/darwin"
+ sqflite:
+ :path: ".symlinks/plugins/sqflite/ios"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
+ webview_flutter_wkwebview:
+ :path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
SPEC CHECKSUMS:
- Firebase: f13680471b021937f2230ea8503c7809d8c29806
- firebase_analytics: 97d12c9683531ba3f923a798a95362e7590f0757
- firebase_core: 58542d7399889ebdbb034baa72d081e54c5c814d
- firebase_crashlytics: 5f6296621a0e8ed7d15a7499c8131fbdcf176e3b
- firebase_performance: b1fbf15054e1dd21f3ea225d162e196cacf200c0
- FirebaseABTesting: 76c8297fd026074e0366dc941d265d1be80a56d5
- FirebaseAnalytics: 9f382605c5ee412b039212f054bf7a403d9850c1
- FirebaseCore: fa80ad16a62d52f67274b5b88304c3a318bbf9a4
- FirebaseCoreExtension: f17247ba8c61e4d3c8d136b5e2de3cb4ac6a85b6
- FirebaseCoreInternal: 8845798510aae74703467480f71ac613788d0696
- FirebaseCrashlytics: ede07e7f433a0a2270112baf2d156b111cfb422d
- FirebaseInstallations: 59c0e4c7a816a0f76710d83f77e5369b3e45eb96
- FirebasePerformance: 015ec3614f742150244171522bdb75995dbf98b7
- FirebaseRemoteConfig: d5de62211e2eaa2152d8ee85a23c301b70887a74
- FirebaseSessions: 34e5c084da010ef3802cbc062b822e513c9e6318
+ Firebase: bd152f0f3d278c4060c5c71359db08ebcfd5a3e2
+ firebase_analytics: 24c9089f960ea2255654488d219cb15a913adf8e
+ firebase_core: fc68c0f9eec4e800b9418deff14a7e0a504016f3
+ firebase_crashlytics: 6c82b5f80f225b2429ebc5fdadde5b7e7735ed4e
+ firebase_performance: 516fbfa3ace3c84add028be727ff08f15d8a3502
+ FirebaseABTesting: 005b70969e2817e2a1e631e8dba29134a04c0622
+ FirebaseAnalytics: 5ea0db4893825e7b0149d575352cd838236313dc
+ FirebaseCore: b68d3616526ec02e4d155166bbafb8eca64af557
+ FirebaseCoreExtension: d3e9bba2930a8033042112397cd9f006a1bb203d
+ FirebaseCoreInternal: d2b4acb827908e72eca47a9fd896767c3053921e
+ FirebaseCrashlytics: b60329455285aff853e54139d8ddbfe1e5f2b9f9
+ FirebaseInstallations: c58489c9caacdbf27d1da60891a87318e20218e0
+ FirebasePerformance: eee2f5da94fd7e5d15487649f8fe10a90c87c174
+ FirebaseRemoteConfig: 5ea5834e8c518f377bf1af2d97ebd611914ebf2d
+ FirebaseSessions: 44a6782502eb279a214d4adca20891353278760c
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
- Google-Mobile-Ads-SDK: 4fe6304b771f8467d29978cb790ec1e56e646946
- google_mobile_ads: 528ab4673c5b5fd36321b7e90fc585064cdbaf2b
- GoogleAppMeasurement: 686b48c3c895f3c55c70719041913d5d150b74f6
- GoogleDataTransport: ea169759df570f4e37bdee1623ec32a7e64e67c4
+ FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
+ Google-Mobile-Ads-SDK: 32fe7836431a06a29f7734ae092b600137c8108d
+ google_mobile_ads: 53b1f0d74445963e5810e34ac38dfb27aabe278e
+ GoogleAppMeasurement: 373bcbead1bb6a85be7a64d5d8f96284b762ea9c
+ GoogleDataTransport: f0308f5905a745f94fb91fea9c6cbaf3831cb1bd
GoogleUserMessagingPlatform: 5f8b30daf181805317b6b985bb51c1ff3beca054
- GoogleUtilities: c2bdc4cf2ce786c4d2e6b3bcfd599a25ca78f06f
+ GoogleUtilities: 9aa0ad5a7bc171f8bae016300bfcfa3fb8425749
nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431
- package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
+ package_info_plus: fd030dabf36271f146f1f3beacd48f564b0f17f7
PromisesObjC: 09985d6d70fbe7878040aa746d78236e6946d2ef
PromisesSwift: cf9eb58666a43bbe007302226e510b16c1e10959
- Sentry: 8ffc397d98fe58d693e73959b26ed0eaee55646a
- sentry_flutter: 5028afacfa875785cb0e3682aece171fcd9dc0d5
- SentryPrivate: bf776a47a131648f5023097215987b40fbd47025
- shared_preferences_foundation: 986fc17f3d3251412d18b0265f9c64113a8c2472
+ Sentry: 11776f6a25a128808d793d0d41bb7ad873b5ae4f
+ sentry_flutter: 886dbeb2674ba1232f540c54311a774bb50fda42
+ SentryPrivate: b3c448eacdabe9eab7679a2e0af609c608f91572
+ shared_preferences_foundation: e2dae3258e06f44cc55f49d42024fd8dd03c590c
+ sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
+ webview_flutter_wkwebview: 2e2d318f21a5e036e2c3f26171342e95908bd60a
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
index 8a4bf76..eb9a400 100644
--- a/ios/Runner.xcodeproj/project.pbxproj
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -144,6 +144,7 @@
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
CFFB3E3FBDDA19ECF106599F /* [CP] Embed Pods Frameworks */,
6EF480E9CCF581086B266CE4 /* [CP] Copy Pods Resources */,
+ BDED4F91E7EB6CAF119A332F /* [firebase_crashlytics] Crashlytics Upload Symbols */,
);
buildRules = (
);
@@ -210,6 +211,7 @@
files = (
);
inputPaths = (
+ "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
@@ -272,6 +274,26 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
+ BDED4F91E7EB6CAF119A332F /* [firebase_crashlytics] Crashlytics Upload Symbols */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ "\"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}\"",
+ "\"$(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)\"",
+ );
+ name = "[firebase_crashlytics] Crashlytics Upload Symbols";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"$PODS_ROOT/FirebaseCrashlytics/upload-symbols\" --flutter-project \"$PROJECT_DIR/firebase_app_id_file.json\" ";
+ };
CFFB3E3FBDDA19ECF106599F /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard
index f3c2851..ba21071 100644
--- a/ios/Runner/Base.lproj/Main.storyboard
+++ b/ios/Runner/Base.lproj/Main.storyboard
@@ -1,8 +1,10 @@
-
-
+
+
+
-
+
+
@@ -14,13 +16,14 @@
-
+
-
+
+
diff --git a/lib/helpers/database.dart b/lib/helpers/database.dart
new file mode 100644
index 0000000..ceaf914
--- /dev/null
+++ b/lib/helpers/database.dart
@@ -0,0 +1,42 @@
+import 'dart:async';
+import 'dart:developer';
+import 'dart:io';
+import 'package:path/path.dart';
+
+import 'package:sqflite/sqflite.dart';
+
+class DatabaseHelper {
+ Database? _database;
+
+ Future get database async {
+ if (_database != null) return _database!;
+
+ return await initDB();
+ }
+
+ initDB() async {
+ String path = join(await getDatabasesPath(), 'seasonal.db');
+
+ return await openDatabase(
+ path,
+ version: 1,
+ onCreate: _onCreate,
+ onUpgrade: _onUpgrade
+ );
+ }
+
+ FutureOr _onCreate(Database db, int version) {
+ String sql = '''
+ CREATE TABLE Food(
+ id INTEGER PRIMARY KEY,
+ name TEXT,
+ description TEXT,
+ image TEXT,
+ months TEXT)
+ ''';
+
+ db.execute(sql);
+ }
+
+ FutureOr _onUpgrade(Database db, int oldVersion, int newVersion) {}
+}
\ No newline at end of file
diff --git a/lib/main.dart b/lib/main.dart
index 79c405c..a5727af 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -5,7 +5,6 @@ import 'package:firebase_core/firebase_core.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
import 'firebase_options.dart';
import 'package:google_mobile_ads/google_mobile_ads.dart';
-import 'package:seasonal/screens/list_screen.dart';
import 'package:seasonal/screens/tab_screen.dart';
void main() async {
@@ -31,7 +30,7 @@ void main() async {
// We recommend adjusting this value in production.
options.tracesSampleRate = 1.0;
},
- appRunner: () => runApp(MyApp()),
+ appRunner: () => runApp(const MyApp()),
);
}
@@ -49,64 +48,4 @@ class MyApp extends StatelessWidget {
home: const TabScreen(),
);
}
-}
-
-// class MyHomePage extends StatefulWidget {
-// const MyHomePage({super.key});
-//
-// @override
-// State createState() => _MyHomePageState();
-// }
-//
-// class _MyHomePageState extends State {
-// late Future _goodData;
-//
-// Future getGoods() async {
-// log('Start getGoods()');
-//
-// var token = Constants.apiToken;
-//
-// var url = Uri.parse("${Constants.apiBaseUrl}/dev/goods");
-// final response = await http.get(url, headers: {
-// 'Content-Type': 'application/json',
-// 'Authorization': 'Bearer $token',
-// });
-//
-// return json.decode(response.body);
-// }
-//
-// @override
-// void initState() {
-// super.initState();
-//
-// _goodData = getGoods();
-// }
-//
-// @override
-// Widget build(BuildContext context) {
-// const title = '제철음식';
-//
-// // 처음 시작할때 API가 느리면 listview에 아무것도 나오지 않음
-// // - FutureBuilder 사용 추가
-// return Scaffold(
-// appBar: AppBar(
-// title: const Text(title),
-// elevation: 1,
-// shadowColor: Theme.of(context).shadowColor,
-// ),
-// body: FutureBuilder(
-// future: _goodData,
-// builder: (BuildContext context, AsyncSnapshot snapshot) {
-// var goods = snapshot.data ?? [];
-//
-// switch (snapshot.connectionState) {
-// case ConnectionState.waiting:
-// return const Center(child: CircularProgressIndicator());
-// default:
-// return HomeListViewWidget(goods: goods);
-// }
-// }
-// )
-// );
-// }
-// }
+}
\ No newline at end of file
diff --git a/lib/models/food.dart b/lib/models/food.dart
new file mode 100644
index 0000000..795c109
--- /dev/null
+++ b/lib/models/food.dart
@@ -0,0 +1,35 @@
+class Food {
+ final int id;
+ final String name;
+ final String description;
+ final String image;
+ final List? months;
+
+ const Food({
+ required this.id,
+ required this.name,
+ required this.description,
+ required this.image,
+ required this.months,
+ });
+
+ factory Food.fromJson(Map json) {
+ return Food(
+ id: json['id'],
+ name: json['name'],
+ description: json['description'],
+ image: json['image'],
+ months: json['months'],
+ );
+ }
+
+ Map toJson() {
+ final Map data = {};
+ data['id'] = id;
+ data['name'] = name;
+ data['description'] = description;
+ data['image'] = image;
+ data['months'] = months;
+ return data;
+ }
+}
\ No newline at end of file
diff --git a/lib/prefs/bookdmark_sharedpreferences.dart b/lib/prefs/bookdmark_sharedpreferences.dart
index 167a587..f488946 100644
--- a/lib/prefs/bookdmark_sharedpreferences.dart
+++ b/lib/prefs/bookdmark_sharedpreferences.dart
@@ -1,5 +1,4 @@
import 'dart:convert';
-import 'dart:developer';
import 'package:seasonal/models/bookmark.dart';
import 'package:shared_preferences/shared_preferences.dart';
@@ -9,7 +8,6 @@ class BookmarkSharedPreferences {
Future> getBookmarks() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
String? json = prefs.getString(_key);
- print('${json}');
if (json != null) {
List list = jsonDecode(json);
return list.map((e) => Bookmark.fromJson(e)).toList();
@@ -29,7 +27,6 @@ class BookmarkSharedPreferences {
List bookmarks = await getBookmarks();
bookmarks.add(bookmark);
SharedPreferences prefs = await SharedPreferences.getInstance();
- print('${bookmarks}');
prefs.setString(_key, jsonEncode(bookmarks.map((e) => e.toJson()).toList()));
}
diff --git a/lib/repositories/food_repository.dart b/lib/repositories/food_repository.dart
new file mode 100644
index 0000000..e3e0067
--- /dev/null
+++ b/lib/repositories/food_repository.dart
@@ -0,0 +1,40 @@
+import 'dart:developer';
+
+import 'package:sqflite/sqflite.dart';
+
+import '../models/food.dart';
+
+class FoodRepository
+{
+ Future select(database, id) async {
+ try {
+ List