diff --git a/kebun_pintar/lib/core/constant/app_color.dart b/kebun_pintar/lib/core/constant/app_color.dart index ecab622..714dd44 100644 --- a/kebun_pintar/lib/core/constant/app_color.dart +++ b/kebun_pintar/lib/core/constant/app_color.dart @@ -1,11 +1,13 @@ import 'package:flutter/material.dart'; class AppColor { - static const Color green = Color(0xFF00B14F); + static const Color primary = Color(0xFF00B14F); static const Color greenLight = Color(0xFFE6F4F1); static const Color greenDark = Color(0xFF00913A); static const Color greenText = Color(0xFF00B14F); static const Color greenTextLight = Color(0xFFE6F4F1); static const Color greenTextDark = Color(0xFF00913A); + + static const Color textDisable = Color(0xFFBDBDBD); } diff --git a/kebun_pintar/lib/core/extension/extention.dart b/kebun_pintar/lib/core/extension/extention.dart new file mode 100644 index 0000000..b67f92f --- /dev/null +++ b/kebun_pintar/lib/core/extension/extention.dart @@ -0,0 +1,5 @@ +class Extenstion { + static String capitalize(String s) { + return s[0].toUpperCase() + s.substring(1); + } +} \ No newline at end of file diff --git a/kebun_pintar/lib/core/widgets/app_button.dart b/kebun_pintar/lib/core/widgets/app_button.dart index e69de29..efa0478 100644 --- a/kebun_pintar/lib/core/widgets/app_button.dart +++ b/kebun_pintar/lib/core/widgets/app_button.dart @@ -0,0 +1,40 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:kebun_pintar/core/constant/app_color.dart'; + +class AppButton extends StatelessWidget { + const AppButton({ + super.key, + required this.onPressed, + required this.text, + this.backgroundColor = AppColor.primary, + this.foregroundColor = Colors.white, + this.borderSide, + }); + + final VoidCallback onPressed; + final String text; + final Color backgroundColor; + final Color foregroundColor; + final BorderSide? borderSide; + + @override + Widget build(BuildContext context) { + return ElevatedButton( + onPressed: onPressed, + style: ElevatedButton.styleFrom( + shadowColor: Colors.transparent, + textStyle: TextStyle( + fontSize: 14.sp, fontWeight: FontWeight.w500, fontFamily: 'Onest'), + backgroundColor: backgroundColor, + foregroundColor: foregroundColor, + minimumSize: Size(double.infinity, 48.h), + shape: RoundedRectangleBorder( + side: borderSide ?? BorderSide.none, + borderRadius: BorderRadius.circular(10.r), + ), + ), + child: Text(text), + ); + } +} diff --git a/kebun_pintar/lib/core/widgets/app_textfield.dart b/kebun_pintar/lib/core/widgets/app_textfield.dart index e69de29..a198a5b 100644 --- a/kebun_pintar/lib/core/widgets/app_textfield.dart +++ b/kebun_pintar/lib/core/widgets/app_textfield.dart @@ -0,0 +1,35 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:kebun_pintar/core/constant/app_color.dart'; + +class CustomTextField extends StatelessWidget { + const CustomTextField({ + super.key, + required this.controller, + this.hintText = 'Enter Here', + this.suffixIcon, + }); + + final TextEditingController controller; + final String hintText; + final Widget? suffixIcon; + + @override + Widget build(BuildContext context) { + return TextField( + controller: controller, + decoration: InputDecoration( + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: AppColor.textDisable, width: 1.r), + borderRadius: BorderRadius.circular(8.r), + gapPadding: 10.r), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: AppColor.primary, width: 1.r), + borderRadius: BorderRadius.circular(8.r), + gapPadding: 10.r), + hintText: hintText, + // hintStyle: AppTheme.hintStyle, + suffixIcon: suffixIcon), + ); + } +} diff --git a/kebun_pintar/pubspec.lock b/kebun_pintar/pubspec.lock index ba663f6..902b6c4 100644 --- a/kebun_pintar/pubspec.lock +++ b/kebun_pintar/pubspec.lock @@ -102,6 +102,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.0" + flutter_screenutil: + dependency: "direct main" + description: + name: flutter_screenutil + sha256: "8239210dd68bee6b0577aa4a090890342d04a136ce1c81f98ee513fc0ce891de" + url: "https://pub.dev" + source: hosted + version: "5.9.3" flutter_test: dependency: "direct dev" description: flutter diff --git a/kebun_pintar/pubspec.yaml b/kebun_pintar/pubspec.yaml index 5272f7b..b1c18b3 100644 --- a/kebun_pintar/pubspec.yaml +++ b/kebun_pintar/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.0+>1 +version: 1.0.0+1 environment: sdk: ^3.5.1 @@ -40,6 +40,7 @@ dependencies: intl: ^0.19.0 dio: ^5.7.0 go_router: ^14.2.7 + flutter_screenutil: ^5.9.3 dev_dependencies: flutter_test: