This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:json_annotation/json_annotation.dart'; | |
part 'card_model.g.dart'; | |
@JsonSerializable(fieldRename: FieldRename.snake) | |
class CardModel { | |
String id; | |
String author; | |
int width; | |
int height; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies: | |
flutter: | |
sdk: flutter | |
cupertino_icons: ^1.0.0 | |
mobx: ^1.2.1+4 | |
flutter_mobx: ^1.1.0+2 | |
json_serializable: ^3.5.1 | |
dio: ^3.0.10 | |
dev_dependencies: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:dio/dio.dart'; | |
import 'package:infinite_scroll/model/card_model.dart'; | |
import 'package:infinite_scroll/service/card_service_interface.dart'; | |
import 'package:infinite_scroll/model/pagination_model.dart'; | |
class CardService extends CardServiceInterface { | |
Dio _dio; | |
CardService() { | |
_dio = Dio(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:infinite_scroll/service/card_service_interface.dart'; | |
import 'package:mobx/mobx.dart'; | |
import '../model/card_model.dart'; | |
import '../service/card_service.dart'; | |
import '../model/pagination_model.dart'; | |
part 'cards_view_model.g.dart'; | |
class CardsViewModel = _CardsViewModel with _$CardsViewModel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_mobx/flutter_mobx.dart'; | |
import 'package:infinite_scroll/viewmodel/cards_view_model.dart'; | |
import 'card_item_view.dart'; | |
class CardsView extends StatefulWidget { | |
@override | |
_CardsViewState createState() => _CardsViewState(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class InvoiceModel { | |
int id; | |
String date; | |
int amount; | |
InvoiceModel({this.id, this.date, this.amount}); | |
InvoiceModel.fromJson(Map<String, dynamic> json) { | |
id = json['id']; | |
date = json['date']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": 1, | |
"date": "01.01.2020", | |
"amount": 100 | |
}, | |
{ | |
"id": 2, | |
"date": "02.01.2020", | |
"amount": 85 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
import 'package:flutter/services.dart'; | |
import 'package:flutter_datatable_with_mobx/model/ex_invoice_model.dart'; | |
import 'package:flutter_datatable_with_mobx/model/invoice_model.dart'; | |
import 'package:mobx/mobx.dart'; | |
part 'datatable_view_model.g.dart'; | |
class DataTableViewModel = _DataTableViewModel with _$DataTableViewModel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:mobx/mobx.dart'; | |
import 'invoice_model.dart'; | |
part 'ex_invoice_model.g.dart'; | |
class ExInvoiceModel extends _ExInvoiceModel with _$ExInvoiceModel { | |
ExInvoiceModel(InvoiceModel invoice) : super(invoice); | |
} | |
abstract class _ExInvoiceModel extends InvoiceModel with Store { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_datatable_with_mobx/common/ex_button.dart'; | |
import 'package:flutter_datatable_with_mobx/model/ex_invoice_model.dart'; | |
import 'package:flutter_datatable_with_mobx/view_model/datatable_view_model.dart'; | |
import 'package:flutter_mobx/flutter_mobx.dart'; | |
class DataTableView extends StatefulWidget { | |
@override | |
_DataTableViewState createState() => _DataTableViewState(); | |
} |
OlderNewer