Skip to content

Commit

Permalink
login [nfc]: Reorder members of LoginPage
Browse files Browse the repository at this point in the history
Greg points out, referring to the Flutter style guide at
  https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#order-other-class-members-in-a-way-that-makes-sense :

#600 (comment)
> I think it's likely helpful to treat [`buildRoute`] for the
> ordering as if it does return the class's type, though. It plays
> pretty much the role of a factory constructor — it's the thing
> that application code, at least, should always use instead of
> calling the actual constructor directly. (Possibly we should even
> make the constructor private when we have a `buildRoute` method
> like this; but that might be annoying in tests.)
  • Loading branch information
chrisbobbe authored and gnprice committed Apr 2, 2024
1 parent 1bd1fd7 commit 60c5245
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/widgets/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,13 @@ class _AddAccountPageState extends State<AddAccountPage> {
class LoginPage extends StatefulWidget {
const LoginPage({super.key, required this.serverSettings});

final GetServerSettingsResult serverSettings;

static Route<void> buildRoute({required GetServerSettingsResult serverSettings}) {
return _LoginSequenceRoute(
page: LoginPage(serverSettings: serverSettings));
}

final GetServerSettingsResult serverSettings;

@override
State<LoginPage> createState() => _LoginPageState();
}
Expand Down

0 comments on commit 60c5245

Please sign in to comment.