-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #156 from ia-toki/redesign-v2
Conditional render onboarding & login page for v1/v2
- Loading branch information
Showing
18 changed files
with
407 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
app/lib/features/authentication/signin/presentation/pages/v2/_pages.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
import 'package:go_router/go_router.dart'; | ||
|
||
import '../../../../../../core/bases/enum/button_type.dart'; | ||
import '../../../../../../core/bases/widgets/atoms/button.dart'; | ||
import '../../../../../../core/constants/assets.dart'; | ||
import '../../../../../../core/theme/base_colors.dart'; | ||
import '../../../../../../services/di.dart'; | ||
import '../../bloc/sign_in_bloc.dart'; | ||
|
||
part 'sign_in_page.dart'; |
106 changes: 106 additions & 0 deletions
106
app/lib/features/authentication/signin/presentation/pages/v2/sign_in_page.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
part of '_pages.dart'; | ||
|
||
class LoginPageV2 extends StatefulWidget { | ||
const LoginPageV2({super.key}); | ||
|
||
@override | ||
State<LoginPageV2> createState() => _LoginPageV2State(); | ||
} | ||
|
||
class _LoginPageV2State extends State<LoginPageV2> { | ||
late final SignInBloc _signInBloc; | ||
|
||
@override | ||
void initState() { | ||
_signInBloc = get<SignInBloc>(); | ||
|
||
super.initState(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final size = MediaQuery.of(context).size; | ||
return Scaffold( | ||
body: SafeArea( | ||
child: Stack( | ||
children: [ | ||
Image.asset( | ||
Assets.iconLogin, | ||
fit: BoxFit.cover, | ||
height: size.height * 0.30, | ||
width: double.infinity, | ||
), | ||
Align( | ||
alignment: Alignment.bottomCenter, | ||
child: Container( | ||
padding: const EdgeInsets.all(32), | ||
height: size.height * 0.55, | ||
width: size.width, | ||
// decoration: BoxDecoration( | ||
// borderRadius: BorderRadius.circular(32), | ||
// color: Colors.white, | ||
// ), | ||
child: Column( | ||
children: [ | ||
// Image.asset( | ||
// Assets.bebrasPandaiText, | ||
// ), | ||
// const SizedBox( | ||
// height: 100, | ||
// ), | ||
const Text( | ||
'Selamat Datang di Aplikasi Bebras Pandai!', | ||
textAlign: TextAlign.center, | ||
style: TextStyle( | ||
fontWeight: FontWeight.bold, | ||
fontSize: 24, | ||
), | ||
), | ||
const SizedBox( | ||
height: 24, | ||
), | ||
const Text( | ||
'Yuk cari tahu seberapa tajam logikamu!', | ||
), | ||
const SizedBox( | ||
height: 50, | ||
), | ||
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: Button( | ||
text: 'Login with Google', | ||
buttonType: ButtonType.secondary, | ||
customBorderColor: BaseColors.black, | ||
icon: Assets.iconGoogle, | ||
onTap: () { | ||
if (state is! SignInLoadingState) { | ||
_signInBloc.add( | ||
TriggerSignInEvent(), | ||
); | ||
} | ||
}, | ||
), | ||
); | ||
}, | ||
), | ||
], | ||
), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.