Skip to content

Instantly share code, notes, and snippets.

View Abdulsametileri's full-sized avatar
🎈
I did not find coding, coding found me

A.Samet İleri Abdulsametileri

🎈
I did not find coding, coding found me
View GitHub Profile
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;
@Abdulsametileri
Abdulsametileri / pubspec.yaml
Created February 11, 2021 09:40
Infinite scroll pubspec
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:
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();
}
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;
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();
}
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'];
[
{
"id": 1,
"date": "01.01.2020",
"amount": 100
},
{
"id": 2,
"date": "02.01.2020",
"amount": 85
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;
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 {
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();
}