import 'package:flutter/material.dart';
import 'package:test_sa/models/base.dart';

class NullableLoadingProvider extends LoadingListNotifier<Base> {
  @override
  Future getDate() {
    return Future.value();
  }
}

abstract class LoadingListNotifier<T extends Base> extends ChangeNotifier {
  int? stateCode;

  List<T> items = [];

  bool _loading = false;

  bool get loading => _loading;

  set loading(bool value) {
    _loading = value;
    notifyListeners();
  }

  void reset() {
    items = [];
    _loading = false;
    stateCode = null;
  }

  Future getDate();
}
