elCaribe app - customization and branding
This commit is contained in:
20
news-app/lib/data/models/OptionModel.dart
Normal file
20
news-app/lib/data/models/OptionModel.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:news/utils/strings.dart';
|
||||
|
||||
class OptionModel {
|
||||
String? id;
|
||||
String? options;
|
||||
String? counter;
|
||||
double? percentage;
|
||||
String? questionId;
|
||||
|
||||
OptionModel({this.id, this.options, this.counter, this.percentage, this.questionId});
|
||||
|
||||
factory OptionModel.fromJson(Map<String, dynamic> json) {
|
||||
return OptionModel(
|
||||
id: json[ID].toString(),
|
||||
options: json[OPTIONS],
|
||||
counter: json[COUNTER].toString(),
|
||||
percentage: (json[PERCENTAGE].runtimeType == int) ? double.parse(json[PERCENTAGE].toString()) : json[PERCENTAGE],
|
||||
questionId: json[QUESTION_ID].toString());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user