cims_apps/lib/features/auth/registration/view/initial_registration_step.dart
2024-02-20 18:49:14 +07:00

226 lines
6.8 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:cims_apps/application/assets/path_assets.dart';
import 'package:cims_apps/application/component/button/button_view.dart';
import 'package:cims_apps/application/component/custom_app_bar/custom_app_bar.dart';
import 'package:cims_apps/application/component/image/image_view.dart';
import 'package:cims_apps/application/theme/color_palette.dart';
import 'package:cims_apps/core/route/route.dart';
import 'package:cims_apps/core/utils/size_config.dart';
import 'package:cims_apps/features/auth/registration/view/submission_data/submission_parent.dart';
import 'package:cims_apps/features/bottom_navigation_view.dart';
import 'package:flutter/material.dart';
class InitialRegistrationStep extends StatelessWidget {
static const routeName = '/InitialRegistrationStep';
const InitialRegistrationStep({Key? key}) : super(key: key);
Widget _stepItem({
required String description,
bool isActive = false,
bool isDone = false,
bool isLast = false,
}) {
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
height: 30,
width: 30,
decoration: BoxDecoration(
color: isDone ? ColorPalette.primary : Colors.white,
border: Border.all(
width: 2.0,
color: isActive || isDone
? ColorPalette.primary
: Colors.grey),
shape: BoxShape.circle,
),
child: isDone
? const Align(
alignment: Alignment.center,
child: Icon(
Icons.done_outlined,
color: Colors.white,
),
)
: const SizedBox(),
),
if (!isLast)
ConstrainedBox(
constraints: BoxConstraints.expand(
width: 0.0, height: SizeConfig.width * .07),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 4.0),
child: VerticalDivider(
color: isDone ? ColorPalette.primary : Colors.grey,
thickness: 2.0,
),
),
),
],
),
const SizedBox(
width: 8.0,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(
height: 8.0,
),
Text(
description,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color:
isActive ? ColorPalette.primary : ColorPalette.slate800,
),
),
],
),
),
],
);
}
@override
Widget build(BuildContext context) {
List listStep = [
{
'desc': 'Personal Data',
'isActive': true,
'isDone': false,
'isLast': false,
},
{
'desc': 'Email',
'isActive': false,
'isDone': false,
'isLast': false,
},
{
'desc': 'Identity Card Photo ',
'isActive': false,
'isDone': false,
'isLast': false,
},
{
'desc': 'Identity Card Photo ',
'isActive': false,
'isDone': false,
'isLast': false,
},
{
'desc': 'ID Card Data Accuracy',
'isActive': false,
'isDone': false,
'isLast': false,
},
{
'desc': 'Bank Data',
'isActive': false,
'isDone': false,
'isLast': false,
},
{
'desc': 'Digital Signature',
'isActive': false,
'isDone': false,
'isLast': false,
},
{
'desc': 'Know your Risk Profile',
'isActive': false,
'isDone': false,
'isLast': false,
},
{
'desc': 'Completed Registration',
'isActive': false,
'isDone': false,
'isLast': true,
},
];
return Scaffold(
appBar:
CustomAppBar(height: SizeConfig.height * .1, title: 'Registration'),
body: Container(
padding: const EdgeInsets.symmetric(horizontal: 24.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ImageView(
image: PathAssets.imgRegis,
width: SizeConfig.width * .4,
),
SizedBox(
width: SizeConfig.width * .45,
child: const Text(
"It's time for your registration",
maxLines: 2,
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 18,
color: ColorPalette.slate800),
),
)
],
),
SizedBox(
height: SizeConfig.height * .55,
child: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Column(
children: listStep
.asMap()
.entries
.map((e) => _stepItem(
description: '${e.value['desc']}',
isActive: e.value['isActive'],
isDone: e.value['isDone'],
isLast: e.value['isLast'],
))
.toList(),
),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ButtonView(
name: 'Home Page',
marginVertical: 8.0,
width: SizeConfig.width * .42,
isOutlined: true,
onPressed: () {
routePush(context,
page: const BottomNavigationView(),
routeType: RouteType.pushReplace);
},
),
ButtonView(
name: 'Lets Start',
marginVertical: 8.0,
width: SizeConfig.width * .42,
onPressed: () {
routePush(context, page: const SubmissionParent());
},
),
],
)
],
),
),
);
}
}