mirrored_repositories/flutter_mall/lib
import 'package:flutter/foundation.dart';

///
/// provider demo
///
/// 作者：刘飞华
/// 日期：2023/11/21 17:17
///
class Counter with ChangeNotifier, DiagnosticableTreeMixin {
  int _count = 0;

  int get count => _count;

  void increment() {
    _count++;
    notifyListeners();
  }

  /// Makes `Counter` readable inside the devtools by listing all of its properties
  @override
  void debugFillProperties(DiagnosticPropertiesBuilder properties) {
    super.debugFillProperties(properties);
    properties.add(IntProperty('count', count));
  }
}
