'Flutter: call class method

Having a simple class:

class MyClass {
...

What is the best way to call its methods?

A: MyClass().method()

B: Add it final MyClass myClass = MyClass(); at the end of the class and call myClass.method()



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source