fix: content padding text field

This commit is contained in:
Prajna Prayoga 2024-02-07 15:54:53 +07:00
parent 9475767021
commit 59e6e82d13
8 changed files with 162 additions and 108 deletions

View File

@ -33,6 +33,7 @@ class TextFormView extends StatelessWidget {
final Color? disabledborderColor; final Color? disabledborderColor;
final bool? enableInteractiveSelection; final bool? enableInteractiveSelection;
final Color? fontColorDisabled; final Color? fontColorDisabled;
final EdgeInsets? contentPadding;
final FocusNode? focusNode; final FocusNode? focusNode;
// ignore: prefer_const_constructors_in_immutables // ignore: prefer_const_constructors_in_immutables
@ -69,6 +70,7 @@ class TextFormView extends StatelessWidget {
this.preffixIconConstraints, this.preffixIconConstraints,
this.disableColor = false, this.disableColor = false,
this.enableInteractiveSelection = true, this.enableInteractiveSelection = true,
this.contentPadding,
this.focusNode, this.focusNode,
this.isTextAlignCenter = false, this.isTextAlignCenter = false,
this.prefix}) this.prefix})
@ -193,7 +195,8 @@ class TextFormView extends StatelessWidget {
suffixIconConstraints: suffixIconConstraints, suffixIconConstraints: suffixIconConstraints,
prefixIconConstraints: preffixIconConstraints, prefixIconConstraints: preffixIconConstraints,
prefix: prefix, prefix: prefix,
contentPadding: EdgeInsets.zero), contentPadding: contentPadding ?? EdgeInsets.zero
),
) )
], ],
); );

View File

@ -61,7 +61,7 @@ class _LoginViewState extends State<LoginView> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
ButtonBack(), ButtonBack(),
const Text('Sign Up'), const Text('Sign In'),
SizedBox( SizedBox(
width: SizeConfig.width * 0.1, width: SizeConfig.width * 0.1,
) )
@ -72,6 +72,7 @@ class _LoginViewState extends State<LoginView> {
), ),
), ),
body: PageView( body: PageView(
physics: NeverScrollableScrollPhysics(),
controller: pageController, controller: pageController,
children: [ children: [
PhoneNumberView(nextStep: nextStep, controller: phoneNumberController), PhoneNumberView(nextStep: nextStep, controller: phoneNumberController),
@ -88,7 +89,7 @@ class _LoginViewState extends State<LoginView> {
currentPage++; currentPage++;
pageController.jumpToPage(1); pageController.jumpToPage(1);
}else{ }else{
routePush(context, page: BottomNavigationView(), routeType: RouteType.pushRemove); routePush(context, page: BottomNavigationView());
} }
} }
} }

View File

@ -23,7 +23,7 @@ class PasswordView extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
const TextTitle(title: 'Enter your phone number', fontSize: 24), const TextTitle(title: 'Enter your password', fontSize: 24),
SizedBox( SizedBox(
height: 24, height: 24,
), ),
@ -31,9 +31,7 @@ class PasswordView extends StatelessWidget {
name: 'Password', name: 'Password',
ctrl: controller, ctrl: controller,
obscureText: !provider.showPassword, obscureText: !provider.showPassword,
prefix: SizedBox( contentPadding: EdgeInsets.all(12),
width: 16,
),
suffixIcon: GestureDetector( suffixIcon: GestureDetector(
onTap: () { onTap: () {
provider.changeShowPassword(); provider.changeShowPassword();

View File

@ -4,7 +4,9 @@ import 'package:cims_apps/application/component/image/image_view.dart';
import 'package:cims_apps/application/component/text_form/text_form_view.dart'; import 'package:cims_apps/application/component/text_form/text_form_view.dart';
import 'package:cims_apps/application/component/text_title/text_title.dart'; import 'package:cims_apps/application/component/text_title/text_title.dart';
import 'package:cims_apps/application/theme/color_palette.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/core/utils/size_config.dart';
import 'package:cims_apps/features/auth/registration/view/registration_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -92,8 +94,11 @@ class PhoneNumberView extends StatelessWidget {
), ),
TextButton( TextButton(
onPressed: () { onPressed: () {
routePush(context, page: RegistrationView());
}, },
style: TextButton.styleFrom(
padding: EdgeInsets.all(0)
),
child: Text( child: Text(
'Sign Up', 'Sign Up',
style: TextStyle( style: TextStyle(

View File

@ -1,10 +1,13 @@
import 'package:carousel_slider/carousel_slider.dart'; import 'package:carousel_slider/carousel_slider.dart';
import 'package:cims_apps/application/assets/path_assets.dart'; 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/image/image_view.dart'; import 'package:cims_apps/application/component/image/image_view.dart';
import 'package:cims_apps/application/component/text_title/text_title.dart'; import 'package:cims_apps/application/component/text_title/text_title.dart';
import 'package:cims_apps/application/theme/color_palette.dart'; import 'package:cims_apps/application/theme/color_palette.dart';
import 'package:cims_apps/core/route/route.dart'; import 'package:cims_apps/core/route/route.dart';
import 'package:cims_apps/core/utils/size_config.dart'; import 'package:cims_apps/core/utils/size_config.dart';
import 'package:cims_apps/features/auth/registration/view/initial_registration_step.dart';
import 'package:cims_apps/features/auth/registration/view/registration_view.dart';
import 'package:cims_apps/features/dashboard/dashboard_account/view/invest_type/invest_type_view.dart'; import 'package:cims_apps/features/dashboard/dashboard_account/view/invest_type/invest_type_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -47,7 +50,7 @@ class _HomeViewState extends State<HomeView> {
InvestType('Sharia', PathAssets.iconPortofolioSharia) InvestType('Sharia', PathAssets.iconPortofolioSharia)
]; ];
StepVerification listStepVerification = StepVerification(1, [ StepVerification listStepVerification = StepVerification(0, [
'Registration', 'Verification', 'Complete' 'Registration', 'Verification', 'Complete'
]); ]);
@ -268,6 +271,7 @@ class _HomeViewState extends State<HomeView> {
const SizedBox( const SizedBox(
height: 24, height: 24,
), ),
if(listStepVerification.currentStep == 1)...[
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -368,6 +372,37 @@ class _HomeViewState extends State<HomeView> {
], ],
), ),
) )
]else if(listStepVerification.currentStep == 0)...[
Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: ColorPalette.blue50,
borderRadius: BorderRadius.circular(12)
),
child: Column(
children: [
Text(
"Let's start registering your data to start mutual fund investment at PT Gemilang Indonesia",
style: TextStyle(
color: ColorPalette.slate500
),
),
SizedBox(
height: 16,
),
ButtonView(
name: 'Registration',
width: SizeConfig.width,
marginVertical: 0,
heightWrapContent: true,
onPressed: () {
routePush(context, page: InitialRegistrationStep());
},
)
],
),
)
]
], ],
), ),
); );

View File

@ -122,11 +122,20 @@ class _PortofolioViewState extends State<PortofolioView> {
), ),
const Column( const Column(
children: [ children: [
Text('Total Mutual Fund'), Text('Total Mutual Fund',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 18,
color: ColorPalette.slate400
),
),
Text('10', Text('10',
style: TextStyle( style: TextStyle(
fontSize: 44, fontSize: 44,
fontWeight: FontWeight.w700)), fontWeight: FontWeight.w700
)
)
,
], ],
) )
]), ]),

View File

@ -99,8 +99,6 @@ class _ProductViewState extends State<ProductView> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
body: SizedBox( body: SizedBox(
width: SizeConfig.width,
height: SizeConfig.height,
child: Stack( child: Stack(
children: [ children: [
const ImageView(image: PathAssets.imgDashboardAccount), const ImageView(image: PathAssets.imgDashboardAccount),
@ -141,7 +139,8 @@ class _ProductViewState extends State<ProductView> {
], ],
), ),
), ),
bottomNavigationBar: Padding( bottomNavigationBar: Container(
height: SizeConfig.height * .1,
padding: const EdgeInsets.symmetric(horizontal: 24), padding: const EdgeInsets.symmetric(horizontal: 24),
child: ButtonView( child: ButtonView(
name: 'Buy', name: 'Buy',
@ -498,6 +497,9 @@ class _ProductViewState extends State<ProductView> {
) )
], ],
), ),
SizedBox(
height: 16,
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -523,7 +525,7 @@ class _ProductViewState extends State<ProductView> {
onPressed: () { onPressed: () {
}, },
prefixIcon: Icon(Icons.space_dashboard_sharp), prefixIcon: Icon(Icons.calendar_month_rounded),
backgroundColor: ColorPalette.blue50, backgroundColor: ColorPalette.blue50,
sizeBorderRadius: 8, sizeBorderRadius: 8,
isSecondaryColor: false, isSecondaryColor: false,
@ -590,6 +592,8 @@ class _ProductViewState extends State<ProductView> {
TextFormView( TextFormView(
name: '', name: '',
ctrl: machineController, ctrl: machineController,
keyboardType: TextInputType.number,
contentPadding: EdgeInsets.all(12),
onChanged: (value) { onChanged: (value) {
value = value.replaceAll('Rp ', '').replaceAll('.', ''); value = value.replaceAll('Rp ', '').replaceAll('.', '');
double parseValue = double.parse(value); double parseValue = double.parse(value);
@ -600,7 +604,6 @@ class _ProductViewState extends State<ProductView> {
} }
setEstimatedValue(); setEstimatedValue();
}, },
keyboardType: TextInputType.number,
), ),
const Padding( const Padding(
padding: EdgeInsets.only(top: 16, bottom: 8), padding: EdgeInsets.only(top: 16, bottom: 8),

View File

@ -17,7 +17,7 @@ class _SplashScreenState extends State<SplashScreen> {
@override @override
void initState() { void initState() {
Future.delayed(const Duration(seconds: 3)).then( Future.delayed(const Duration(seconds: 3)).then(
(value) => routePush(context, page: const DashboardPublicView()), (value) => routePush(context, page: const DashboardPublicView(), routeType: RouteType.pushRemove),
); );
super.initState(); super.initState();
} }