diff --git a/build/native_assets/macos/native_assets.json b/build/native_assets/macos/native_assets.json new file mode 100644 index 0000000..523bfc7 --- /dev/null +++ b/build/native_assets/macos/native_assets.json @@ -0,0 +1 @@ +{"format-version":[1,0,0],"native-assets":{}} \ No newline at end of file diff --git a/build/test_cache/build/b6862f53c5db0dffd80a6274ce6c73bd.cache.dill.track.dill b/build/test_cache/build/b6862f53c5db0dffd80a6274ce6c73bd.cache.dill.track.dill new file mode 100644 index 0000000..b590fc8 Binary files /dev/null and b/build/test_cache/build/b6862f53c5db0dffd80a6274ce6c73bd.cache.dill.track.dill differ diff --git a/build/unit_test_assets/AssetManifest.bin b/build/unit_test_assets/AssetManifest.bin new file mode 100644 index 0000000..86d111f Binary files /dev/null and b/build/unit_test_assets/AssetManifest.bin differ diff --git a/build/unit_test_assets/AssetManifest.json b/build/unit_test_assets/AssetManifest.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/build/unit_test_assets/AssetManifest.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/build/unit_test_assets/FontManifest.json b/build/unit_test_assets/FontManifest.json new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/build/unit_test_assets/FontManifest.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/build/unit_test_assets/NOTICES.Z b/build/unit_test_assets/NOTICES.Z new file mode 100644 index 0000000..0df2682 Binary files /dev/null and b/build/unit_test_assets/NOTICES.Z differ diff --git a/build/unit_test_assets/NativeAssetsManifest.json b/build/unit_test_assets/NativeAssetsManifest.json new file mode 100644 index 0000000..523bfc7 --- /dev/null +++ b/build/unit_test_assets/NativeAssetsManifest.json @@ -0,0 +1 @@ +{"format-version":[1,0,0],"native-assets":{}} \ No newline at end of file diff --git a/build/unit_test_assets/shaders/ink_sparkle.frag b/build/unit_test_assets/shaders/ink_sparkle.frag new file mode 100644 index 0000000..85fc357 Binary files /dev/null and b/build/unit_test_assets/shaders/ink_sparkle.frag differ diff --git a/lib/dart_debug_sample.dart b/lib/dart_debug_sample.dart index 5472e58..82c2ff3 100644 --- a/lib/dart_debug_sample.dart +++ b/lib/dart_debug_sample.dart @@ -2,20 +2,25 @@ import 'package:intl/intl.dart'; class YukymController { + String nowDate; + int nowTime; // DateTime.parse(_userData.value!.selectDate) - String nowDate = DateFormat('yyyy-mm-dd').format(DateTime.now()); + // String nowDate = DateFormat('yyyy-MM-dd').format(DateTime.now()); - late String nowTime; + YukymController({String? nowDate, int? nowTime}) + : nowDate = nowDate ?? DateFormat('yyyy-MM-dd').format(DateTime.now()), + nowTime = nowTime ?? DateTime.now().hour.toInt(); // 1. 자시의 국 : 갑자1국 = getTyOne()의 값 String getTyA() { - List timeDataOne = - _getTimeDataOne(nowDate); + // List timeDataOne = + // _getTimeDataOne(nowDate); - if (timeDataOne.isNotEmpty) { - nowTime = timeDataOne.first.ty1; + if (nowDate.isNotEmpty) { + // nowTime = timeDataOne.first.ty1; final month = nowDate.substring(5, 7); + if (month == '01' || month == '02') { return '경오1국'; } else if (month == '03' || month == '04') { @@ -29,7 +34,7 @@ class YukymController { } else if (month == '11' || month == '12') { return '경오6국'; } - return nowTime; + return '경오7국'; } else { // Handle the case when the list is empty return '경오7국'; // Or any other appropriate action @@ -39,40 +44,43 @@ class YukymController { String getTyB() { List timeDataOne = _getTimeDataOne(nowDate); - String result = timeDataOne.first.ty12; + // String result = timeDataOne.first.ty12; - final nowTime = DateTime.now(); - if (nowTime.hour >= 0 || nowTime.hour < 2) { + if (nowTime >= 0 && nowTime < 2) { return timeDataOne.first.ty1; - } else if (nowTime.hour >= 4 || nowTime.hour < 6) { + }else if (nowTime >= 2 && nowTime < 4) { return timeDataOne.first.ty2; - } else if (nowTime.hour >= 6 || nowTime.hour < 8) { + } else if (nowTime >= 4 && nowTime < 6) { return timeDataOne.first.ty3; - } else if (nowTime.hour >= 8 || nowTime.hour < 10) { + } else if (nowTime >= 6 && nowTime < 8) { return timeDataOne.first.ty4; - } else if (nowTime.hour >= 10 || nowTime.hour < 12) { + } else if (nowTime >= 8 && nowTime < 10) { return timeDataOne.first.ty5; - } else if (nowTime.hour >= 12 || nowTime.hour < 14) { + } else if (nowTime >= 10 && nowTime < 12) { return timeDataOne.first.ty6; - } else if (nowTime.hour >= 16 || nowTime.hour < 18) { + } else if (nowTime >= 12 && nowTime < 14) { return timeDataOne.first.ty7; - } else if (nowTime.hour >= 18 || nowTime.hour < 20) { + } else if (nowTime >= 14 && nowTime < 16) { return timeDataOne.first.ty8; - } else if (nowTime.hour >= 20 || nowTime.hour < 22) { + } else if (nowTime >= 16 && nowTime < 18) { return timeDataOne.first.ty9; - } else if (nowTime.hour >= 22 || nowTime.hour < 24) { + } else if (nowTime >= 18 && nowTime < 20) { return timeDataOne.first.ty10; + } else if (nowTime >= 20 && nowTime < 22) { + return timeDataOne.first.ty11; + } else if (nowTime >= 22 && nowTime < 24) { + return timeDataOne.first.ty12; } - return result; + return timeDataOne.first.ty12; } - List _getTimeDataOne(String nowDate) { - List timeDataOne = []; - for (int i = 0; i < 24; i++) { - timeDataOne.add(YukymTimeModel()); - } - return timeDataOne; + List _getTimeDataOne(String nowDate) { + // List timeDataOne = []; + // for (int i = 0; i < 24; i++) { + // timeDataOne.add(YukymTimeModel()); + // } + return [YukymTimeModel()]; } } diff --git a/test/dart_debug_sample_test.dart b/test/dart_debug_sample_test.dart index 71efb52..5889b67 100644 --- a/test/dart_debug_sample_test.dart +++ b/test/dart_debug_sample_test.dart @@ -2,7 +2,16 @@ import 'package:dart_debug_sample/dart_debug_sample.dart'; import 'package:test/test.dart'; void main() { - test('', () { + YukymController yukymController01 = YukymController(nowDate: '2025-07-01', nowTime: 19); + + test('해당 월이 7월이면 getTyA() 값은 경오4국이다 ', () { + final resultA = yukymController01.getTyA(); + expect(resultA, equals('경오4국')); + }); + + test('해당 시가 19시면 getTyB() 값은 값자 10국이다', () { + final resultB = yukymController01.getTyB(); + expect(resultB, equals('갑자10국')); }); }