From 482c8bd71fcc6840a84e45c5d8abba76045252cf Mon Sep 17 00:00:00 2001 From: w8385 Date: Tue, 2 Jan 2024 00:53:42 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20Grass=20=EB=AA=A8=EB=8D=B8=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apis/solved_api/lib/src/models/grass.dart | 47 ------------------- 1 file changed, 47 deletions(-) delete mode 100644 my_solved/packages/apis/solved_api/lib/src/models/grass.dart diff --git a/my_solved/packages/apis/solved_api/lib/src/models/grass.dart b/my_solved/packages/apis/solved_api/lib/src/models/grass.dart deleted file mode 100644 index 9e4c88e7..00000000 --- a/my_solved/packages/apis/solved_api/lib/src/models/grass.dart +++ /dev/null @@ -1,47 +0,0 @@ -class Grass { - final int day; - final int month; - final int year; - final int solvedCount; - final bool isSolved; - final bool isFrozen; - final bool isRepaired; - - const Grass( - {required this.day, - required this.month, - required this.year, - required this.solvedCount, - required this.isSolved, - required this.isFrozen, - required this.isRepaired}); - - factory Grass.fromJson(Map json) { - final int year = int.parse(json['date'].split('-')[0]); - final int month = int.parse(json['date'].split('-')[1]); - final int day = int.parse(json['date'].split('-')[2]); - - int solvedCount; - bool isSolved; - if (json['value'].runtimeType == int) { - solvedCount = json['value']; - isSolved = true; - } else { - solvedCount = 0; - isSolved = false; - } - - final bool isFrozen = json['value'] == 'frozen'; - final bool isRepaired = json['value'] == 'repaired'; - - return Grass( - year: year, - month: month, - day: day, - solvedCount: solvedCount, - isSolved: isSolved, - isFrozen: isFrozen, - isRepaired: isRepaired, - ); - } -}