feat: add auth screens and state management
This commit is contained in:
28
lib/app.dart
Normal file
28
lib/app.dart
Normal file
@@ -0,0 +1,28 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:phone_login/auth/auth_state.dart';
|
||||
import 'package:phone_login/auth/phone_input_screen.dart';
|
||||
import 'package:phone_login/auth/sms_verification_screen.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
final _router = GoRouter(
|
||||
routes: [
|
||||
GoRoute(path: '/', builder: (context, state) => const PhoneInputScreen()),
|
||||
GoRoute(
|
||||
path: '/sms_verify',
|
||||
builder: (context, state) => const SmsVerificationScreen(),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
class App extends StatelessWidget {
|
||||
const App({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ChangeNotifierProvider(
|
||||
create: (_) => AuthState(),
|
||||
child: MaterialApp.router(routerConfig: _router),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user