You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.0 KiB
33 lines
1.0 KiB
// Flutter imports:
|
|
import 'package:flutter/material.dart';
|
|
|
|
// Project imports:
|
|
import 'package:aku_community_manager/mock_models/outdoor_models/outdoor_model.dart';
|
|
|
|
class OutdoorProvider extends ChangeNotifier {
|
|
List<ItemsOutdoorModel> _itemOutdoorModel = ItemsOutdoorModel.initList();
|
|
List<ItemsOutdoorModel> get itemOutdoorModels => _itemOutdoorModel;
|
|
addOutdoormodel(ItemsOutdoorModel model) {
|
|
_itemOutdoorModel.insert(0, model);
|
|
notifyListeners();
|
|
}
|
|
|
|
List<ItemsOutdoorModel> getOutdoorModels(int index) {
|
|
return [
|
|
_itemOutdoorModel
|
|
.where((element) => element.status == OUTDOORSTATUS.NOT_OUT)
|
|
.toList(),
|
|
_itemOutdoorModel
|
|
.where((element) => element.status == OUTDOORSTATUS.OUT_DONE)
|
|
.toList(),
|
|
_itemOutdoorModel
|
|
.where((element) => element.status == OUTDOORSTATUS.REJECTED)
|
|
.toList(),
|
|
_itemOutdoorModel
|
|
.where((element) => element.status == OUTDOORSTATUS.CANCELLATION)
|
|
.toList(),
|
|
_itemOutdoorModel,
|
|
][index];
|
|
}
|
|
}
|