-
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.
conditional render login and onboarding page v1/v2
- Loading branch information
Showing
19 changed files
with
536 additions
and
371 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
List<Map<String, dynamic>> getStartedList = [ | ||
{ | ||
'image': 'assets/images/ic_onboard_1.png', | ||
'title': 'Temukan Dunia Pengetahuanmu!', | ||
'description': | ||
'Selamat datang di Bebras Pandai, tempat di mana kamu dapat membuka ' | ||
'pintu menuju pengetahuan yang tak terbatas.' | ||
}, | ||
{ | ||
'image': 'assets/images/ic_onboard_2.png', | ||
'title': 'Pintu Gerbang Kecerdasan Terbuka', | ||
'description': | ||
'Setiap langkah akan membawa kita lebih dekat dengan pengetahuan ' | ||
'yang tak terbatas.' | ||
}, | ||
{ | ||
'image': 'assets/images/ic_onboard_3.png', | ||
'title': 'Temukan Keajaiban!', | ||
'description': | ||
'Setiap momen belajar menjadi petualangan yang penuh keceriaan. ' | ||
'Ayo bergabung dalam dan nikmati manfaat yang luar biasa' | ||
} | ||
]; |
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
20 changes: 10 additions & 10 deletions
20
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
// import 'package:flutter/material.dart'; | ||
// import 'package:flutter_bloc/flutter_bloc.dart'; | ||
// import 'package:go_router/go_router.dart'; | ||
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'; | ||
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'; | ||
part 'sign_in_page.dart'; |
200 changes: 100 additions & 100 deletions
200
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 |
---|---|---|
@@ -1,106 +1,106 @@ | ||
// part of '_pages.dart'; | ||
part of '_pages.dart'; | ||
|
||
// class LoginPage extends StatefulWidget { | ||
// const LoginPage({super.key}); | ||
class LoginPageV2 extends StatefulWidget { | ||
const LoginPageV2({super.key}); | ||
|
||
// @override | ||
// State<LoginPage> createState() => _LoginPageState(); | ||
// } | ||
@override | ||
State<LoginPageV2> createState() => _LoginPageV2State(); | ||
} | ||
|
||
// class _LoginPageState extends State<LoginPage> { | ||
// late final SignInBloc _signInBloc; | ||
class _LoginPageV2State extends State<LoginPageV2> { | ||
late final SignInBloc _signInBloc; | ||
|
||
// @override | ||
// void initState() { | ||
// _signInBloc = get<SignInBloc>(); | ||
@override | ||
void initState() { | ||
_signInBloc = get<SignInBloc>(); | ||
|
||
// super.initState(); | ||
// } | ||
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(), | ||
// ); | ||
// } | ||
// }, | ||
// ), | ||
// ); | ||
// }, | ||
// ), | ||
// ], | ||
// ), | ||
// ), | ||
// ), | ||
// ], | ||
// ), | ||
// ), | ||
// ); | ||
// } | ||
// } | ||
@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(), | ||
); | ||
} | ||
}, | ||
), | ||
); | ||
}, | ||
), | ||
], | ||
), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
30 changes: 15 additions & 15 deletions
30
app/lib/features/onboarding/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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
// import 'package:flutter/material.dart'; | ||
// import 'package:flutter/services.dart'; | ||
// import 'package:flutter_bloc/flutter_bloc.dart'; | ||
// import 'package:go_router/go_router.dart'; | ||
// import 'package:page_view_indicators/circle_page_indicator.dart'; | ||
// import 'package:url_launcher/url_launcher.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
import 'package:go_router/go_router.dart'; | ||
import 'package:page_view_indicators/circle_page_indicator.dart'; | ||
import 'package:url_launcher/url_launcher.dart'; | ||
|
||
// import '../../../../core/bases/widgets/atoms/button.dart'; | ||
// import '../../../../core/constants/assets.dart'; | ||
// import '../../../../core/constants/get_started.dart'; | ||
// import '../../../../core/theme/base_colors.dart'; | ||
// import '../../../../core/theme/font_theme.dart'; | ||
// import '../bloc/user_initialization_bloc.dart'; | ||
import '../../../../../core/bases/widgets/atoms/button.dart'; | ||
import '../../../../../core/constants/assets.dart'; | ||
import '../../../../../core/constants/get_started.dart'; | ||
import '../../../../../core/theme/base_colors.dart'; | ||
import '../../../../../core/theme/font_theme.dart'; | ||
import '../../bloc/user_initialization_bloc.dart'; | ||
|
||
// part 'onboarding_page.dart'; | ||
// part 'splash_screen.dart'; | ||
// part 'update_dialog.dart'; | ||
part 'onboarding_page.dart'; | ||
part 'splash_screen.dart'; | ||
part 'update_dialog.dart'; |
Oops, something went wrong.