initial commit
This commit is contained in:
@@ -0,0 +1,127 @@
|
||||
import 'package:cims_apps/application/component/button/button_view.dart';
|
||||
import 'package:cims_apps/application/theme/color_palette.dart';
|
||||
import 'package:cims_apps/core/utils/size_config.dart';
|
||||
import 'package:cims_apps/features/auth/registration/view/submission_data/submit_email.dart';
|
||||
import 'package:cims_apps/features/auth/registration/view/submission_data/submit_personal_data.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SubmissionParent extends StatefulWidget {
|
||||
static const routeName = '/SubmissionParent';
|
||||
const SubmissionParent({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<SubmissionParent> createState() => _SubmissionParentState();
|
||||
}
|
||||
|
||||
class _SubmissionParentState extends State<SubmissionParent> {
|
||||
int _currentStep = 1;
|
||||
final int _stepAmount = 9;
|
||||
Widget _stepItem({bool isCurrentStep = false, bool isDone = false}) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
if (_currentStep > 1) {
|
||||
_currentStep--;
|
||||
} else if (_currentStep == 1) {
|
||||
_currentStep++;
|
||||
}
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(right: 4.0, left: 4.0),
|
||||
height: 6,
|
||||
width: SizeConfig.width * .08,
|
||||
decoration: BoxDecoration(
|
||||
color: isCurrentStep || isDone
|
||||
? ColorPalette.primary
|
||||
: ColorPalette.greyBorderNeutrals,
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_content(int index) {
|
||||
switch (index) {
|
||||
case 1:
|
||||
return const SubmitPersonalData();
|
||||
case 2:
|
||||
return const SubmitEmail();
|
||||
case 3:
|
||||
return Container(
|
||||
child: Text("Step 3"),
|
||||
);
|
||||
case 4:
|
||||
return Container(
|
||||
child: Text("Step 4"),
|
||||
);
|
||||
case 5:
|
||||
return Container(
|
||||
child: Text("Step 5"),
|
||||
);
|
||||
case 6:
|
||||
return Container(
|
||||
child: Text("Step 6"),
|
||||
);
|
||||
case 7:
|
||||
return Container(
|
||||
child: Text("Step 7"),
|
||||
);
|
||||
case 8:
|
||||
return Container(
|
||||
child: Text("Step 8"),
|
||||
);
|
||||
case 9:
|
||||
return Container(
|
||||
child: Text("Step 9"),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Registration'),
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16.0, vertical: 16.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: List.generate(
|
||||
_stepAmount,
|
||||
(index) => _stepItem(
|
||||
isCurrentStep: _currentStep == index + 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: _content(_currentStep),
|
||||
)
|
||||
],
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: ButtonView(
|
||||
name: 'Next',
|
||||
marginVertical: 16.0,
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_currentStep++;
|
||||
});
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import 'package:cims_apps/application/component/text_caption/text_caption.dart';
|
||||
import 'package:cims_apps/application/component/text_form/text_form_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SubmitEmail extends StatelessWidget {
|
||||
const SubmitEmail({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const TextCaption(title: 'Enter your e-mail'),
|
||||
TextFormView(
|
||||
name: 'E-mail Address',
|
||||
hintText: 'Input e-mail address',
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import 'package:cims_apps/application/component/text_caption/text_caption.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SubmitPersonalData extends StatelessWidget {
|
||||
const SubmitPersonalData({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextCaption(title: 'Your personal details'),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user