From 12ecf1c84b61b5aeaefad25b15a0629d1a67a785 Mon Sep 17 00:00:00 2001 From: pahmiudahgede Date: Sat, 17 May 2025 01:17:10 +0700 Subject: [PATCH] feat&fix: add screen for cart and change color bg --- lib/core/utils/exportimportview.dart | 2 +- lib/core/utils/navigation.dart | 2 +- .../presentation/screen/activity_screen.dart | 1 + lib/features/cart/cart_screen.dart | 20 -- .../cart/presentation/cart_screen.dart | 179 ++++++++++++++++++ .../presentation/screen/profil_screen.dart | 22 +-- .../screen/requestpickup_screen.dart | 2 + 7 files changed, 186 insertions(+), 42 deletions(-) delete mode 100644 lib/features/cart/cart_screen.dart create mode 100644 lib/features/cart/presentation/cart_screen.dart diff --git a/lib/core/utils/exportimportview.dart b/lib/core/utils/exportimportview.dart index 31253c5..997681b 100644 --- a/lib/core/utils/exportimportview.dart +++ b/lib/core/utils/exportimportview.dart @@ -1,7 +1,7 @@ export 'package:go_router/go_router.dart'; export 'package:rijig_mobile/core/utils/navigation.dart'; export 'package:rijig_mobile/features/activity/presentation/screen/activity_screen.dart'; -export 'package:rijig_mobile/features/cart/cart_screen.dart'; +export 'package:rijig_mobile/features/cart/presentation/cart_screen.dart'; export 'package:rijig_mobile/features/home/presentation/screen/home_screen.dart'; export 'package:rijig_mobile/features/profil/presentation/screen/profil_screen.dart'; export 'package:rijig_mobile/features/requestpick/presentation/screen/requestpickup_screen.dart'; diff --git a/lib/core/utils/navigation.dart b/lib/core/utils/navigation.dart index c0b6640..b140b57 100644 --- a/lib/core/utils/navigation.dart +++ b/lib/core/utils/navigation.dart @@ -3,7 +3,7 @@ import 'package:iconsax_flutter/iconsax_flutter.dart'; import 'package:rijig_mobile/core/utils/guide.dart'; import 'package:rijig_mobile/core/router.dart'; import 'package:rijig_mobile/features/activity/presentation/screen/activity_screen.dart'; -import 'package:rijig_mobile/features/cart/cart_screen.dart'; +import 'package:rijig_mobile/features/cart/presentation/cart_screen.dart'; import 'package:rijig_mobile/features/home/presentation/screen/home_screen.dart'; import 'package:rijig_mobile/features/profil/presentation/screen/profil_screen.dart'; import 'package:shared_preferences/shared_preferences.dart'; diff --git a/lib/features/activity/presentation/screen/activity_screen.dart b/lib/features/activity/presentation/screen/activity_screen.dart index c6400ee..61b476d 100644 --- a/lib/features/activity/presentation/screen/activity_screen.dart +++ b/lib/features/activity/presentation/screen/activity_screen.dart @@ -15,6 +15,7 @@ class _ActivityScreenState extends State { return DefaultTabController( length: 3, child: Scaffold( + backgroundColor: whiteColor, appBar: AppBar( title: Text('Aktifitas', style: Tulisan.subheading()), centerTitle: true, diff --git a/lib/features/cart/cart_screen.dart b/lib/features/cart/cart_screen.dart deleted file mode 100644 index ebcee71..0000000 --- a/lib/features/cart/cart_screen.dart +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:rijig_mobile/core/utils/guide.dart'; - -class CartScreen extends StatefulWidget { - const CartScreen({super.key}); - - @override - State createState() => _CartScreenState(); -} - -class _CartScreenState extends State { - @override - Widget build(BuildContext context) { - final titleofscreen = "Cart"; - return Scaffold( - backgroundColor: whiteColor, - body: Center(child: Text("ini adalah halaman $titleofscreen")), - ); - } -} diff --git a/lib/features/cart/presentation/cart_screen.dart b/lib/features/cart/presentation/cart_screen.dart new file mode 100644 index 0000000..a6034a4 --- /dev/null +++ b/lib/features/cart/presentation/cart_screen.dart @@ -0,0 +1,179 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:gap/gap.dart'; +import 'package:rijig_mobile/core/utils/guide.dart'; +import 'package:rijig_mobile/widget/buttoncard.dart'; + +class CartScreen extends StatefulWidget { + const CartScreen({super.key}); + + @override + State createState() => _CartScreenState(); +} + +class _CartScreenState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: whiteColor, + appBar: AppBar( + title: Text('Keranjang', style: Tulisan.subheading()), + backgroundColor: whiteColor, + ), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.all(20), + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + boxShadow: [ + BoxShadow( + color: Colors.grey.withValues(alpha: 0.1), + spreadRadius: 1, + blurRadius: 8, + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Lokasi Penjemputan', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + SizedBox(height: 10), + Text( + 'Lokasi harus di Jember', + style: TextStyle(fontSize: 14), + ), + + Gap(15), + CardButtonOne( + textButton: "Pilih Alamat", + fontSized: 16.sp, + color: primaryColor, + colorText: whiteColor, + borderRadius: 9, + horizontal: double.infinity, + vertical: 40, + onTap: () { + debugPrint("lanjutkan tapped"); + }, + ), + ], + ), + ), + + SizedBox(height: 20), + + Container( + padding: EdgeInsets.all(20), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + boxShadow: [ + BoxShadow( + color: Colors.grey.withValues(alpha: 0.1), + spreadRadius: 1, + blurRadius: 8, + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Jenis Sampah', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + SizedBox(height: 10), + Row( + children: [ + Icon(Icons.delete, color: Colors.blue), + SizedBox(width: 8), + Text('Plastik', style: TextStyle(fontSize: 14)), + Spacer(), + Row( + children: [ + IconButton( + onPressed: () {}, + icon: Icon(Icons.remove), + ), + Text('4.75 kg'), + IconButton(onPressed: () {}, icon: Icon(Icons.add)), + ], + ), + ], + ), + SizedBox(height: 10), + Text( + 'Dijumlahkan: 4.75 kg', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 14, + ), + ), + ], + ), + ), + SizedBox(height: 20), + + Container( + padding: EdgeInsets.all(20), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + boxShadow: [ + BoxShadow( + color: Colors.grey.withValues(alpha: 0.1), + spreadRadius: 1, + blurRadius: 8, + ), + ], + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'Berat Total', + style: TextStyle(fontWeight: FontWeight.bold), + ), + Text('4.75 kg', style: TextStyle(fontSize: 18)), + ], + ), + ), + SizedBox(height: 20), + + Center( + child: CardButtonOne( + textButton: "Lanjutkan", + fontSized: 16.sp, + color: primaryColor, + colorText: whiteColor, + borderRadius: 9, + horizontal: double.infinity, + vertical: 60, + onTap: () { + debugPrint("lanjutkan tapped"); + }, + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/features/profil/presentation/screen/profil_screen.dart b/lib/features/profil/presentation/screen/profil_screen.dart index e0b0df4..8240202 100644 --- a/lib/features/profil/presentation/screen/profil_screen.dart +++ b/lib/features/profil/presentation/screen/profil_screen.dart @@ -16,6 +16,7 @@ class _ProfilScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( + backgroundColor: whiteColor, body: SafeArea( child: Stack( children: [ @@ -52,20 +53,6 @@ class _ProfilScreenState extends State { Text('+62878774527342'), SizedBox(height: 20), - // Row( - // children: [ - // Text( - // 'Tipe Kontributor: ', - // style: TextStyle(fontWeight: FontWeight.bold), - // ), - // Chip( - // label: Text('Personal'), - // backgroundColor: Colors.green, - // labelStyle: TextStyle(color: Colors.white), - // ), - // ], - // ), - // SizedBox(height: 20), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -87,12 +74,7 @@ class _ProfilScreenState extends State { child: Padding( padding: PaddingCustom().paddingHorizontal(20), child: Column( - children: [ - ProfileMenuOptions(), - // SizedBox(height: 20), - Gap(30), - ButtonLogout(), - ], + children: [ProfileMenuOptions(), Gap(30), ButtonLogout()], ), ), ), diff --git a/lib/features/requestpick/presentation/screen/requestpickup_screen.dart b/lib/features/requestpick/presentation/screen/requestpickup_screen.dart index bea352f..fd2ee6a 100644 --- a/lib/features/requestpick/presentation/screen/requestpickup_screen.dart +++ b/lib/features/requestpick/presentation/screen/requestpickup_screen.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:provider/provider.dart'; +import 'package:rijig_mobile/core/utils/guide.dart'; import 'package:rijig_mobile/globaldata/trash/trash_viewmodel.dart'; import 'package:rijig_mobile/widget/appbar.dart'; import 'package:shimmer/shimmer.dart'; @@ -17,6 +18,7 @@ class RequestPickScreen extends StatelessWidget { final String? baseUrl = dotenv.env["BASE_URL"]; return Scaffold( + backgroundColor: whiteColor, appBar: CustomAppBar(judul: "Pilih sampah"), body: Consumer( builder: (context, viewModel, child) {