Dman_14

Untitled

Jan 25th, 2021
732
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import 'package:flutter/material.dart';
  2. import 'package:idea_tracker/locator.dart';
  3. import 'package:idea_tracker/model/sprint.dart';
  4. import 'package:idea_tracker/service/sprint_service.dart';
  5.  
  6. class SprintsPageController extends ChangeNotifier {
  7.   final _sprintService = locator<SprintService>();
  8.  
  9.   List<Sprint> _sprints;
  10.  
  11.   List<Sprint> get sprints => _sprints ?? [];
  12.  
  13.   set sprints(List<Sprint> value) {
  14.     if (_sprints == value) return;
  15.  
  16.     _sprints = value;
  17.     notifyListeners();
  18.   }
  19.  
  20.   initialize() async {
  21.     sprints = await _sprintService.getAll();
  22.   }
  23. }
  24.  
RAW Paste Data