fix: homepage view

This commit is contained in:
Prajna Prayoga 2024-03-05 19:25:49 +07:00
parent 23e1a6628f
commit e513df325c
2 changed files with 118 additions and 108 deletions

View File

@ -52,7 +52,7 @@ class PhoneNumberView extends StatelessWidget {
width: SizeConfig.width * .23,
padding:
const EdgeInsets.symmetric(horizontal: 16.0),
margin: const EdgeInsets.only(right: 16),
margin: const EdgeInsets.only(right: 16, left: 2, top: 2, bottom: 2),
decoration: const BoxDecoration(
color: ColorPalette.grey,
borderRadius: BorderRadius.only(

View File

@ -50,7 +50,7 @@ class _HomeViewState extends State<HomeView> {
];
StepVerification listStepVerification =
StepVerification(0, ['Registration', 'Verification', 'Complete']);
StepVerification(0, ['Registration', '', 'Verification', '', 'Complete']);
List<Article> listArticle = [
Article(
@ -69,77 +69,89 @@ class _HomeViewState extends State<HomeView> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xffF8FAFC),
body: SizedBox(
width: SizeConfig.width,
height: SizeConfig.height,
child: Stack(
children: [
const ImageView(image: PathAssets.imgDashboardAccount),
Column(
children: [
const SizedBox(
height: 50,
),
Padding(
padding: const EdgeInsets.only(left: 24, right: 16),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
backgroundColor: ColorPalette.slate50,
body: CustomScrollView(
slivers: [
SliverAppBar(
onStretchTrigger: () async {
},
expandedHeight: 325,
leading: SizedBox(),
surfaceTintColor: ColorPalette.slate50,
backgroundColor: ColorPalette.slate50,
flexibleSpace: FlexibleSpaceBar(
background: Stack(
children: [
const ImageView(image: PathAssets.imgDashboardAccount),
Column(
children: [
const Text(
'Home',
style: TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.w700),
const SizedBox(
height: 50,
),
Padding(
padding: const EdgeInsets.only(left: 24, right: 16),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text(
'Home',
style: TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.w700),
),
ElevatedButton(
onPressed: () {},
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.all(0),
backgroundColor: Colors.white,
foregroundColor: const Color(0xff2563EB),
elevation: 0,
shape: const CircleBorder()),
child: const Icon(Icons.notifications_outlined))
],
),
),
const SizedBox(
height: 32,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: portofolioValue(),
),
const SizedBox(
height: 24,
),
cardInvestType(),
const SizedBox(
height: 24,
),
ElevatedButton(
onPressed: () {},
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.all(0),
backgroundColor: Colors.white,
foregroundColor: const Color(0xff2563EB),
elevation: 0,
shape: const CircleBorder()),
child: const Icon(Icons.notifications_outlined))
],
),
),
const SizedBox(
height: 32,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24),
child: portofolioValue(),
),
)
],
),
),
floating: true,
snap: true,
),
SliverToBoxAdapter(
child: Column(
children: [
cardVerification(),
const SizedBox(
height: 24,
),
cardInvestType(),
infoAndPromo(),
const SizedBox(
height: 32,
),
Expanded(
child: ListView(
padding: const EdgeInsets.all(0),
children: [
cardVerification(),
const SizedBox(
height: 24,
),
infoAndPromo(),
const SizedBox(
height: 24,
),
articles(),
],
),
height: 24,
),
articles(),
],
)
],
),
),
)
],
),
);
}
@ -417,56 +429,54 @@ class _HomeViewState extends State<HomeView> {
Widget stepVerification() {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: listStepVerification.nameStep.asMap().entries.map((e) {
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (e.key != 0)
SizedBox(
if(e.key == 1 || e.key == 3){
return SizedBox(
width: 30,
height: 30,
child: Divider(
color: listStepVerification.currentStep >= e.key
? const Color(0xff2563EB)
: const Color(0xffCBD5E1),
),
);
}else{
return Column(
children: [
Container(
width: 30,
height: 30,
child: Divider(
color: listStepVerification.currentStep >= e.key
? const Color(0xff2563EB)
: const Color(0xffCBD5E1),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: listStepVerification.currentStep <= e.key
? Colors.white
: const Color(0xff2563EB),
border: Border.all(
color: listStepVerification.currentStep < e.key
? const Color(0xffCBD5E1)
: const Color(0xff2563EB),
width: 2)),
child: listStepVerification.currentStep <= e.key
? const SizedBox()
: const Icon(
Icons.done_rounded,
color: Colors.white,
),
),
Column(
children: [
Container(
width: 30,
height: 30,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: listStepVerification.currentStep <= e.key
? Colors.white
: const Color(0xff2563EB),
border: Border.all(
color: listStepVerification.currentStep < e.key
? const Color(0xffCBD5E1)
: const Color(0xff2563EB),
width: 2)),
child: listStepVerification.currentStep <= e.key
? const SizedBox()
: const Icon(
Icons.done_rounded,
color: Colors.white,
),
),
const SizedBox(
height: 8,
),
Text(
e.value,
style: TextStyle(
color: listStepVerification.currentStep == e.key
? const Color(0xff2563EB)
: Colors.black),
)
],
),
],
);
const SizedBox(
height: 8,
),
Text(
e.value,
style: TextStyle(
color: listStepVerification.currentStep == e.key
? const Color(0xff2563EB)
: Colors.black),
)
],
);
}
}).toList(),
);
}