api integration
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:gap/gap.dart';
|
||||
import 'package:tanami_app/core/routes/route_name.dart';
|
||||
import 'package:tanami_app/core/routes/routes.dart';
|
||||
import 'package:tanami_app/core/styles/app_color.dart';
|
||||
import 'package:tanami_app/core/utils/secure/secure_storage_service.dart';
|
||||
import 'package:tanami_app/shared/components/text_widget.dart';
|
||||
|
||||
import '../bloc/pin_bloc.dart';
|
||||
@@ -13,13 +14,14 @@ class ConfirmPinKey extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final SecureStorageService secureStorageService = SecureStorageService();
|
||||
return Column(
|
||||
children: [
|
||||
const Gap(20),
|
||||
BlocConsumer<PinBloc, PinState>(
|
||||
listener: (context, state) {
|
||||
listener: (context, state) async {
|
||||
if (state.pinComplete && state.isVerified) {
|
||||
// successToastMessage(context, "Pin verified successfully");
|
||||
await secureStorageService.write('isLoginedIn', "true");
|
||||
goRouter.goNamed(RouteName.mainScreen);
|
||||
}
|
||||
},
|
||||
@@ -91,7 +93,9 @@ class ConfirmPinKey extends StatelessWidget {
|
||||
final number = index == 10 ? '0' : '${index + 1}';
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
context.read<PinBloc>().add(NumberPressed(number,"confirmpin"));
|
||||
context
|
||||
.read<PinBloc>()
|
||||
.add(NumberPressed(number, "confirmpin"));
|
||||
},
|
||||
child: Container(
|
||||
margin: const EdgeInsets.all(12),
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:tanami_app/core/routes/route_name.dart';
|
||||
import 'package:tanami_app/core/routes/routes.dart';
|
||||
import 'package:tanami_app/core/styles/app_color.dart';
|
||||
import 'package:tanami_app/core/styles/app_text.dart';
|
||||
import 'package:tanami_app/features/countrySelection/bloc/choose_country_bloc.dart';
|
||||
import 'package:tanami_app/features/securePin/presentation/widgets/forgot_pin_dialog.dart';
|
||||
import 'package:tanami_app/shared/components/text_widget.dart';
|
||||
import 'package:tanami_app/shared/components/toast_message.dart';
|
||||
|
||||
import '../../../../core/routes/route_name.dart';
|
||||
import '../../../../core/routes/routes.dart';
|
||||
import '../../../../core/utils/language/localizations_delegate.dart';
|
||||
import '../../../../shared/components/toast_message.dart';
|
||||
import '../../../login/presentation/bloc/login_bloc.dart';
|
||||
import '../bloc/pin_bloc.dart';
|
||||
|
||||
class PinKey extends StatelessWidget {
|
||||
@@ -23,8 +23,9 @@ class PinKey extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
print(fromScreen);
|
||||
var localizations = AppLocalizations.of(context);
|
||||
final loginBloc = context.read<LoginBloc>();
|
||||
final radioBloc = context.read<RadioBloc>();
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
@@ -35,14 +36,12 @@ class PinKey extends StatelessWidget {
|
||||
state.error.isEmpty &&
|
||||
!state.verifiedOnce) {
|
||||
if (fromScreen == "login" || fromScreen == "LoginedInUser") {
|
||||
print("login true");
|
||||
loginBloc.resetFields();
|
||||
radioBloc.resetSelection();
|
||||
successToastMessage(context,
|
||||
localizations.translate(AppText.pinVerifiedSucess));
|
||||
goRouter.pushNamed(RouteName.mainScreen);
|
||||
} else if (fromScreen == "reset-pin") {
|
||||
print("reset true");
|
||||
|
||||
log("Running this");
|
||||
successToastMessage(
|
||||
context, localizations.translate(AppText.pinUpdatedSucess));
|
||||
goRouter.pop();
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:tanami_app/core/styles/app_color.dart';
|
||||
import 'package:tanami_app/core/styles/app_text.dart';
|
||||
import 'package:tanami_app/shared/components/text_widget.dart';
|
||||
|
||||
import '../../../../Globalconst.dart';
|
||||
import '../../../../core/styles/app_images.dart';
|
||||
import '../../../../core/utils/language/localizations_delegate.dart';
|
||||
|
||||
@@ -38,8 +39,9 @@ class PinTopSection extends StatelessWidget {
|
||||
TextWidget().text14W500(
|
||||
localizations.translate(AppText.welcomeBackText),
|
||||
clr: AppColor.smokeGrayColor),
|
||||
TextWidget()
|
||||
.text14W700(", Pooja", clr: AppColor.plainBlack),
|
||||
TextWidget().text14W700(
|
||||
", ${Globalconst.firstName.trim()}",
|
||||
clr: AppColor.plainBlack),
|
||||
],
|
||||
),
|
||||
TextWidget().text14W500(
|
||||
|
||||
Reference in New Issue
Block a user