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, width: SizeConfig.width * .23,
padding: padding:
const EdgeInsets.symmetric(horizontal: 16.0), 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( decoration: const BoxDecoration(
color: ColorPalette.grey, color: ColorPalette.grey,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(

View File

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