diff --git a/lib/features/activity/activity_screen.dart b/lib/features/activity/activity_screen.dart index 7fd2f14..17028e4 100644 --- a/lib/features/activity/activity_screen.dart +++ b/lib/features/activity/activity_screen.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:rijig_mobile/core/utils/guide.dart'; class ActivityScreen extends StatefulWidget { const ActivityScreen({super.key}); @@ -12,6 +13,7 @@ class _ActivityScreenState extends State { Widget build(BuildContext context) { final titleofscreen = "Aktivitas"; return Scaffold( + backgroundColor: whiteColor, body: Center(child: Text("ini adalah halaman $titleofscreen")), ); } diff --git a/lib/features/cart/cart_screen.dart b/lib/features/cart/cart_screen.dart index 1577922..ebcee71 100644 --- a/lib/features/cart/cart_screen.dart +++ b/lib/features/cart/cart_screen.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:rijig_mobile/core/utils/guide.dart'; class CartScreen extends StatefulWidget { const CartScreen({super.key}); @@ -12,6 +13,7 @@ class _CartScreenState extends State { Widget build(BuildContext context) { final titleofscreen = "Cart"; return Scaffold( + backgroundColor: whiteColor, body: Center(child: Text("ini adalah halaman $titleofscreen")), ); } diff --git a/lib/features/home/components/categories.dart b/lib/features/home/components/categories.dart deleted file mode 100644 index 7392d79..0000000 --- a/lib/features/home/components/categories.dart +++ /dev/null @@ -1,67 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; - -class Categories extends StatelessWidget { - const Categories({super.key}); - - @override - Widget build(BuildContext context) { - List> categories = [ - {"icon": "assets/icons/Flash Icon.svg", "text": "Flash Deal"}, - {"icon": "assets/icons/Bill Icon.svg", "text": "Bill"}, - {"icon": "assets/icons/Game Icon.svg", "text": "Game"}, - {"icon": "assets/icons/Gift Icon.svg", "text": "Daily Gift"}, - {"icon": "assets/icons/Discover.svg", "text": "More"}, - ]; - return Padding( - padding: const EdgeInsets.all(20), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: List.generate( - categories.length, - (index) => CategoryCard( - icon: categories[index]["icon"], - text: categories[index]["text"], - press: () {}, - ), - ), - ), - ); - } -} - -class CategoryCard extends StatelessWidget { - const CategoryCard({ - super.key, - required this.icon, - required this.text, - required this.press, - }); - - final String icon, text; - final GestureTapCallback press; - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: press, - child: Column( - children: [ - Container( - padding: const EdgeInsets.all(16), - height: 56, - width: 56, - decoration: BoxDecoration( - color: const Color(0xFFFFECDF), - borderRadius: BorderRadius.circular(10), - ), - child: SvgPicture.asset(icon), - ), - const SizedBox(height: 4), - Text(text, textAlign: TextAlign.center) - ], - ), - ); - } -} diff --git a/lib/features/home/components/discount_banner.dart b/lib/features/home/components/discount_banner.dart deleted file mode 100644 index 3c06b40..0000000 --- a/lib/features/home/components/discount_banner.dart +++ /dev/null @@ -1,62 +0,0 @@ -import 'package:flutter/material.dart'; - -class DiscountBanner extends StatelessWidget { - const DiscountBanner({super.key}); - - @override - Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.all(16.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - _buildCard( - 'Pendapatan', - 'Rp 35.000', - Icons.account_balance_wallet, - ), - _buildCard('Sampah', '10 Kg', Icons.delete), - ], - ), - ], - ), - ); - } - - Widget _buildCard(String title, String value, IconData icon) { - return Expanded( - child: Card( - elevation: 4, - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), - child: Padding( - padding: const EdgeInsets.all(16.0), - child: Row( - children: [ - // Icon on the left - Icon(icon, color: Colors.blue, size: 40), - SizedBox(width: 10), - // Column for title and value on the right - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - title, - style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16), - ), - SizedBox(height: 8), - Text( - value, - style: TextStyle(fontSize: 14, color: Colors.black54), - ), - ], - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/features/home/components/home_header.dart b/lib/features/home/components/home_header.dart deleted file mode 100644 index b038bcd..0000000 --- a/lib/features/home/components/home_header.dart +++ /dev/null @@ -1,37 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:gap/gap.dart'; -import 'package:iconsax_flutter/iconsax_flutter.dart'; -import 'package:rijig_mobile/core/utils/guide.dart'; - -class HomeHeader extends StatelessWidget { - const HomeHeader({super.key}); - - @override - Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 20), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text("Rijig", style: Tulisan.heading(color: primaryColor)), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Icon(Iconsax.notification), - Gap(10), - Icon(Iconsax.message_2), - ], - ), - ], - ), - ), - const SizedBox(width: 16), - ], - ), - ); - } -} diff --git a/lib/features/home/components/icon_btn_with_counter.dart b/lib/features/home/components/icon_btn_with_counter.dart deleted file mode 100644 index 2ac3a5e..0000000 --- a/lib/features/home/components/icon_btn_with_counter.dart +++ /dev/null @@ -1,65 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; - -// import '../../../constants.dart'; - -class IconBtnWithCounter extends StatelessWidget { - const IconBtnWithCounter({ - super.key, - required this.svgSrc, - this.numOfitem = 0, - required this.press, - }); - - final String svgSrc; - final int numOfitem; - final GestureTapCallback press; - - @override - Widget build(BuildContext context) { - return InkWell( - borderRadius: BorderRadius.circular(100), - onTap: press, - child: Stack( - clipBehavior: Clip.none, - children: [ - Container( - padding: const EdgeInsets.all(12), - height: 46, - width: 46, - decoration: BoxDecoration( - // color: kSecondaryColor.withOpacity(0.1), - shape: BoxShape.circle, - ), - child: SvgPicture.asset(svgSrc), - ), - if (numOfitem != 0) - Positioned( - top: -3, - right: 0, - child: Container( - height: 20, - width: 20, - decoration: BoxDecoration( - color: const Color(0xFFFF4848), - shape: BoxShape.circle, - border: Border.all(width: 1.5, color: Colors.white), - ), - child: Center( - child: Text( - "$numOfitem", - style: const TextStyle( - fontSize: 12, - height: 1, - fontWeight: FontWeight.w600, - color: Colors.white, - ), - ), - ), - ), - ) - ], - ), - ); - } -} diff --git a/lib/features/home/components/popular_product.dart b/lib/features/home/components/popular_product.dart deleted file mode 100644 index 15c30de..0000000 --- a/lib/features/home/components/popular_product.dart +++ /dev/null @@ -1,52 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:rijig_mobile/features/home/model/product.dart'; -import 'package:rijig_mobile/features/home/components/product_card.dart'; - -class PopularProducts extends StatelessWidget { - const PopularProducts({super.key}); - - @override - Widget build(BuildContext context) { - return Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 20), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - "Artikel", - style: const TextStyle( - fontSize: 16, - fontWeight: FontWeight.w600, - color: Colors.black, - ), - ), - ], - ), - ), - SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Row( - children: [ - ...List.generate(demoProducts.length, (index) { - if (demoProducts[index].isPopular) { - return Padding( - padding: const EdgeInsets.only(left: 20), - child: ProductCard( - product: demoProducts[index], - onPress: () {}, - ), - ); - } - - return const SizedBox.shrink(); // here by default width and height is 0 - }), - const SizedBox(width: 20), - ], - ), - ), - ], - ); - } -} diff --git a/lib/features/home/components/search_field.dart b/lib/features/home/components/search_field.dart deleted file mode 100644 index f29df8d..0000000 --- a/lib/features/home/components/search_field.dart +++ /dev/null @@ -1,34 +0,0 @@ -// import 'package:flutter/material.dart'; - -// import '../../../constants.dart'; - -// class SearchField extends StatelessWidget { -// const SearchField({ -// Key? key, -// }) : super(key: key); - -// @override -// Widget build(BuildContext context) { -// return Form( -// child: TextFormField( -// onChanged: (value) {}, -// decoration: InputDecoration( -// filled: true, -// fillColor: kSecondaryColor.withOpacity(0.1), -// contentPadding: -// const EdgeInsets.symmetric(horizontal: 16, vertical: 8), -// border: searchOutlineInputBorder, -// focusedBorder: searchOutlineInputBorder, -// enabledBorder: searchOutlineInputBorder, -// hintText: "Search product", -// prefixIcon: const Icon(Icons.search), -// ), -// ), -// ); -// } -// } - -// const searchOutlineInputBorder = OutlineInputBorder( -// borderRadius: BorderRadius.all(Radius.circular(12)), -// borderSide: BorderSide.none, -// ); diff --git a/lib/features/home/components/special_offers.dart b/lib/features/home/components/special_offers.dart deleted file mode 100644 index b41e850..0000000 --- a/lib/features/home/components/special_offers.dart +++ /dev/null @@ -1,130 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:gap/gap.dart'; - -class SpecialOffers extends StatelessWidget { - const SpecialOffers({super.key}); - - @override - Widget build(BuildContext context) { - return Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 20), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - "Important!", - style: const TextStyle( - fontSize: 16, - fontWeight: FontWeight.w600, - color: Colors.black, - ), - ), - ], - ), - // child: SectionTitle( - // title: "Special for you", - // // press: () {}, - // ), - ), - const Gap(15), - SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Row( - children: [ - SpecialOfferCard( - image: "assets/image/Image Banner 2.png", - category: "Smartphone", - numOfBrands: 18, - press: () { - // Navigator.pushNamed(context, ProductsScreen.routeName); - }, - ), - SpecialOfferCard( - image: "assets/image/Image Banner 3.png", - category: "Fashion", - numOfBrands: 24, - press: () { - // Navigator.pushNamed(context, ProductsScreen.routeName); - }, - ), - const SizedBox(width: 20), - ], - ), - ), - ], - ); - } -} - -class SpecialOfferCard extends StatelessWidget { - const SpecialOfferCard({ - super.key, - required this.category, - required this.image, - required this.numOfBrands, - required this.press, - }); - - final String category, image; - final int numOfBrands; - final GestureTapCallback press; - - @override - Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.only(left: 20), - child: GestureDetector( - onTap: press, - child: SizedBox( - width: 242, - height: 100, - child: ClipRRect( - borderRadius: BorderRadius.circular(20), - child: Stack( - children: [ - Image.asset(image, fit: BoxFit.cover), - Container( - decoration: const BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - Colors.black54, - Colors.black38, - Colors.black26, - Colors.transparent, - ], - ), - ), - ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 15, - vertical: 10, - ), - child: Text.rich( - TextSpan( - style: const TextStyle(color: Colors.white), - children: [ - TextSpan( - text: "$category\n", - style: const TextStyle( - fontSize: 18, - fontWeight: FontWeight.bold, - ), - ), - TextSpan(text: "$numOfBrands Brands"), - ], - ), - ), - ), - ], - ), - ), - ), - ), - ); - } -} diff --git a/lib/features/home/home_screen.dart b/lib/features/home/home_screen.dart index 2df69e4..44f22b1 100644 --- a/lib/features/home/home_screen.dart +++ b/lib/features/home/home_screen.dart @@ -1,10 +1,10 @@ import 'package:flutter/material.dart'; +import 'package:gap/gap.dart'; +import 'package:iconsax_flutter/iconsax_flutter.dart'; import 'package:rijig_mobile/core/utils/guide.dart'; -import 'package:rijig_mobile/features/home/components/categories.dart'; -import 'package:rijig_mobile/features/home/components/discount_banner.dart'; -import 'package:rijig_mobile/features/home/components/home_header.dart'; -import 'package:rijig_mobile/features/home/components/popular_product.dart'; -import 'package:rijig_mobile/features/home/components/special_offers.dart'; +import 'package:rijig_mobile/features/home/components/product_card.dart'; +import 'package:rijig_mobile/features/home/model/product.dart'; +import 'package:rijig_mobile/widget/card_withicon.dart'; class HomeScreen extends StatefulWidget { const HomeScreen({super.key}); @@ -20,16 +20,199 @@ class _HomeScreenState extends State { backgroundColor: whiteColor, body: SafeArea( child: SingleChildScrollView( - padding: EdgeInsets.symmetric(vertical: 16), + padding: PaddingCustom().paddingHorizontalVertical(16, 20), child: Column( children: [ - HomeHeader(), - DiscountBanner(), - Categories(), - SpecialOffers(), - SizedBox(height: 20), - PopularProducts(), - SizedBox(height: 20), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Rijig", + style: Tulisan.heading(color: primaryColor), + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Icon(Iconsax.notification), + Gap(10), + Icon(Iconsax.message_2), + ], + ), + ], + ), + ), + ], + ), + Gap(20), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + CardWithIcon( + icon: Icons.account_circle, + text: 'Users', + number: '245', + onTap: () {}, + ), + CardWithIcon( + icon: Icons.shopping_cart, + text: 'Orders', + number: '178', + onTap: () {}, + ), + ], + ), + Gap(20), + Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + "Important!", + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: Colors.black, + ), + ), + ], + ), + const Gap(15), + SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: [ + SpecialOfferCard( + image: "assets/image/Image Banner 2.png", + category: "Smartphone", + numOfBrands: 18, + press: () {}, + ), + Gap(10), + SpecialOfferCard( + image: "assets/image/Image Banner 3.png", + category: "Fashion", + numOfBrands: 24, + press: () {}, + ), + ], + ), + ), + ], + ), + Gap(20), + Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + "Artikel", + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: Colors.black, + ), + ), + ], + ), + ), + SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: [ + ...List.generate(demoProducts.length, (index) { + if (demoProducts[index].isPopular) { + return Padding( + padding: const EdgeInsets.only(left: 20), + child: ProductCard( + product: demoProducts[index], + onPress: () {}, + ), + ); + } + return const SizedBox.shrink(); + }), + const SizedBox(width: 20), + ], + ), + ), + ], + ), + ], + ), + ), + ), + ); + } +} + +class SpecialOfferCard extends StatelessWidget { + const SpecialOfferCard({ + super.key, + required this.category, + required this.image, + required this.numOfBrands, + required this.press, + }); + + final String category, image; + final int numOfBrands; + final GestureTapCallback press; + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: press, + child: SizedBox( + width: 242, + height: 100, + child: ClipRRect( + borderRadius: BorderRadius.circular(20), + child: Stack( + children: [ + Image.asset(image, fit: BoxFit.cover), + Container( + decoration: const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Colors.black54, + Colors.black38, + Colors.black26, + Colors.transparent, + ], + ), + ), + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 15, + vertical: 10, + ), + child: Text.rich( + TextSpan( + style: const TextStyle(color: Colors.white), + children: [ + TextSpan( + text: "$category\n", + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + ), + ), + TextSpan(text: "$numOfBrands Brands"), + ], + ), + ), + ), ], ), ), diff --git a/lib/features/launch/splash_screen.dart b/lib/features/launch/splash_screen.dart index b35fb8f..616d79c 100644 --- a/lib/features/launch/splash_screen.dart +++ b/lib/features/launch/splash_screen.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:rijig_mobile/core/network/network_info.dart'; import 'package:rijig_mobile/core/router.dart'; import 'package:rijig_mobile/core/storage/expired_token.dart'; +import 'package:rijig_mobile/core/utils/guide.dart'; // import 'package:rijig_mobile/core/storage/secure_storage.dart'; class SplashScreen extends StatefulWidget { @@ -67,7 +68,7 @@ class SplashScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Colors.white, + backgroundColor: primaryColor, body: Stack( children: [ Positioned( @@ -85,7 +86,7 @@ class SplashScreenState extends State { style: TextStyle( fontSize: 36, fontWeight: FontWeight.bold, - color: Colors.blue, + color: whiteColor, fontFamily: 'Roboto', ), ), diff --git a/lib/features/requestpick/requestpickup_screen.dart b/lib/features/requestpick/requestpickup_screen.dart index 8255903..e03d010 100644 --- a/lib/features/requestpick/requestpickup_screen.dart +++ b/lib/features/requestpick/requestpickup_screen.dart @@ -8,14 +8,7 @@ class RequestPickScreen extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( appBar: CustomAppBar(judul: "Pilih Sampah"), - body: Center( - child: ElevatedButton( - onPressed: () { - Navigator.pop(context); - }, - child: Text("Back to Home"), - ), - ), + body: Center(child: Text("pilih sampah anda")), ); } } diff --git a/lib/widget/card_withicon.dart b/lib/widget/card_withicon.dart new file mode 100644 index 0000000..992da76 --- /dev/null +++ b/lib/widget/card_withicon.dart @@ -0,0 +1,62 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:rijig_mobile/core/utils/guide.dart'; + +class CardWithIcon extends StatelessWidget { + final IconData icon; + final String text; + final String number; + final Function() onTap; + + const CardWithIcon({ + super.key, + required this.icon, + required this.text, + required this.number, + required this.onTap, + }); + + @override + Widget build(BuildContext context) { + return InkWell( + onTap: onTap, + child: Container( + width: 164, + height: 120, + padding: const EdgeInsets.fromLTRB(14, 8, 13, 9), + decoration: BoxDecoration( + color: Colors.transparent.withValues(alpha: 3.5), + borderRadius: const BorderRadius.all(Radius.circular(13)), + border: Border.all(color: greyColor, width: 1), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Icon(icon, size: 30, color: primaryColor), + const SizedBox(width: 8, height: 20), + Text( + text, + style: GoogleFonts.dmSans( + textStyle: TextStyle( + fontSize: 12, + fontWeight: regular, + color: greyColor, + ), + ), + ), + Text( + number, + style: GoogleFonts.roboto( + textStyle: TextStyle( + fontSize: 16, + fontWeight: bold, + color: greyColor, + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/widget/information_card.dart b/lib/widget/information_card.dart deleted file mode 100644 index 2cac150..0000000 --- a/lib/widget/information_card.dart +++ /dev/null @@ -1,68 +0,0 @@ -import 'package:flutter/material.dart'; - -class InformationCard extends StatelessWidget { - const InformationCard({super.key}); - - @override - Widget build(BuildContext context) { - return Container( - height: 120, - padding: const EdgeInsets.all(10.0), - decoration: BoxDecoration( - color: const Color(0xFF1F1F1F), - borderRadius: BorderRadius.circular(12.0), - ), - child: const Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'Membership', - style: TextStyle( - color: Colors.white, - fontSize: 18.0, - fontWeight: FontWeight.w600, - ), - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - '594', - style: TextStyle( - color: Colors.white, - fontSize: 27.0, - fontWeight: FontWeight.bold, - ), - ), - Text( - 'US\$496', - style: TextStyle( - color: Colors.white, - fontSize: 27.0, - fontWeight: FontWeight.bold, - ), - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - 'Total members', - style: TextStyle( - color: Colors.white70, - fontSize: 16.0, - fontWeight: FontWeight.w600, - ), - ), - Text( - 'Per month', - style: TextStyle(color: Colors.white70, fontSize: 17.0), - ), - ], - ), - ], - ), - ); - } -}