
import 'package:flutter/cupertino.dart';
import 'package:localstore/localstore.dart';

import '../api/apiResponse.dart';

abstract class DataHolder extends ChangeNotifier {

  CollectionRef storage(String path) => Localstore.instance.collection(path);

  void run();
  List<ApiResponse?> properties();

  bool primaryLoading() {
    // log("${toString()} ${properties().map((e) => e != null ? "1" : "0").join(", ")}");
    for(var element in properties()) {
      if(element == null) return true;
    }
    return false;
    //return properties().where((element) => element != null).isEmpty;
  }
}
