diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 9d7a33c..24a5074 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -95,7 +95,7 @@ SPEC CHECKSUMS: shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 sqlite3: 6e2d4a4879854d0ec86b476bf3c3e30870bac273 sqlite3_flutter_libs: eb769059df0356dc52ddda040f09cacc9391a7cf - url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812 + url_launcher_ios: bf5ce03e0e2088bad9cc378ea97fa0ed5b49673b PODFILE CHECKSUM: 3f3697c847c52bb2f1c7146b71ef2faef67d110f diff --git a/lib/main.dart b/lib/main.dart index 776fbe7..523eeb9 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; -import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:intl/date_symbol_data_local.dart'; import 'package:nightary/main_app.dart'; import 'package:nightary/utilities/app_routes.dart'; diff --git a/lib/providers/sleep_record_local_provider.dart b/lib/providers/sleep_record_local_provider.dart index d81e522..8f35615 100644 --- a/lib/providers/sleep_record_local_provider.dart +++ b/lib/providers/sleep_record_local_provider.dart @@ -15,20 +15,23 @@ class SleepRecordLocalProvider extends GetConnect { httpClient ..baseUrl = "https://nightary.dcs-hyungjoon.com/" ..timeout = const Duration(seconds: 60) - ..addRequestModifier((request) { - LogSystem.logger.d("Request: ${request.method} ${request.url}"); + ..addRequestModifier((request) { + LogSystem.logger.d("Request: ${request.method} ${request.url}"); - return request; - }) - ..addResponseModifier((request, response) { - if(response.status.hasError){ - LogSystem.logger.e("Response: ${response.statusCode} ${response.statusCode} ${response.statusText}"); - } else { - LogSystem.logger.d("Response: ${response.statusCode} ${response.body}"); - } + return request; + }) + ..addResponseModifier((request, response) { + if (response.status.hasError) { + LogSystem.logger.e( + "Response: ${response.statusCode} ${response.statusCode} ${response.statusText}"); + } else { + LogSystem.logger + .d("Response: ${response.statusCode} ${response.body}"); + } - return response; - }); + return response; + }); + } Future findRecentOne() async { try { @@ -41,7 +44,6 @@ class SleepRecordLocalProvider extends GetConnect { Future> saveAll(List entities) async { return await _sleepRecordDao.saveAll(entities); - } Future> readSleepRecordsLimit(int limitCnt) async { @@ -51,7 +53,8 @@ class SleepRecordLocalProvider extends GetConnect { return sleepRecords; } - Future> getPredictedSleepByLastTwentySleeps(String endpoint, final requestBody) async { + Future> getPredictedSleepByLastTwentySleeps( + String endpoint, final requestBody) async { final response = await post(endpoint, requestBody, contentType: "application/json"); final data = response.body as Map; @@ -65,8 +68,9 @@ class SleepRecordLocalProvider extends GetConnect { } return predictedSleep; } - - Future> getAnalysisSleepByLastTwentySleeps(endpoint, final requestBody) async{ + + Future> getAnalysisSleepByLastTwentySleeps( + endpoint, final requestBody) async { final Response response = await post(endpoint, requestBody, contentType: "application/json"); print(response.body); diff --git a/lib/repositories/sleep_record_repository.dart b/lib/repositories/sleep_record_repository.dart index b10acc2..5523373 100644 --- a/lib/repositories/sleep_record_repository.dart +++ b/lib/repositories/sleep_record_repository.dart @@ -230,10 +230,11 @@ class SleepRecordRepository extends GetxService { "liabilities": liabilities }; } + Future> getPredictedSleepByLastTwentySleeps() async { // 최근 20개의 수면 기록을 가져온다. List sleepRecords = - await _provider.readSleepRecordsLimit(20); + await _sleepRecordProvider.readSleepRecordsLimit(20); String endpoint = "analyze/predict/"; final startSleepDateList = []; final endSleepDateList = []; @@ -245,13 +246,14 @@ class SleepRecordRepository extends GetxService { "startSleepDate": startSleepDateList, "endSleepDate": endSleepDateList }; - return await _provider.getPredictedSleepByLastTwentySleeps(endpoint, requestBody); + return await _sleepRecordProvider.getPredictedSleepByLastTwentySleeps( + endpoint, requestBody); } Future> getAnalysisSleepByLastTwentySleeps() async { // 최근 20개의 수면 기록을 가져온다. List sleepRecords = - await _provider.readSleepRecordsLimit(20); + await _sleepRecordProvider.readSleepRecordsLimit(20); String endpoint = "analyze/analyze/"; final startSleepDateList = []; final endSleepDateList = []; @@ -263,7 +265,8 @@ class SleepRecordRepository extends GetxService { "startSleepDate": startSleepDateList, "endSleepDate": endSleepDateList }; - return await _provider.getAnalysisSleepByLastTwentySleeps(endpoint, requestBody); + return await _sleepRecordProvider.getAnalysisSleepByLastTwentySleeps( + endpoint, requestBody); } } diff --git a/pubspec.yaml b/pubspec.yaml index 4700ab1..93b2881 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: nightary description: Sleep and Liver Care Management Application publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 1.0.0+4 +version: 1.0.0+5 environment: sdk: '>=3.1.3 <4.0.0'