-
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.
- Loading branch information
1 parent
e284ec1
commit defc45f
Showing
4 changed files
with
175 additions
and
145 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
// import 'package:carousel_slider/carousel_slider.dart'; | ||
// import 'package:firebase_auth/firebase_auth.dart'; | ||
// import 'package:flutter/material.dart'; | ||
import 'package:flutter/material.dart'; | ||
// import 'package:flutter_bloc/flutter_bloc.dart'; | ||
// import 'package:font_awesome_flutter/font_awesome_flutter.dart'; | ||
// import 'package:go_router/go_router.dart'; | ||
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; | ||
import 'package:go_router/go_router.dart'; | ||
// import 'package:google_sign_in/google_sign_in.dart'; | ||
// import 'package:intl/intl.dart'; | ||
// import 'package:url_launcher/url_launcher.dart'; | ||
|
||
// import '../../../../../core/bases/widgets/atoms/button.dart'; | ||
// import '../../../../../core/bases/widgets/layout/bebras_scaffold.dart'; | ||
// import '../../../../../core/bases/widgets/layout/bottom_navbar.dart'; | ||
import '../../../../../core/bases/widgets/atoms/button.dart'; | ||
import '../../../../../core/bases/widgets/layout/bebras_scaffold.dart'; | ||
import '../../../../../core/constants/assets.dart'; | ||
import '../../../../../core/bases/widgets/layout/bottom_navbar.dart'; | ||
// import '../../../../../core/theme/font_theme.dart'; | ||
// import '../../../../../services/firebase_service.dart'; | ||
// import '../../../../material/menu/presentation/pages/_pages.dart'; | ||
// import '../../bloc/home_cubit.dart'; | ||
// import 'clip_path.dart'; | ||
|
||
// part 'home_page.dart'; | ||
part 'home_page.dart'; | ||
// part 'setting_page.dart'; |
299 changes: 164 additions & 135 deletions
299
app/lib/features/main/presentation/pages/v2/home_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,141 +1,170 @@ | ||
// part of '_pages.dart'; | ||
part of '_pages.dart'; | ||
|
||
// class HomePage extends StatefulWidget { | ||
// const HomePage({super.key}); | ||
class HomePageV2 extends StatefulWidget { | ||
const HomePageV2({super.key}); | ||
|
||
// @override | ||
// State<HomePage> createState() => _HomePageState(); | ||
// } | ||
@override | ||
State<HomePageV2> createState() => _HomePageV2State(); | ||
} | ||
|
||
// final List<String> imgList = [ | ||
// 'https://pandai.bebras.or.id/img/carousel5.ad104915.png', | ||
// 'https://pandai.bebras.or.id/img/banner2023.95952847.jpeg', | ||
// 'https://pandai.bebras.or.id/img/bebrasBanner.96a43a30.jpg', | ||
// 'https://pandai.bebras.or.id/img/grow-with-google-bebras-id.8d80a623.jpg', | ||
// ]; | ||
class _HomePageV2State extends State<HomePageV2> { | ||
String version = ''; | ||
|
||
// class Course { | ||
// String title; | ||
// String description; | ||
@override | ||
void initState() { | ||
super.initState(); | ||
} | ||
|
||
// Course(this.title, this.description); | ||
// } | ||
Future<void> showModal() async { | ||
return showModalBottomSheet<void>( | ||
context: context, | ||
builder: (BuildContext context) { | ||
return StatefulBuilder( | ||
builder: (BuildContext context, StateSetter setState) { | ||
return Container( | ||
height: 260, | ||
width: double.infinity, | ||
color: Colors.white, | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
children: <Widget>[ | ||
const SizedBox( | ||
height: 40, | ||
), | ||
Container( | ||
margin: const EdgeInsets.only(left: 20), | ||
child: const Text( | ||
'Ayo pilih latihanmu!', | ||
textAlign: TextAlign.left, | ||
style: | ||
TextStyle(fontSize: 16, fontWeight: FontWeight.bold), | ||
), | ||
), | ||
const SizedBox( | ||
height: 25, | ||
), | ||
Container( | ||
padding: const EdgeInsets.symmetric(horizontal: 40), | ||
width: double.infinity, | ||
child: const Button( | ||
customButtonColor: const Color(0xFF1BB8E1), | ||
customTextColor: Colors.white, | ||
text: 'Unduh Latihan Minggu Ini', | ||
), | ||
), | ||
const SizedBox( | ||
height: 20, | ||
), | ||
Container( | ||
padding: const EdgeInsets.symmetric(horizontal: 40), | ||
width: double.infinity, | ||
child: const Button( | ||
customTextColor: const Color(0xFF1BB8E1), | ||
customButtonColor: const Color(0x1F1BB8E1), | ||
text: 'Latihan Minggu Depan', | ||
), | ||
), | ||
], | ||
), | ||
); | ||
}, | ||
); | ||
}, | ||
).whenComplete(() => null); | ||
} | ||
|
||
// class _HomePageState extends State<HomePage> { | ||
// @override | ||
// void initState() { | ||
// context.read<HomeCubit>().fetchUser(); | ||
// super.initState(); | ||
// } | ||
|
||
// @override | ||
// Widget build(BuildContext context) { | ||
// return BebrasScaffold( | ||
// body: Stack( | ||
// children: [ | ||
// ClipPath( | ||
// clipper: ClipPathClass(), | ||
// child: Container( | ||
// height: 250, | ||
// color: const Color(0xFF1BB8E1), | ||
// ), | ||
// ), | ||
// Column( | ||
// children: [ | ||
// Padding( | ||
// padding: const EdgeInsets.only( | ||
// left: 32, right: 32, top: 32, bottom: 16), | ||
// child: Column( | ||
// crossAxisAlignment: CrossAxisAlignment.start, | ||
// children: [ | ||
// BlocBuilder<HomeCubit, HomeState>( | ||
// builder: (context, state) { | ||
// if (state is HomeSuccess) { | ||
// return RichText( | ||
// text: TextSpan( | ||
// text: 'Selamat Datang\n', | ||
// style: const TextStyle( | ||
// color: Colors.white, | ||
// fontSize: 20, | ||
// fontWeight: FontWeight.w400, | ||
// ), | ||
// children: <TextSpan>[ | ||
// TextSpan( | ||
// text: toBeginningOfSentenceCase( | ||
// '${state.user.name}!', | ||
// ), | ||
// style: const TextStyle( | ||
// color: Colors.white, | ||
// fontSize: 20, | ||
// fontWeight: FontWeight.w600, | ||
// ), | ||
// ), | ||
// ], | ||
// ), | ||
// ); | ||
// } | ||
// return Container(); | ||
// }), | ||
// const SizedBox( | ||
// height: 30, | ||
// ), | ||
// CarouselSlider( | ||
// items: imgList | ||
// .map( | ||
// (item) => InkWell( | ||
// onTap: () async { | ||
// final Uri url = Uri.parse( | ||
// 'https://bebras.or.id/v3/bebras-indonesia-challenge-2023/'); | ||
// if (!await launchUrl(url)) { | ||
// throw Exception('Could not launch $url'); | ||
// } | ||
// }, // Handle your callback | ||
// child: Container( | ||
// margin: const EdgeInsets.only( | ||
// left: 10, | ||
// right: 10, | ||
// ), | ||
// decoration: BoxDecoration( | ||
// borderRadius: BorderRadius.circular(10), | ||
// color: Colors.transparent, | ||
// ), | ||
// child: ClipRRect( | ||
// borderRadius: BorderRadius.circular(10), | ||
// child: Image.network( | ||
// item, | ||
// fit: BoxFit.cover, | ||
// width: double.infinity, | ||
// ), | ||
// ), | ||
// ), | ||
// ), | ||
// ) | ||
// .toList(), | ||
// options: CarouselOptions( | ||
// height: 150, | ||
// viewportFraction: 1, | ||
// autoPlay: true, | ||
// autoPlayInterval: const Duration(seconds: 3), | ||
// ), | ||
// ), | ||
// ], | ||
// ), | ||
// ), | ||
// const MaterialMenu(), | ||
// ], | ||
// ), | ||
// ], | ||
// ), | ||
// floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, | ||
// floatingActionButton: FloatingActionButton( | ||
// onPressed: () { | ||
// context.go('/quiz_registration'); | ||
// }, | ||
// child: const FaIcon(FontAwesomeIcons.graduationCap), | ||
// ), | ||
// bottomNavigationBar: const BottomNavBar( | ||
// currentIndex: 0, | ||
// ), | ||
// ); | ||
// } | ||
// } | ||
@override | ||
Widget build(BuildContext context) { | ||
return BebrasScaffold( | ||
body: Container( | ||
color: const Color(0xFF1BB8E1), | ||
child: Stack( | ||
children: [ | ||
Column( | ||
children: [ | ||
const SizedBox( | ||
height: 60, | ||
), | ||
Container( | ||
alignment: Alignment.center, | ||
child: ClipRRect( | ||
borderRadius: BorderRadius.circular(24), | ||
child: Image.asset( | ||
Assets.bLogo, | ||
height: 150, | ||
), | ||
), | ||
), | ||
], | ||
), | ||
Align( | ||
alignment: Alignment.bottomCenter, | ||
child: Container( | ||
height: 300, | ||
width: double.infinity, | ||
decoration: const BoxDecoration( | ||
color: Colors.white, | ||
borderRadius: BorderRadius.only( | ||
topLeft: Radius.circular(42), | ||
topRight: Radius.circular(42), | ||
), | ||
), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
const Text( | ||
'Ayo mulai latihanmu!', | ||
style: TextStyle( | ||
fontWeight: FontWeight.w600, | ||
fontSize: 18, | ||
), | ||
), | ||
const SizedBox( | ||
height: 30, | ||
), | ||
SizedBox( | ||
width: 230, | ||
child: Button( | ||
customTextColor: Colors.white, | ||
customButtonColor: Color(0xFF1BB8E1), | ||
fontSize: 14, | ||
innerVerticalPadding: 14, | ||
onTap: () async { | ||
await showModal(); | ||
}, | ||
text: 'Daftar Latihan', | ||
), | ||
), | ||
const SizedBox( | ||
height: 10, | ||
), | ||
const SizedBox( | ||
width: 230, | ||
child: Button( | ||
customTextColor: const Color(0xFF1BB8E1), | ||
customButtonColor: const Color(0x1F1BB8E1), | ||
fontSize: 14, | ||
innerVerticalPadding: 14, | ||
text: 'Riwayat Latihan', | ||
), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, | ||
floatingActionButton: FloatingActionButton( | ||
onPressed: () { | ||
context.go('/quiz_registration'); | ||
}, | ||
child: const FaIcon(FontAwesomeIcons.graduationCap), | ||
), | ||
bottomNavigationBar: const BottomNavBar( | ||
currentIndex: 2, | ||
), | ||
); | ||
} | ||
} |
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