INFRA: Set Up Project.
This commit is contained in:
48
lib/models/currency_model.dart
Normal file
48
lib/models/currency_model.dart
Normal file
@@ -0,0 +1,48 @@
|
||||
class CurrencyModel {
|
||||
String code;
|
||||
int decimal;
|
||||
String id;
|
||||
bool isactive;
|
||||
num rounding;
|
||||
String name;
|
||||
String symbol;
|
||||
bool symbolatright;
|
||||
|
||||
CurrencyModel({
|
||||
this.code = '',
|
||||
this.decimal = 0,
|
||||
this.isactive = false,
|
||||
this.id = '',
|
||||
this.name = '',
|
||||
this.rounding = 0,
|
||||
this.symbol = '',
|
||||
this.symbolatright = false,
|
||||
});
|
||||
|
||||
factory CurrencyModel.fromJson(Map<String, dynamic> parsedJson) {
|
||||
return CurrencyModel(
|
||||
code: parsedJson['code'] ?? '',
|
||||
decimal: parsedJson['decimal_degits'] ?? 0,
|
||||
isactive: parsedJson['isActive'] ?? '',
|
||||
id: parsedJson['id'] ?? '',
|
||||
name: parsedJson['name'] ?? '',
|
||||
rounding: parsedJson['rounding'] ?? 0,
|
||||
symbol: parsedJson['symbol'] ?? '',
|
||||
symbolatright: parsedJson['symbolAtRight'] ?? '',
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'code': code,
|
||||
'decimal_degits': decimal,
|
||||
'isActive': isactive,
|
||||
'rounding': rounding,
|
||||
'id': id,
|
||||
'name': name,
|
||||
'symbol': symbol,
|
||||
'symbolAtRight': symbolatright,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user