diff --git a/lib/core/routers/my_routes.dart b/lib/core/routers/my_routes.dart index bdd12c3..bbc3589 100644 --- a/lib/core/routers/my_routes.dart +++ b/lib/core/routers/my_routes.dart @@ -7,6 +7,8 @@ import 'package:hadi_hoda_flutter/features/download/presentation/bloc/download_e import 'package:hadi_hoda_flutter/features/download/presentation/ui/download_page.dart'; import 'package:hadi_hoda_flutter/features/home/presentation/bloc/home_bloc.dart'; import 'package:hadi_hoda_flutter/features/home/presentation/ui/home_page.dart'; +import 'package:hadi_hoda_flutter/features/intro/presentation/bloc/intro_bloc.dart'; +import 'package:hadi_hoda_flutter/features/intro/presentation/ui/intro_page.dart'; import 'package:hadi_hoda_flutter/features/language/presentation/bloc/language_bloc.dart'; import 'package:hadi_hoda_flutter/features/language/presentation/bloc/language_event.dart'; import 'package:hadi_hoda_flutter/features/language/presentation/ui/language_page.dart'; @@ -28,6 +30,7 @@ class Routes { factory Routes() => _i; static const String samplePage = '/sample_page'; + static const String introPage = '/intro_page'; static const String splashPage = '/splash_page'; static const String downloadPage = '/download_page'; static const String languagePage = '/language_page'; @@ -37,9 +40,17 @@ class Routes { } GoRouter get appPages => GoRouter( - initialLocation: Routes.splashPage, + initialLocation: Routes.introPage, navigatorKey: ContextProvider.navigatorKey, routes: [ + GoRoute( + name: Routes.introPage, + path: Routes.introPage, + builder: (context, state) => BlocProvider( + create: (context) => IntroBloc(), + child: const IntroPage(), + ), + ), GoRoute( name: Routes.samplePage, path: Routes.samplePage, diff --git a/lib/features/intro/presentation/bloc/intro_bloc.dart b/lib/features/intro/presentation/bloc/intro_bloc.dart new file mode 100644 index 0000000..595975f --- /dev/null +++ b/lib/features/intro/presentation/bloc/intro_bloc.dart @@ -0,0 +1,23 @@ +import 'dart:async'; + +import 'package:bloc/bloc.dart'; +import 'package:hadi_hoda_flutter/features/intro/presentation/bloc/intro_event.dart'; +import 'package:hadi_hoda_flutter/features/intro/presentation/bloc/intro_state.dart'; + +class IntroBloc extends Bloc { + /// ------------constructor------------ + IntroBloc() : super(const IntroState()){ + on(_getIntroEvent); + } + + /// ------------UseCases------------ + + /// ------------Variables------------ + + /// ------------Controllers------------ + + /// ------------Functions------------ + + /// ------------Api Calls------------ + FutureOr _getIntroEvent(event, emit) async {} +} diff --git a/lib/features/intro/presentation/bloc/intro_event.dart b/lib/features/intro/presentation/bloc/intro_event.dart new file mode 100644 index 0000000..4bdd16b --- /dev/null +++ b/lib/features/intro/presentation/bloc/intro_event.dart @@ -0,0 +1,5 @@ +sealed class IntroEvent { + const IntroEvent(); +} + +class GetIntroEvent extends IntroEvent {} diff --git a/lib/features/intro/presentation/bloc/intro_state.dart b/lib/features/intro/presentation/bloc/intro_state.dart new file mode 100644 index 0000000..2c7fd3f --- /dev/null +++ b/lib/features/intro/presentation/bloc/intro_state.dart @@ -0,0 +1,15 @@ +import 'package:hadi_hoda_flutter/core/status/base_status.dart'; + +class IntroState { + final BaseStatus getIntroStatus; + + const IntroState({this.getIntroStatus = const BaseInit()}); + + IntroState copyWith({ + BaseStatus? getIntroStatus, + }) { + return IntroState( + getIntroStatus: getIntroStatus ?? this.getIntroStatus, + ); + } +} diff --git a/lib/features/intro/presentation/ui/intro_page.dart b/lib/features/intro/presentation/ui/intro_page.dart new file mode 100644 index 0000000..9de0ae2 --- /dev/null +++ b/lib/features/intro/presentation/ui/intro_page.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; + +class IntroPage extends StatelessWidget { + const IntroPage({super.key}); + + @override + Widget build(BuildContext context) { + return const Scaffold(); + } +}