title: StateNotifier with riverpod
body: <p>I'm trying to use riverpod stateNotifier to toggle open and close a drawer. The intent was if the drawer is open then the homescreen would shrink/grow via the AnimatedContainer. I'm not sure what the problem is but the value x and y is not being read or watch by the AnimatedContainer. Plus am I using stateNotifier correctly?</p>
  <p><strong>Home screen</strong></p>
  <pre><code>@override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Consumer(
        builder: (context, watch, child) {
          final drawer = watch(drawerProvider).state;
          return GestureDetector(
            onTap: () {
              if(drawer.isOpen){
                context.read(drawerProvider).toggleDrawer();
              }
            },
            child: AnimatedContainer(
              transform: Matrix4.translationValues(MediaQuery.of(context).size.height * drawer.x,MediaQuery.of(context).size.height * drawer.y, 0)..scale(drawer.scale),
              duration: Duration(milliseconds: 250),
              decoration: BoxDecoration(
                  color: Colors.white,
                  borderRadius: BorderRadius.circular(drawer.isOpen ? 20 : 0)),
              child:Container(
                  ),
              ),
            );
        },
      ),
    );
  }
  </code></pre>
  <p><strong>Drawer Provider</strong></p>
  <pre><code>import 'package:flutter_riverpod/all.dart';
  
  class Drawer{
    double x,y,scale;
    bool isOpen;
    Drawer(this.x,this.y,this.scale,this.isOpen);
  }
  
  class DrawerNotifier extends StateNotifier&lt;Drawer&gt;{
    DrawerNotifier(Drawer state) : super(Drawer(0.5,0.1,0.8,true));
    void toggleDrawer(){
      if(state.isOpen == true){
        print(true);
        state.x = 0;
        state.y = 0;
        state.scale = 1;
        state.isOpen = false;
      }else{
        print(false);
        state.x = 0.5;
        state.y = 0.1;
        state.scale = 0.8;
        state.isOpen = true;
      }
    }
  }
  
  final drawerProvider = StateNotifierProvider((ref){
    return DrawerNotifier(Drawer(0.5,0.1,0.8,true));
  });
  </code></pre>