feat: profile and subs
This commit is contained in:
@@ -10,15 +10,20 @@ import 'features/auth/auth_cubit.dart';
|
||||
import 'features/auth/auth_repository.dart';
|
||||
import 'features/auth/mobile_screen.dart';
|
||||
import 'features/auth/otp_screen.dart';
|
||||
import 'features/auth/profile_setup_screen.dart';
|
||||
import 'features/game/game_cubit.dart';
|
||||
import 'features/game/game_repository.dart';
|
||||
import 'features/game/game_screen.dart';
|
||||
import 'features/game/tier_list_screen.dart';
|
||||
import 'features/lobby/lobby_screen.dart';
|
||||
import 'features/lobby/wallet_cubit.dart';
|
||||
import 'features/private/private_entry_screen.dart';
|
||||
import 'features/private/private_table_screen.dart';
|
||||
import 'features/profile/profile_screen.dart';
|
||||
import 'features/shop/shop_cubit.dart';
|
||||
import 'features/shop/shop_repository.dart';
|
||||
import 'features/shop/shop_screen.dart';
|
||||
import 'features/shop/vip_screen.dart';
|
||||
|
||||
class HakemApp extends StatelessWidget {
|
||||
final ApiClient api;
|
||||
@@ -41,7 +46,35 @@ class HakemApp extends StatelessWidget {
|
||||
routes: [
|
||||
GoRoute(path: '/login', builder: (_, __) => const MobileScreen()),
|
||||
GoRoute(path: '/otp', builder: (_, __) => const OtpScreen()),
|
||||
GoRoute(path: '/setup', builder: (_, __) => const ProfileSetupScreen()),
|
||||
GoRoute(path: '/lobby', builder: (_, __) => const LobbyScreen()),
|
||||
GoRoute(
|
||||
path: '/profile',
|
||||
builder: (_, __) => ProfileScreen(api: api)),
|
||||
GoRoute(
|
||||
path: '/private',
|
||||
builder: (_, __) => PrivateEntryScreen(api: api)),
|
||||
GoRoute(
|
||||
path: '/private/room',
|
||||
builder: (_, st) {
|
||||
final create = st.uri.queryParameters['create'] == '1';
|
||||
final joinCode = st.uri.queryParameters['join'];
|
||||
return FutureBuilder<String?>(
|
||||
future: tokenStorage.read(),
|
||||
builder: (context, snap) {
|
||||
if (!snap.hasData) {
|
||||
return const Scaffold(
|
||||
body: Center(child: CircularProgressIndicator()));
|
||||
}
|
||||
return PrivateTableScreen(
|
||||
token: snap.data!,
|
||||
create: create,
|
||||
joinCode: joinCode,
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
path: '/shop',
|
||||
builder: (_, __) => BlocProvider(
|
||||
@@ -49,6 +82,13 @@ class HakemApp extends StatelessWidget {
|
||||
child: const ShopScreen(),
|
||||
),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/vip',
|
||||
builder: (_, __) => BlocProvider(
|
||||
create: (_) => ShopCubit(ShopRepository(api))..load(),
|
||||
child: const VipScreen(),
|
||||
),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/game/tiers',
|
||||
builder: (_, __) => TierListScreen(repo: GameRepository(api)),
|
||||
|
||||
Reference in New Issue
Block a user