Closed cliftonlabrum closed 11 months ago
Flutter 3.10.5 and Dart 3.0.5
The initial example on the Pub.dev listing shows:
// Create a ChangeNotifier based model class UserModel extends ChangeNotifier { get name = _name; ... }
When I use the get name = _name; syntax, I see this error:
get name = _name;
Only factory constructor can specify '=' redirection.
If I add the type and a shorthand return arrow, it works:
String get name => _name;
I may be doing something wrong, but I just wanted to note this. 😄
Oh, thanks a lot, that should definitely be a =>
Flutter 3.10.5 and Dart 3.0.5
The initial example on the Pub.dev listing shows:
When I use the
get name = _name;
syntax, I see this error:If I add the type and a shorthand return arrow, it works:
I may be doing something wrong, but I just wanted to note this. 😄