Commit f2067cff authored by Dio Maulana's avatar Dio Maulana

add responsive web

parent b0dd22fa
......@@ -4,8 +4,10 @@ import 'package:flutter/material.dart';
import 'package:tour_travel_agr/helper/components_widget/custom_appbar.dart';
import 'package:tour_travel_agr/helper/components_widget/widget_button.dart';
import 'package:tour_travel_agr/helper/components_widget/widget_text_field.dart';
import 'package:tour_travel_agr/helper/widget_responsive.dart';
import 'package:tour_travel_agr/resource/assets.dart';
import 'package:tour_travel_agr/resource/colors.dart';
import 'package:tour_travel_agr/resource/routes.dart';
import 'package:tour_travel_agr/resource/size.dart';
import 'package:tour_travel_agr/resource/style.dart';
......@@ -35,119 +37,130 @@ class _ForgotPasswordViewState extends State<ForgotPasswordView> {
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: ColorManager.backgroundColor,
body: Stack(
children: [
Positioned(
top: 0,
left: 0,
child: Image(
height: 100,
image: AssetImage(
Assets.elipse,
),
body: ScreenResponsive(
widget: bodyWidget(context),
widthScreen: MediaQuery.of(context).size.width,
),
);
}
Stack bodyWidget(BuildContext context) {
return Stack(
children: [
Positioned(
top: 0,
left: 0,
child: Image(
height: 100,
image: AssetImage(
Assets.elipse,
),
),
Container(
padding: EdgeInsets.only(
top: AppPadding.safeAreaTop(context),
left: AppPadding.p20,
right: AppPadding.p20,
bottom: AppPadding.safeAreaBot(context),
),
child: Column(
children: [
const CustomAppBar(
text: "ForgotPassword",
),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: Center(
child: Image(
width: 216,
height: 216,
image: AssetImage(
Assets.forgotPassword,
),
),
Container(
padding: EdgeInsets.only(
top: AppPadding.safeAreaTop(context),
left: AppPadding.p20,
right: AppPadding.p20,
bottom: AppPadding.safeAreaBot(context),
),
child: Column(
children: [
const CustomAppBar(
text: "ForgotPassword",
),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: Center(
child: Image(
width: 216,
height: 216,
image: AssetImage(
Assets.forgotPassword,
),
),
),
Container(
margin: EdgeInsets.only(
top: AppMargin.m25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Forgot",
style: getSemiBoldStyle(
color: Colors.black,
fontSize: 32,
),
),
Text(
"Password",
style: getSemiBoldStyle(
color: Colors.black,
fontSize: 32,
),
)
],
),
),
Container(
margin: EdgeInsets.only(
top: AppMargin.m25,
),
Container(
margin: EdgeInsets.only(
top: AppMargin.m12,
),
child: Text(
"Dont worry! It happens. Please enter your number phone",
style: getMediumStyle(
color: ColorManager.grey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Forgot",
style: getSemiBoldStyle(
color: Colors.black,
fontSize: 32,
),
),
),
),
SizedBox(
height: AppMargin.m20,
Text(
"Password",
style: getSemiBoldStyle(
color: Colors.black,
fontSize: 32,
),
)
],
),
InputTextField(
controller: whatsappController,
labelText: "No Whatsapp",
inputType: TextInputType.number,
onChanged: (val) {
if (val.length > 7) {
setState(() {
buttonActive = true;
});
} else {
setState(() {
buttonActive = false;
});
}
},
),
Container(
margin: EdgeInsets.only(
top: AppMargin.m12,
),
SizedBox(
height: AppMargin.m20,
child: Text(
"Dont worry! It happens. Please enter your number phone",
style: getMediumStyle(
color: ColorManager.grey,
),
),
CustomButton(
text: "Submit",
colorButton: (!buttonActive) ? Colors.grey : null,
onTap: () {
// TODO: dosomething here
},
)
],
),
),
SizedBox(
height: AppMargin.m20,
),
InputTextField(
controller: whatsappController,
labelText: "No Whatsapp",
inputType: TextInputType.number,
onChanged: (val) {
if (val.length > 7) {
setState(() {
buttonActive = true;
});
} else {
setState(() {
buttonActive = false;
});
}
},
),
SizedBox(
height: AppMargin.m20,
),
CustomButton(
text: "Submit",
colorButton: (!buttonActive) ? Colors.grey : null,
onTap: () {
// TODO: dosomething here
if (buttonActive) {
Navigator.pushNamed(
context, Routes.resetPasswordRoute);
}
},
)
],
),
)
],
),
),
)
],
),
],
),
),
],
);
}
}
......@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:tour_travel_agr/helper/components_widget/custom_appbar.dart';
import 'package:tour_travel_agr/helper/components_widget/password_input.dart';
import 'package:tour_travel_agr/helper/components_widget/widget_button.dart';
import 'package:tour_travel_agr/helper/components_widget/widget_text_field.dart';
import 'package:tour_travel_agr/helper/widget_responsive.dart';
import 'package:tour_travel_agr/resource/assets.dart';
import 'package:tour_travel_agr/resource/colors.dart';
import 'package:tour_travel_agr/resource/size.dart';
......@@ -24,113 +24,120 @@ class _ResetPasswordViewState extends State<ResetPasswordView> {
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: ColorManager.backgroundColor,
body: Container(
padding: EdgeInsets.only(
top: AppPadding.safeAreaTop(context),
left: AppPadding.p20,
right: AppPadding.p20,
bottom: AppPadding.safeAreaBot(context),
),
child: Column(
children: [
const CustomAppBar(
text: "Reset Password",
),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(
top: AppMargin.m10,
),
child: Center(
child: Image(
width: 216,
height: 216,
image: AssetImage(
Assets.resetPassword,
),
),
),
body: ScreenResponsive(
widget: bodyWidget(context),
widthScreen: MediaQuery.of(context).size.width,
),
);
}
Container bodyWidget(BuildContext context) {
return Container(
padding: EdgeInsets.only(
top: AppPadding.safeAreaTop(context),
left: AppPadding.p20,
right: AppPadding.p20,
bottom: AppPadding.safeAreaBot(context),
),
child: Column(
children: [
const CustomAppBar(
text: "Reset Password",
),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(
top: AppMargin.m10,
),
Container(
margin: EdgeInsets.only(
top: AppMargin.m25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Reset",
style: getSemiBoldStyle(
color: Colors.black,
fontSize: 32,
),
),
Text(
"Password",
style: getSemiBoldStyle(
color: Colors.black,
fontSize: 32,
),
)
],
child: Center(
child: Image(
width: 216,
height: 216,
image: AssetImage(
Assets.resetPassword,
),
),
),
PasswordInput(
passwordController: passwordController,
labelText: "New Password",
marginTop: AppMargin.m20,
onChanged: (val) {
if (passwordController.text.isNotEmpty &&
newPasswordController.text.isNotEmpty) {
setState(() {
buttonActive = true;
});
} else {
setState(() {
buttonActive = false;
});
}
},
),
PasswordInput(
passwordController: newPasswordController,
labelText: "Confirm New Password",
marginTop: AppMargin.m20,
onChanged: (val) {
if (passwordController.text.isNotEmpty &&
newPasswordController.text.isNotEmpty) {
setState(() {
buttonActive = true;
});
} else {
setState(() {
buttonActive = false;
});
}
},
),
Container(
margin: EdgeInsets.only(
top: AppMargin.m25,
),
SizedBox(
height: AppMargin.m20,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Reset",
style: getSemiBoldStyle(
color: Colors.black,
fontSize: 32,
),
),
Text(
"Password",
style: getSemiBoldStyle(
color: Colors.black,
fontSize: 32,
),
)
],
),
CustomButton(
text: "Submit",
colorButton: (!buttonActive) ? Colors.grey : null,
onTap: () {
if (buttonActive) {
// TODO: do something here
}
},
)
],
),
),
PasswordInput(
passwordController: passwordController,
labelText: "New Password",
marginTop: AppMargin.m20,
onChanged: (val) {
if (passwordController.text.isNotEmpty &&
newPasswordController.text.isNotEmpty) {
setState(() {
buttonActive = true;
});
} else {
setState(() {
buttonActive = false;
});
}
},
),
PasswordInput(
passwordController: newPasswordController,
labelText: "Confirm New Password",
marginTop: AppMargin.m20,
onChanged: (val) {
if (passwordController.text.isNotEmpty &&
newPasswordController.text.isNotEmpty) {
setState(() {
buttonActive = true;
});
} else {
setState(() {
buttonActive = false;
});
}
},
),
SizedBox(
height: AppMargin.m20,
),
CustomButton(
text: "Submit",
colorButton: (!buttonActive) ? Colors.grey : null,
onTap: () {
if (buttonActive) {
// TODO: do something here
}
},
)
],
),
)
],
),
),
)
],
),
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment