Skip to content

Instantly share code, notes, and snippets.

@eEQK
Last active January 16, 2025 14:11
Show Gist options
  • Save eEQK/084dbe014310e5d16a3f4c05220d83bd to your computer and use it in GitHub Desktop.
Save eEQK/084dbe014310e5d16a3f4c05220d83bd to your computer and use it in GitHub Desktop.
import 'package:bloc/bloc.dart';
class _Cubit extends Cubit<int> {
_Cubit() : super(0);
}
final _foo = Foo(() => _Cubit());
typedef CubitFactory<T extends Cubit<R>, R> = T Function();
class Foo<T extends Cubit<R>, R> {
Foo(
CubitFactory<T, R> fn,
) {}
}
void main() {
print(_foo.runtimeType);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment