Browse Source

add: base intro feature

pull/27/head
AmirrezaChegini 4 days ago
parent
commit
7706580c0d
  1. 13
      lib/core/routers/my_routes.dart
  2. 23
      lib/features/intro/presentation/bloc/intro_bloc.dart
  3. 5
      lib/features/intro/presentation/bloc/intro_event.dart
  4. 15
      lib/features/intro/presentation/bloc/intro_state.dart
  5. 10
      lib/features/intro/presentation/ui/intro_page.dart

13
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,

23
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<IntroEvent, IntroState> {
/// ------------constructor------------
IntroBloc() : super(const IntroState()){
on<GetIntroEvent>(_getIntroEvent);
}
/// ------------UseCases------------
/// ------------Variables------------
/// ------------Controllers------------
/// ------------Functions------------
/// ------------Api Calls------------
FutureOr<void> _getIntroEvent(event, emit) async {}
}

5
lib/features/intro/presentation/bloc/intro_event.dart

@ -0,0 +1,5 @@
sealed class IntroEvent {
const IntroEvent();
}
class GetIntroEvent extends IntroEvent {}

15
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,
);
}
}

10
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();
}
}
Loading…
Cancel
Save