Extending base class with Provider and getit

To start, I’m new to Flutter, so I am completely open to the possibility that my problem stems from a fundamental misunderstanding, but here is my question:

I am trying to get a good understanding of how to use Provider in conjunction with with the get_it package.

I think I understand how to use the Provider pattern in the standard case, by which I mean creating a unique class with a view and a view_model. Where I seem to have become lost is when I design a custom widget as a base template class and then extend that widget so that it can be tailored for use in a specific class view, I’m not seeing how to connect it to the Provider pattern because the base class doesn’t know in advance which view_model it needs to listen to.

Below I will provide short example of what I am doing in the standard case, where things seem to work fine, and then I will show a short example of how I am trying to build the custom widget and extend it…

Here is the sample standard way in which I am using the Provider pattern with get_it, in which everything seems to work just fine:

    class MyScreenView extends StatefulWidget{
      @override
      _ProfileEditScreenViewState createState() => _ProfileEditScreenViewState();
        
    }

    class _MyScreenViewState extends State<MyScreenView>{

      final MyScreenViewModel model = serviceLocator<MyScreenViewModel>();

      @override
       Widget build(BuildContext context) {
         return ChangeNotifierProvider<MyScreenViewModel>(
             create: (context) => model,
         child: Material(
           color: Colors.white,
           child: Consumer<MyScreenViewModel>(
           builder: (context,model,child) => Text(model.someText),
           ),
         ),
         );
       }  
    }

    class MyScreenViewModel extends ChangeNotifier{

       String? _someText;

       MyScreenViewModel() {
          this._someText= 'Sample Text';
       }

       String get someText=> _someText;

       set someText(String value) {
         _someText= value;

         notifyListeners();
       }
    }

Here is an example of how I am trying to build a base class, but am uncertain as to how I go about connecting it to Provider: (The idea here is that the below widget would be part of a more complex widget that would have a view_model where the state for the overall widget would be maintained)

  class BaseCheckBoxTile extends StatefulWidget{
     bool isChecked;
     Function(bool) checkBoxOnChanged;

     BaseCheckBoxTile({this.isChecked = false, required this.checkBoxOnChanged});

@override
 _BaseCheckBoxTileState createState() => _BaseCheckBoxTileState();

 }

 class _BaseCheckBoxTileState extends State<BaseCheckBoxTile>{

   @override
   Widget build(BuildContext context) {
     return SizedBox(
       child: Checkbox(value: widget.isChecked,onChanged: 
 widget.checkBoxOnChanged,),
  );
}
}

class CustomCheckBoxTile extends BaseCheckBoxTile{
  bool isChecked;
  Function(bool) checkBoxOnChanged;

   CustomCheckBoxTile({this.isChecked =false, required this.checkBoxOnChanged})
   :super(isChecked: isChecked, checkBoxOnChanged: checkBoxOnChanged);

}

My instinct is to want to put something in my _BaseCheckBoxTileState that gives me access to the larger widget’s view_model, like what I do in the first example with:

"MyScreenViewModel model = serviceLocator(); "

If I had that, then I could assign the values in my _BaseCheckBoxTileState by referring to the model instead of widget (e.g., model.isChecked instead of widget.isChecked). The model would obviously extend ChangeNotifier, and the view that is making use of the custom widget would wrap the widget in a Consumer. However, the _BaseCheckBoxTileState doesn’t know what view_model to listen to.

Would I accomplish this by putting some generic Type or Object in for my View_Model which could be assigned when the class is built? Or am I approaching this in a completely wrong way?