How to pass flutter riverpod ref.read() function to another widget
Here is my Custom reusable Widget code. import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; class MyFloatingActionButton extends ConsumerWidget { final Function(ProviderRef ref) onPressed; MyFloatingActionButton(this.onPressed); @override Widget build(BuildContext context, WidgetRef ref) { return FloatingActionButton( onPressed: () => onPressed, tooltip: 'Increment', child: Icon(Icons.add), ); }…