I am trying to apply this state management but i cannot implement it. If I use stateless widget, i can easily implement it but stateful it is complicated and i cannot achieve it. Where to implement cubits? Here is my code part =>

class MaintenanceScreen extends StatefulWidget {
  int? locId;
  MaintenanceScreen({required this.locId, Key? key}) : super(key: key);

  @override
  _MaintenanceScreenState createState() => _MaintenanceScreenState();
}

class _MaintenanceScreenState extends State<MaintenanceScreen> {
  final colFr = FrenchColors();


Solution 1: Anas Altarazi

if you mean you want to access locId in _MaintenanceScreenState simply you can use widget.locId inside the build function and flutter will bind this with the widget class.