File tree Expand file tree Collapse file tree 5 files changed +15
-18
lines changed
lib/features/discharge/data/models Expand file tree Collapse file tree 5 files changed +15
-18
lines changed Original file line number Diff line number Diff line change @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22distributionPath =wrapper/dists
33zipStoreBase =GRADLE_USER_HOME
44zipStorePath =wrapper/dists
5- distributionUrl =https\://services.gradle.org/distributions/gradle-8.3 -all.zip
5+ distributionUrl =https\://services.gradle.org/distributions/gradle-8.7 -all.zip
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ pluginManagement {
1818
1919plugins {
2020 id " dev.flutter.flutter-plugin-loader" version " 1.0.0"
21- id " com.android.application" version " 8.1 .0" apply false
22- id " org.jetbrains.kotlin.android" version " 1.8.10 " apply false
21+ id " com.android.application" version " 8.5 .0" apply false
22+ id " org.jetbrains.kotlin.android" version " 2.1.20 " apply false
2323}
2424
2525include " :app"
Original file line number Diff line number Diff line change @@ -15,11 +15,11 @@ class StudentDischarge {
1515
1616 factory StudentDischarge .fromJson (Map <String , dynamic > json) {
1717 return StudentDischarge (
18- sitBc : ( json['sitBc' ] as int ? ) == 1 ,
19- sitBrs : (json['sitBrs' ] as int ? ) == 1 ,
20- sitDep : (json['sitDep' ] as int ? ) == 1 ,
21- sitBf : (json['sitBf' ] as int ? ) == 1 ,
22- sitRu : (json['sitRu' ] as int ? ) == 1 ,
18+ sitDep : toBool (( json['sitDep' ])) ,
19+ sitBf : toBool (json['sitBf' ]) ,
20+ sitBc : toBool (json['sitBc' ]) ,
21+ sitRu : toBool (json['sitRu' ]) ,
22+ sitBrs : toBool (json['sitBrs' ]) ,
2323 );
2424 }
2525
@@ -33,3 +33,10 @@ class StudentDischarge {
3333 };
3434 }
3535}
36+
37+ bool toBool (dynamic value) {
38+ if (value is bool ) return value;
39+ if (value is int ) return value == 1 ;
40+ if (value is String ) return value.toLowerCase () == 'true' || value == '1' ;
41+ return false ; // default fallback
42+ }
Original file line number Diff line number Diff line change @@ -158,14 +158,6 @@ packages:
158158 url: "https://pub.dev"
159159 source: hosted
160160 version: "9.1.0"
161- flutter_dotenv:
162- dependency: "direct dev"
163- description:
164- name: flutter_dotenv
165- sha256: b7c7be5cd9f6ef7a78429cabd2774d3c4af50e79cb2b7593e3d5d763ef95c61b
166- url: "https://pub.dev"
167- source: hosted
168- version: "5.2.1"
169161 flutter_lints:
170162 dependency: "direct dev"
171163 description:
Original file line number Diff line number Diff line change @@ -36,8 +36,6 @@ dev_dependencies:
3636
3737 flutter_lints : ^5.0.0
3838
39- flutter_dotenv : ^5.2.1
40-
4139flutter :
4240 uses-material-design : true
4341 generate : true
You can’t perform that action at this time.
0 commit comments