Skip to content

Instantly share code, notes, and snippets.

@CodingWithTashi
Created March 20, 2022 10:31
Show Gist options
  • Save CodingWithTashi/a9dd192052dcbbaea0611e460118fe7a to your computer and use it in GitHub Desktop.
Save CodingWithTashi/a9dd192052dcbbaea0611e460118fe7a to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
///THIS CLASS IS WHERE STATE ARE BEING MANAGE,EVERYTIME WE CALL update(), IT WILL INFORM
///TEXT WIDGET TO REBUILD
class CounterProvider extends ChangeNotifier {
int count = 0;
update() {
count++;
notifyListeners();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment