
import 'package:flutter/material.dart';
import 'package:twong/api/index.dart';
import 'package:twong/utils/index.dart';
import 'package:twong/models/index.dart';

class HomeModel with ChangeNotifier {
  Home _data;
  Color _color = Colors.red;
  HomeModel();
  bool waiting = false;

  Color get headerColor => _color;
  Home get data {
    // if(_data == null) {
    //   if(waiting) {
    //     return null;
    //   }
    //
    //   waiting = true;
    //   Network.inst.getIndex();
    // }

    return _data;
  }

  void update(Home data) {
    _data = data;
    waiting = false;
    notifyListeners();
  }

  void setHeaderColor(Color color) {
    this._color = color;
    notifyListeners();
  }
}