Skip to content

Commit

Permalink
Add Financial model and datasource with Hive
Browse files Browse the repository at this point in the history
  • Loading branch information
SepehrFakoori committed Jul 11, 2024
1 parent 4f89a34 commit df68b0f
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/data/datasource/financial_Item_datasource.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import 'package:currency_exchange_rate_app_flutter/data/model/financial_Item.dart';

abstract class IFinancialItemDataSource {
Future<void> addItem(FinancialItem financialItem);
}
31 changes: 31 additions & 0 deletions lib/data/model/financial_Item.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import 'package:hive/hive.dart';

part 'financial_Item.g.dart';

@HiveType(typeId: 0)
class FinancialItem {
@HiveField(0)
String? name;
@HiveField(1)
String? currentPrice;
@HiveField(2)
String? high;
@HiveField(3)
String? low;
@HiveField(4)
String? change;
@HiveField(5)
String? percent;
@HiveField(6)
String? time;

FinancialItem(
this.name,
this.currentPrice,
this.high,
this.low,
this.change,
this.percent,
this.time,
);
}
59 changes: 59 additions & 0 deletions lib/data/model/financial_Item.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit df68b0f

Please sign in to comment.