Skip to content

Commit

Permalink
revert design, use general scaffold component
Browse files Browse the repository at this point in the history
  • Loading branch information
12henbx committed Oct 18, 2023
1 parent ae9cad5 commit 131505a
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 30 deletions.
4 changes: 3 additions & 1 deletion app/lib/core/bases/widgets/layout/bebras_scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import 'package:flutter/material.dart';

class BebrasScaffold extends StatelessWidget {
final Widget body;
const BebrasScaffold({required this.body, super.key});
final bool avoidBottomInset;
const BebrasScaffold({required this.body, super.key, this.avoidBottomInset = true});

@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: avoidBottomInset,
body: SafeArea(
child: body,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:intl/intl.dart';

import '../../../../../core/bases/enum/button_type.dart';
import '../../../../../core/bases/widgets/atoms/button.dart';
import '../../../../../core/bases/widgets/layout/bebras_scaffold.dart';
import '../../../../../core/constants/assets.dart';
import '../../../../../core/constants/bebrasBiroDropdown.dart';
import '../../../../../core/constants/colorConstant.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class _RegisterPageState extends State<RegisterPage> {
},
child: BlocBuilder<UserRegisterBloc, RegisterFormState>(
builder: (context, state) {
return Scaffold(
resizeToAvoidBottomInset: false,
return BebrasScaffold(
avoidBottomInset: false,
body: Padding(
padding: const EdgeInsets.only(
left: 16.0, top: 50.0, right: 16.0),
left: 16.0, top: 30.0, right: 16.0),
child: Form(
key: state.formKey,
child: Column(
Expand All @@ -45,7 +45,7 @@ class _RegisterPageState extends State<RegisterPage> {
height: 40,
),
SizedBox(
height: 20,
height: 40,
),
Text(
'Detail Akun',
Expand Down Expand Up @@ -112,7 +112,7 @@ class _RegisterPageState extends State<RegisterPage> {
// context.go('/main');
}
},
child: Text('Submit'),
child: Text('Daftar'),
);
}),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class _CustomDatePickerState extends State<CustomDatePicker> {
DateTime? pickedDate = await showDatePicker(
context: context,
initialDate: DateTime.now(),
firstDate: DateTime(2000),
firstDate: DateTime(1900),
lastDate: DateTime(2101));

if (pickedDate != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,58 +21,45 @@ class _LoginPageState extends State<LoginPage> {
Widget build(BuildContext context) {
final size = MediaQuery.of(context).size;
return Scaffold(
backgroundColor: ColorConstants.primaryBlueColor,
body: SafeArea(
child: Stack(
children: [
// Image.asset(
// Assets.studyBackground,
// fit: BoxFit.cover,
// height: size.height * 0.45,
// ),
Image.asset(
Assets.studyBackground,
fit: BoxFit.cover,
height: size.height * 0.45,
),
Align(
alignment: Alignment.bottomCenter,
child: Container(
padding: const EdgeInsets.all(32),
height: size.height,
height: size.height * 0.6,
width: size.width,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(32),
color: Colors.transparent,
color: Colors.white,
),
child: Column(
children: [
Image.asset(
Assets.bebrasPandaiText,
),
const SizedBox(
height: 55,
),
Image.asset(
Assets.bebrasMascot,
fit: BoxFit.cover,
height: size.height * 0.4,
),
const SizedBox(
height: 30,
height: 100,
),
const Text(
'Selamat Datang di Aplikasi Bebras Pandai!',
textAlign: TextAlign.center,
style: TextStyle(
color: ColorConstants.whiteColor,
fontWeight: FontWeight.bold,
fontSize: 24,
),
),
const SizedBox(
height: 10,
height: 24,
),
const Text(
'Yuk cari tahu seberapa tajam logikamu!',
style: TextStyle(
color: ColorConstants.whiteColor,
),
),
const SizedBox(
height: 24,
Expand Down Expand Up @@ -123,5 +110,108 @@ class _LoginPageState extends State<LoginPage> {
),
),
);
// Scaffold(
// backgroundColor: ColorConstants.primaryBlueColor,
// body: SafeArea(
// child: Stack(
// children: [
// // Image.asset(
// // Assets.studyBackground,
// // fit: BoxFit.cover,
// // height: size.height * 0.45,
// // ),
// Align(
// alignment: Alignment.bottomCenter,
// child: Container(
// padding: const EdgeInsets.all(32),
// height: size.height,
// width: size.width,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(32),
// color: Colors.transparent,
// ),
// child: Column(
// children: [
// Image.asset(
// Assets.bebrasPandaiText,
// ),
// const SizedBox(
// height: 55,
// ),
// Image.asset(
// Assets.bebrasMascot,
// fit: BoxFit.cover,
// height: size.height * 0.4,
// ),
// const SizedBox(
// height: 30,
// ),
// const Text(
// 'Selamat Datang di Aplikasi Bebras Pandai!',
// textAlign: TextAlign.center,
// style: TextStyle(
// color: ColorConstants.whiteColor,
// fontWeight: FontWeight.bold,
// fontSize: 24,
// ),
// ),
// const SizedBox(
// height: 10,
// ),
// const Text(
// 'Yuk cari tahu seberapa tajam logikamu!',
// style: TextStyle(
// color: ColorConstants.whiteColor,
// ),
// ),
// const SizedBox(
// height: 24,
// ),
// BlocConsumer<SignInBloc, SignInState>(
// bloc: _signInBloc,
// listener: (context, state) {
// if (state is UserUnregistered) {
// context.go('/register');
// } else if (state is UserRegistered) {
// context.go('/main');
// }
// },
// builder: (context, state) {
// return SizedBox(
// height: 50,
// width: 200,
// child: ElevatedButton(
// child: Text(
// 'Login with Google',
// style: TextStyle(fontSize: 16, fontWeight: FontWeight.w900,),),
// style: ButtonStyle(
// shape: MaterialStateProperty.all<RoundedRectangleBorder>(
// RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(18.0),
// )
// ),
// backgroundColor: MaterialStateProperty.all(
// ColorConstants.darkPrimaryBlueColor,
// ),
// ),
// onPressed: () {
// if (state is! SignInLoadingState) {
// _signInBloc.add(
// TriggerSignInEvent(),
// );
// }
// },
// ),
// );
// },
// ),
// ],
// ),
// ),
// ),
// ],
// ),
// ),
// );
}
}
2 changes: 1 addition & 1 deletion app/lib/features/main/presentation/pages/main_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class _MainPageState extends State<MainPage> {
Assets.bebrasPandaiText,
),
const SizedBox(
height: 100,
height: 40,
),
RichText(
text: TextSpan(
Expand Down

0 comments on commit 131505a

Please sign in to comment.