2 Commits

Author SHA1 Message Date
e441c56bab fix: product view 2024-03-06 16:43:02 +07:00
e513df325c fix: homepage view 2024-03-05 19:25:49 +07:00
4 changed files with 239 additions and 159 deletions

View File

@@ -190,6 +190,18 @@ class TextFormView extends StatelessWidget {
color: focusedBorderColor ?? ColorPalette.greyBorder,
),
),
errorBorder: OutlineInputBorder(
borderRadius: _borderRadius,
borderSide: BorderSide(
color: ColorPalette.red600
)
),
focusedErrorBorder: OutlineInputBorder(
borderRadius: _borderRadius,
borderSide: BorderSide(
color: ColorPalette.red600
)
),
border: OutlineInputBorder(borderRadius: _borderRadius),
suffixIcon: suffixIcon,
prefixIcon: prefixIcon,

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: 1, top: 1, bottom: 1),
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(1, ['Registration', '', 'Verification', '', 'Complete']);
List<Article> listArticle = [
Article(
@@ -69,12 +69,21 @@ 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(
backgroundColor: ColorPalette.slate50,
body: CustomScrollView(
slivers: [
SliverAppBar(
onStretchTrigger: () async {
},
expandedHeight: 325,
collapsedHeight: 325,
leading: const SizedBox(),
surfaceTintColor: ColorPalette.slate50,
backgroundColor: ColorPalette.slate50,
flexibleSpace: FlexibleSpaceBar(
background: Stack(
children: [
const ImageView(image: PathAssets.imgDashboardAccount),
Column(
@@ -118,11 +127,18 @@ class _HomeViewState extends State<HomeView> {
),
cardInvestType(),
const SizedBox(
height: 32,
height: 24,
),
Expanded(
child: ListView(
padding: const EdgeInsets.all(0),
],
)
],
),
),
floating: true,
snap: true,
),
SliverToBoxAdapter(
child: Column(
children: [
cardVerification(),
const SizedBox(
@@ -135,12 +151,9 @@ class _HomeViewState extends State<HomeView> {
articles(),
],
),
),
],
)
],
),
),
);
}
@@ -279,6 +292,7 @@ class _HomeViewState extends State<HomeView> {
child: Column(
children: [
stepVerification(),
if(listStepVerification.currentStep < 3)
const SizedBox(
height: 24,
),
@@ -291,6 +305,7 @@ class _HomeViewState extends State<HomeView> {
Icon(
Icons.verified,
size: 18,
color: ColorPalette.slate300,
),
SizedBox(
width: 12,
@@ -324,6 +339,7 @@ class _HomeViewState extends State<HomeView> {
Icon(
Icons.verified,
size: 18,
color: ColorPalette.slate300,
),
SizedBox(
width: 12,
@@ -388,11 +404,11 @@ class _HomeViewState extends State<HomeView> {
borderRadius: BorderRadius.circular(12)),
child: Column(
children: [
Text(
const Text(
"Let's start registering your data to start mutual fund investment at PT Gemilang Indonesia",
style: TextStyle(color: ColorPalette.slate500),
),
SizedBox(
const SizedBox(
height: 16,
),
ButtonView(
@@ -400,9 +416,9 @@ class _HomeViewState extends State<HomeView> {
width: SizeConfig.width,
marginVertical: 0,
heightWrapContent: true,
contentPadding: EdgeInsets.all(12),
contentPadding: const EdgeInsets.all(12),
onPressed: () {
routePush(context, page: InitialRegistrationStep());
routePush(context, page: const InitialRegistrationStep());
},
)
],
@@ -417,57 +433,61 @@ class _HomeViewState extends State<HomeView> {
Widget stepVerification() {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: listStepVerification.nameStep.asMap().entries.map((e) {
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (e.key != 0)
SizedBox(
width: 30,
height: 30,
child: Divider(
color: listStepVerification.currentStep >= e.key
? const Color(0xff2563EB)
: const Color(0xffCBD5E1),
),
),
Column(
children: List.generate(
listStepVerification.nameStep.length,
(index) {
print(index % 2);
if (index % 2 == 0) {
final currentStep = index ~/ 2;
return Column(
children: [
Container(
width: 30,
height: 30,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: listStepVerification.currentStep <= e.key
color: listStepVerification.currentStep <= currentStep
? Colors.white
: const Color(0xff2563EB),
border: Border.all(
color: listStepVerification.currentStep < e.key
color: listStepVerification.currentStep < currentStep
? const Color(0xffCBD5E1)
: const Color(0xff2563EB),
width: 2)),
child: listStepVerification.currentStep <= e.key
width: 2,
),
),
child: listStepVerification.currentStep <= currentStep
? const SizedBox()
: const Icon(
Icons.done_rounded,
color: Colors.white,
),
),
const SizedBox(
height: 8,
),
const SizedBox(height: 8),
Text(
e.value,
listStepVerification.nameStep[index],
style: TextStyle(
color: listStepVerification.currentStep == e.key
color: listStepVerification.currentStep == currentStep
? const Color(0xff2563EB)
: Colors.black),
)
],
: Colors.black,
),
),
],
);
}).toList(),
} else {
return SizedBox(
width: 30,
height: 30,
child: Divider(
color: listStepVerification.currentStep > index ~/ 2
? const Color(0xff2563EB)
: const Color(0xffCBD5E1),
),
);
}
},
),
);
}
@@ -591,7 +611,7 @@ class _HomeViewState extends State<HomeView> {
color: ColorPalette.green100),
child: Text(
article.type,
style: TextStyle(
style: const TextStyle(
fontWeight: FontWeight.w600,
color: ColorPalette.green500),
),

View File

@@ -13,6 +13,7 @@ import 'package:cims_apps/features/dashboard/dashboard_account/view/product/view
import 'package:cims_apps/features/dashboard/dashboard_account/view/product/view/step_subscribe/select_goal_investing.dart';
import 'package:cims_apps/features/dashboard/dashboard_account/view/product/view_model/product_view_model.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:group_button/group_button.dart';
import 'package:provider/provider.dart';
@@ -79,6 +80,8 @@ class _ProductViewState extends State<ProductView> {
});
}
double currentScroll = 0;
@override
void initState() {
machineController.text = NumberFormatter.numberCurrency(100000, 'Rp ', 'id_ID', decimalDigits: 0);
@@ -104,21 +107,45 @@ class _ProductViewState extends State<ProductView> {
return ChangeNotifierProvider(
create: (context) => ProductViewModel(),
child: Scaffold(
body: SizedBox(
child: Stack(
children: [
const ImageView(image: PathAssets.imgDashboardAccount),
Column(
children: [
const SizedBox(
height: 50,
body: NotificationListener<ScrollNotification>(
onNotification: (notification) {
setState(() {
currentScroll = notification.metrics.pixels;
});
return false;
},
child: CustomScrollView(
slivers: [
SliverAppBar(
toolbarHeight: 70,
expandedHeight: 170,
leadingWidth: 0,
floating: false,
automaticallyImplyLeading: false,
title: AnimatedCrossFade(
firstChild: Text(
widget.selectedProduct.name ?? '',
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w700,
fontSize: 18
),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 24),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
BackButtonView(),
),
secondChild: Padding(
padding: const EdgeInsets.only(left: 8),
child: BackButtonView(),
),
crossFadeState: currentScroll >= 85 ? CrossFadeState.showFirst : CrossFadeState.showSecond,
duration: Duration(milliseconds: 200)
),
centerTitle: false,
snap: false,
pinned: true,
backgroundColor: Color(0xFF1745C8).withOpacity(currentScroll >= 95 ? 1 : currentScroll / 95),
surfaceTintColor: ColorPalette.primary,
actions: [
Wrap(
spacing: 12,
children: [
@@ -126,25 +153,43 @@ class _ProductViewState extends State<ProductView> {
Icon(Icons.file_download_outlined, color: ColorPalette.blue200, size: 32),
Icon(Icons.star_outline_rounded, color: ColorPalette.blue200, size: 32)
],
)
),
SizedBox(width: 24,)
],
),
),
const SizedBox(
height: 24,
),
flexibleSpace: Opacity(
opacity: currentScroll > 0 ? ((95 - currentScroll) / 95) > 0.01 ? ((95 - currentScroll) / 95) : 0 : 1,
child: Stack(
children: [
ImageView(image: PathAssets.imgDashboardAccount, width: SizeConfig.width, height: 200),
Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
headContainer(),
const SizedBox(
height: 24,
),
Expanded(
child: contentContainer()
Container(
height: 12,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(12),
topRight: Radius.circular(12)
)
),
)
],
)
],
),
),
),
SliverToBoxAdapter(
child: contentContainer(),
)
],
),
),
bottomNavigationBar: !widget.seeMore ?
Container(
height: SizeConfig.height * .1,
@@ -220,8 +265,11 @@ class _ProductViewState extends State<ProductView> {
decoration: BoxDecoration(
color: Colors.white,
),
child: ListView(
child: Column(
children: [
const SizedBox(
height: 12,
),
ProductChartView(
tabType: listTab[selectedTab],
lastTime: selectedTime.completeName,