52 lines
1.7 KiB
Dart
52 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:tanami_app/core/utils/secure/secure_storage_service.dart';
|
|
import 'package:tanami_app/features/otpVerification/presentation/bloc/otp_bloc.dart';
|
|
import 'package:tanami_app/features/otpVerification/presentation/pages/otp_layout.dart';
|
|
|
|
import '../../../../core/styles/app_color.dart';
|
|
import '../../../register/presentation/bloc/register_bloc.dart';
|
|
import '../bloc/otp_event.dart';
|
|
import '../bloc/timer/timer_bloc.dart';
|
|
import '../bloc/timer/timer_event.dart';
|
|
|
|
class OtpScreen extends StatelessWidget {
|
|
final String fromScreen;
|
|
|
|
const OtpScreen({
|
|
super.key,
|
|
required this.fromScreen,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final SharedPreferenceLocalData secureStorageService =
|
|
SharedPreferenceLocalData();
|
|
return Scaffold(
|
|
backgroundColor: AppColor.plainWhite,
|
|
resizeToAvoidBottomInset: true,
|
|
body: MultiBlocProvider(
|
|
providers: [
|
|
BlocProvider(
|
|
// Create an instance of the OnboardingBloc
|
|
create: (context) =>
|
|
OtpBloc(secureStorageService: secureStorageService)
|
|
..add(StartListeningForOtp()),
|
|
),
|
|
BlocProvider(
|
|
create: (context) =>
|
|
TimerBloc()..add(StartTimer()), // Start the timer here
|
|
),
|
|
//RegisterBloc
|
|
BlocProvider(
|
|
create: (context) => RegisterBloc(
|
|
secureStorageService:
|
|
secureStorageService), // Start the timer here
|
|
),
|
|
],
|
|
child: OtpLayout(fromScreen: fromScreen),
|
|
),
|
|
);
|
|
}
|
|
}
|