Closed coyksdev closed 2 years ago
@hcwidget
Widget app(WidgetRef ref) => MaterialApp(
...
routes: {
Routes.auth: (_) => const SignInScreen(),
Routes.home: (_) => const HomePage(),
Routes.store: (_) => const StorePage(),
Routes.profile: (_) => const ProfilePage(),
Routes.loading: (_) => const Scaffold(
body: SafeArea(child: Center(child: CircularProgressIndicator()))),
},
);
class Routes {
static const auth = '/auth';
static const home = '/home';
static const store = '/store';
static const profile = '/profile';
static const loading = '/loading';
}
Defining static properties is not supported and likely isn't something that can be supported.
I'd suggest waiting until Dart implements static extensions, at which point you should be able to define them on your own. In the meantime, you likely can implement your code without relying on a static function
Is there a way to achieve this using functional widget?