I can't find a way to create a Swift protocol in Flutter. Do they exist or are there other replacement ways?
In Dart you just create an abstract class and put all the methods you want its children to override. You can also provide an implementation:
abstract class MyAbstractClass {
void method1(); // children must implement this method
void method2() { // this method already has an implementation
print("Just a print");
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With