diff --git a/lib/main.dart b/lib/main.dart index ee2fba7..8e1fe17 100755 --- a/lib/main.dart +++ b/lib/main.dart @@ -3,8 +3,7 @@ import 'package:beautify/view/landing_screen/landing_screen.dart'; import 'package:beautify/view/rootscreen/root.dart'; import 'package:beautify/viewmodel/initial/initial.dart'; import 'package:flutter/material.dart'; -import 'package:hive/hive.dart'; -import 'package:hive_flutter/adapters.dart'; +import 'package:flutter/services.dart'; import 'package:provider/provider.dart'; import 'configs/core_theme.dart' as theme; import 'package:get/get.dart'; @@ -15,6 +14,10 @@ import 'model/controllers/duplicate_controller.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); await HighPriorityInitial.initial(); + SystemChrome.setPreferredOrientations([ + DeviceOrientation.portraitUp, + DeviceOrientation.portraitDown, + ]); runApp(MultiProvider( providers: [ ChangeNotifierProvider(create: (_) => ThemeProvider()), diff --git a/lib/view/cartscreen/checout_screen/check_screen.dart b/lib/view/cartscreen/checout_screen/check_screen.dart index f11209c..19211eb 100755 --- a/lib/view/cartscreen/checout_screen/check_screen.dart +++ b/lib/view/cartscreen/checout_screen/check_screen.dart @@ -190,7 +190,7 @@ class _CheckoutScreenState extends State { addresList.isNotEmpty ? SizedBox( width: Get.width * 0.45, - height: 50, + height: AppDimensions.normalize(20), child: DropdownButtonFormField2( decoration: InputDecoration( hintText: diff --git a/lib/view/cartscreen/payment_screen/payment_screen.dart b/lib/view/cartscreen/payment_screen/payment_screen.dart index 7bf5bb4..753f827 100755 --- a/lib/view/cartscreen/payment_screen/payment_screen.dart +++ b/lib/view/cartscreen/payment_screen/payment_screen.dart @@ -1,7 +1,7 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - +import 'package:beautify/configs/configs.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:get/get.dart'; import '../../../model/controllers/duplicate_controller.dart'; @@ -30,8 +30,8 @@ class PaymentScreen extends StatelessWidget { return Scaffold( floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, floatingActionButton: SizedBox( - height: 60, - width: Get.mediaQuery.size.width * 0.7, + height: AppDimensions.normalize(20), + width: Get.mediaQuery.size.width * 0.6, child: FloatingActionButton.extended( onPressed: () { showCupertinoDialog( @@ -43,7 +43,6 @@ class PaymentScreen extends StatelessWidget { ), content: Text( "Do you want pay?", - // style: textStyle.bodyNormal, ), actions: [ CupertinoButton( @@ -72,8 +71,7 @@ class PaymentScreen extends StatelessWidget { snackBar( title: "Pay", message: "Successfully payed", - // textStyle: textStyle, - /* colors: colors*/); + ); } }, ), @@ -84,37 +82,34 @@ class PaymentScreen extends StatelessWidget { }, label: Text( "Pay", - // style: textStyle.titleLarge.copyWith(color: colors.whiteColor), )), ), appBar: AppBar( - // backgroundColor: colors.whiteColor, - // foregroundColor: colors.blackColor, centerTitle: true, automaticallyImplyLeading: true, title: Text( "E-Payment", - // style: textStyle.titleLarge, ), ), body: Padding( - padding: const EdgeInsets.all(15), + padding:Space.v1!, child: SingleChildScrollView( physics: duplicateController.uiDuplicate.defaultScroll, child: Column( children: [ + Space.y1!, Align( alignment: Alignment.center, child: SvgPicture.string( paymentFunctions.createBarcode(), ), ), + Space.y1!, duplicateContainer( - // colors: colors, widget: Column( children: [ SizedBox( - height: 100, + height: AppDimensions.normalize(40), width: Get.mediaQuery.size.width * 0.8, child: GridView.builder( physics: duplicateController.uiDuplicate.defaultScroll, @@ -126,9 +121,8 @@ class PaymentScreen extends StatelessWidget { crossAxisSpacing: 10), itemBuilder: (context, index) { return SizedBox( - height: 40, + height: AppDimensions.normalize(20), child: CircleAvatar( - // backgroundColor: colors.whiteColor, foregroundImage: CachedNetworkImageProvider( productList[index].imageUrl), ), @@ -136,29 +130,23 @@ class PaymentScreen extends StatelessWidget { }, ), ), - const SizedBox( - width: 10, - ), + Space.y!, Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ SizedBox( - width: Get.mediaQuery.size.width * 0.48, + width: AppDimensions.normalize(100), child: Row( children: [ Text( productList[0].name.substring(0, 10), - /* style: textStyle.bodyNormal - .copyWith(fontWeight: FontWeight.bold),*/ overflow: TextOverflow.clip, textAlign: TextAlign.start, + style: AppText.b1b, ), - const SizedBox( - width: 7, - ), + Space.x!, Text( "and more", - // style: textStyle.bodySmall, ), ], )), @@ -166,13 +154,11 @@ class PaymentScreen extends StatelessWidget { children: [ Icon( CupertinoIcons.number_circle, - // color: colors.blackColor, size: 20, ), Text( "Count : ${productList.length}", - // style: textStyle.bodySmall - // .copyWith(color: colors.blackColor), + style: AppText.h3b ), ], ) @@ -182,63 +168,43 @@ class PaymentScreen extends StatelessWidget { ), ), duplicateContainer( - // colors: colors, widget: Column( children: [ duplicateRowItem( - // colors: colors, prefix: Text( "Recipient Name", - // style: textStyle.bodyNormal, ), suffix: Text( profileController.information.name, - // style: textStyle.bodyNormal - // .copyWith(fontWeight: FontWeight.bold), )), duplicateRowItem( - // colors: colors, prefix: Text( "Address", - // style: textStyle.bodyNormal, ), suffix: Text( addressDetail, - // style: textStyle.bodyNormal - // .copyWith(fontWeight: FontWeight.bold), )), duplicateRowItem( - // colors: colors, prefix: Text( "Payment Methods", - // style: textStyle.bodyNormal, ), suffix: Text( "My E-Wallet", - // style: textStyle.bodyNormal - // .copyWith(fontWeight: FontWeight.bold), )), duplicateRowItem( - // colors: colors, prefix: Text( "Date", - // style: textStyle.bodyNormal, ), suffix: Text( dateTime.toString().substring(0, 16), - // style: textStyle.bodyNormal - // .copyWith(fontWeight: FontWeight.bold), )), duplicateRowItem( - // colors: colors, prefix: Text( "Total", - // style: textStyle.bodyNormal, ), suffix: Text( "€$totalPrice", - // style: textStyle.bodyNormal - // .copyWith(fontWeight: FontWeight.bold), + style: AppText.h3b, )), ], )), @@ -250,34 +216,28 @@ class PaymentScreen extends StatelessWidget { } Widget duplicateContainer( - {required Widget widget/*, required CustomColors colors*/}) { + {required Widget widget}) { return Container( - width: Get.mediaQuery.size.width, - margin: const EdgeInsets.only(top: 25, bottom: 25), - padding: const EdgeInsets.all(15), - decoration: BoxDecoration( - // color: colors.gray, - borderRadius: BorderRadius.circular(15), - ), + width: AppDimensions.size?.width, + margin: Space.all(.5,.5), + padding: Space.all(.5,.5), child: widget); } Widget duplicateRowItem( {required Widget prefix, required Widget suffix, - /* required CustomColors colors*/}) { + }) { return Column( children: [ Padding( - padding: const EdgeInsets.only(top: 10, bottom: 10), + padding: Space.all(.5,.5), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [prefix, suffix], ), ), - const SizedBox( - height: 10, - ), + Space.y!, Divider( thickness: 0.5, height: 1, diff --git a/lib/view/landing_screen/landing_screen.dart b/lib/view/landing_screen/landing_screen.dart index 157c674..a359d0c 100755 --- a/lib/view/landing_screen/landing_screen.dart +++ b/lib/view/landing_screen/landing_screen.dart @@ -69,10 +69,9 @@ class _LandingScreenState extends State { width: AppDimensions.normalize(10), height: AppDimensions.normalize(3), decoration: BoxDecoration( - /* color: colors.whiteColor,*/ borderRadius: BorderRadius.circular(12)), + borderRadius: BorderRadius.circular(12)), child: Icon( CupertinoIcons.right_chevron, - // color: colors.blackColor, ), ), renderSkipBtn: Container( @@ -80,7 +79,6 @@ class _LandingScreenState extends State { width: 40, height: 30, decoration: BoxDecoration( - // color: colors.whiteColor, borderRadius: BorderRadius.circular(12)), child: Icon( Icons.skip_next, diff --git a/lib/view/profilescreen/address_screen/address_screen.dart b/lib/view/profilescreen/address_screen/address_screen.dart index b7c954a..8599bfa 100755 --- a/lib/view/profilescreen/address_screen/address_screen.dart +++ b/lib/view/profilescreen/address_screen/address_screen.dart @@ -1,5 +1,5 @@ import 'dart:async'; - +import 'package:beautify/configs/configs.dart'; import 'package:auto_size_text/auto_size_text.dart'; import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:flutter/cupertino.dart'; @@ -40,8 +40,6 @@ class _AddressScreenState extends State { @override Widget build(BuildContext context) { final duplicateController = Get.find(); - // final colors = duplicateController.colors; - //final textStyle = duplicateController.textStyle; return BlocProvider( create: (context) { final bloc = AddressBloc(); @@ -52,8 +50,7 @@ class _AddressScreenState extends State { snackBar( title: "Address", message: "Your address edited successfully", - // textStyle: textStyle, - /* colors: colors*/); + ); } }); return bloc; @@ -74,15 +71,16 @@ class _AddressScreenState extends State { Widget dropDown({required List countryList}) { return DropdownButtonFormField2( buttonStyleData: ButtonStyleData( - width: Get.size.width*.8 , + width: AppDimensions.normalize(120), ), decoration: InputDecoration( - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(15))), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(AppDimensions.normalize(5)) + ) + ), isDense: true, hint: Text( "select country", - // style: textStyle.bodyNormal, ), validator: (value) { if (value == null) { @@ -92,16 +90,16 @@ class _AddressScreenState extends State { } }, dropdownStyleData: DropdownStyleData( - maxHeight: Get.size.height * 0.6, + maxHeight: AppDimensions.normalize(120), decoration: dropDownDecoration()), onChanged: (value) { country = value; }, dropdownSearchData: DropdownSearchData( - searchInnerWidgetHeight: 150, + searchInnerWidgetHeight:AppDimensions.normalize(100), searchController: searchController, searchInnerWidget: Padding( - padding: const EdgeInsets.all(2), + padding: Space.all(.1,.1), child: TextField( controller: searchController, decoration: @@ -114,22 +112,17 @@ class _AddressScreenState extends State { if (state is AddressDefaultScreen) { return DuplicateTemplate( - // colors: colors, - // textStyle: textStyle, title: "My Address", child: Scaffold( floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, floatingActionButton: SizedBox( - height: 60, - width: Get.size.width * 0.5, + height: AppDimensions.normalize(22), + width: AppDimensions.normalize(60), child: FloatingActionButton.extended( - // backgroundColor: colors.primary, onPressed: () { addAddressBottomSheet( scrollPhysics: defaultPhysics, - // textStyle: textStyle, - // colors: colors, osSaveClicked: () { if (adNameKey.currentState!.validate() && addressKey.currentState!.validate() && @@ -148,8 +141,7 @@ class _AddressScreenState extends State { snackBar( title: "Country", message: "Please select your country", - // textStyle: textStyle, - /*colors: colors*/); + ); } } }, @@ -166,13 +158,11 @@ class _AddressScreenState extends State { }, label: AutoSizeText( "Add new address", - // style: textStyle.bodyNormal - // .copyWith(color: colors.whiteColor), maxLines: 2, )), ), body: ListView.builder( - padding: const EdgeInsets.only(bottom: 20), + padding: Space.v, physics: duplicateController.uiDuplicate.defaultScroll, itemCount: state.addressList.length, itemBuilder: (context, index) { @@ -180,39 +170,34 @@ class _AddressScreenState extends State { return Container( decoration: BoxDecoration( - // color: colors.gray, + color: Color(0xffafc282), borderRadius: BorderRadius.circular(12)), - margin: const EdgeInsets.fromLTRB(15, 10, 15, 15), - padding: const EdgeInsets.all(12), + margin: Space.all(.7,.7), + padding:Space.all(.8,.2), child: Row( children: [ SizedBox( - width: 60, - height: 60, + width: AppDimensions.normalize(30), + height: AppDimensions.normalize(30), child: CircleAvatar( - // backgroundColor: colors.whiteColor, child: LottieBuilder.network(locationLottie), ), ), - const SizedBox( - width: 10, - ), + Space.x1!, SizedBox( - width: Get.size.width * 0.6, + width:AppDimensions.normalize(50), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( address.addressName, - // style: textStyle.titleLarge, - ), - const SizedBox( - height: 7, + style: AppText.b1b, ), + Space.y!, AutoSizeText( address.addressDetail, maxLines: 2, - // style: textStyle.bodySmall, + style: AppText.b2b, ), ], ), @@ -223,7 +208,6 @@ class _AddressScreenState extends State { CupertinoButton( child: Icon( CupertinoIcons.delete, - // color: colors.blackColor, ), onPressed: () { showCupertinoDialog( @@ -232,17 +216,14 @@ class _AddressScreenState extends State { return CupertinoAlertDialog( title: Text( "Remove address", - // style: textStyle.titleLarge, ), content: Text( "Are you sure to remove address", - // style: textStyle.bodyNormal, ), actions: [ CupertinoButton( child: Text( "Cancel", - // style: textStyle.bodyNormal, ), onPressed: () { Get.back(); @@ -251,9 +232,6 @@ class _AddressScreenState extends State { CupertinoButton( child: Text( "Yes", - // style: textStyle.bodyNormal - // .copyWith( - // color: colors.red), ), onPressed: () { Get.back(); @@ -279,8 +257,6 @@ class _AddressScreenState extends State { addAddressBottomSheet( scrollPhysics: defaultPhysics, - // textStyle: textStyle, - // colors: colors, osSaveClicked: () { if (adNameKey.currentState! .validate() && @@ -312,8 +288,7 @@ class _AddressScreenState extends State { title: "Country", message: "Please select your country", - // textStyle: textStyle, - /* colors: colors*/); + ); } } }, @@ -328,9 +303,7 @@ class _AddressScreenState extends State { dropDown: dropDown( countryList: state.countryItemList), ); - }, - /* colors: colors, - textStyle: textStyle*/), + },), ], ), ), @@ -351,22 +324,17 @@ class _AddressScreenState extends State { ); } else if (state is AddressEmpty) { return DuplicateTemplate( - /* colors: colors, - textStyle: textStyle,*/ title: "My Address", child: Scaffold( floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, floatingActionButton: SizedBox( - height: 60, - width: Get.size.width * 0.5, + height: AppDimensions.normalize(20), + width:AppDimensions.normalize(65), child: FloatingActionButton.extended( - // backgroundColor: colors.primary, onPressed: () { addAddressBottomSheet( scrollPhysics: defaultPhysics, - /* textStyle: textStyle, - colors: colors,*/ osSaveClicked: () { if (adNameKey.currentState!.validate() && addressKey.currentState!.validate() && @@ -385,8 +353,7 @@ class _AddressScreenState extends State { snackBar( title: "Country", message: "Please select your country", - /* textStyle: textStyle, - colors: colors*/); + ); } } }, @@ -402,28 +369,27 @@ class _AddressScreenState extends State { }, label: AutoSizeText( "Add new address", - // style: textStyle.bodyNormal - // .copyWith(color: colors.whiteColor), maxLines: 2, )), ), - body: Column( - children: [ - LottieBuilder.network( - emptyListLottie, - width: Get.size.width * 0.8, - height: Get.size.height * 0.6, - ), - Padding( - padding: const EdgeInsets.fromLTRB(15, 20, 15, 0), - child: AutoSizeText( + body: Padding( + padding: Space.all(1.5,1.5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + LottieBuilder.network( + emptyListLottie, + width: AppDimensions.normalize(125), + height: AppDimensions.normalize(110), + ), + Space.y1!, + AutoSizeText( "your address list is empty try to add new one", - // style: textStyle.bodyNormal - // .copyWith(fontWeight: FontWeight.bold), + style: AppText.h3b, maxLines: 2, ), - ), - ], + ], + ), ), ), ); diff --git a/lib/view/profilescreen/auth_screen/authentication_screen.dart b/lib/view/profilescreen/auth_screen/authentication_screen.dart index b55b288..d4c27ce 100755 --- a/lib/view/profilescreen/auth_screen/authentication_screen.dart +++ b/lib/view/profilescreen/auth_screen/authentication_screen.dart @@ -2,15 +2,11 @@ import 'dart:async'; import 'package:auto_size_text/auto_size_text.dart'; import 'package:beautify/configs/configs.dart'; -import 'package:beautify/providers/theme_provider.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:get/get.dart'; -import 'package:provider/provider.dart'; - -import '../../../model/controllers/duplicate_controller.dart'; import '../../widgets/customloading_widget.dart'; import '../../widgets/duplicatecontainer_widget.dart'; @@ -46,7 +42,6 @@ class _AuthenticationScreenState extends State { @override Widget build(BuildContext context) { - final themeprovider=Provider.of(context); return BlocProvider( create: (context) { final bloc = AuthenticationBloc(); @@ -75,49 +70,45 @@ class _AuthenticationScreenState extends State { context: context, builder: (context) { return SizedBox( - height: Get.mediaQuery.size.height * 0.6, + height: AppDimensions.normalize(150), child: AlertDialog( contentPadding: EdgeInsets.zero, titlePadding: EdgeInsets.zero, shape: OutlineInputBorder( borderSide: BorderSide.none, - borderRadius: BorderRadius.circular(15)), + borderRadius: BorderRadius.circular(AppDimensions.normalize(5))), title: Container( alignment: Alignment.center, - height: 50, + height: AppDimensions.normalize(15), + margin: Space.v1, decoration: BoxDecoration( - // color: colors.blackColor, - borderRadius: const BorderRadius.vertical( - top: Radius.circular(15))), + borderRadius: BorderRadius.vertical( + top: Radius.circular(AppDimensions.normalize(5)))), child: Text( "Change password", ), ), content: Container( - // color: colors.blackColor, child: duplicateContainer( - // colors: colors, child: Container( - padding: const EdgeInsets.all(15), - width: Get.mediaQuery.size.width * 0.8, - height: Get.mediaQuery.size.height * .45, + // padding: const EdgeInsets.all(15), + width: AppDimensions.normalize(80), + height: AppDimensions.normalize(100), child: Column( children: [ textField( - // textStyle: textStyle, + context: context, controller: userNameController, formKey: userNameKey, lable: "user name", - // colors: colors, - edgeInsetsGeometry: const EdgeInsets.all(5)), + edgeInsetsGeometry: Space.all(.5,.5)), textField( - // textStyle: textStyle, + context: context, controller: passwordController, formKey: passwordKey, lable: "Password", - // colors: colors, - edgeInsetsGeometry: const EdgeInsets.all(5)), + edgeInsetsGeometry: Space.all(.5,.5)), ], ), ), @@ -126,26 +117,22 @@ class _AuthenticationScreenState extends State { actions: [ Container( alignment: Alignment.center, - margin: const EdgeInsets.only(bottom: 20), - child: CupertinoTheme( - data: - CupertinoThemeData(primaryColor: Colors.white), - child: CupertinoButton.filled( - child: Text( - "Save", - // style: textStyle.bodyNormal, - ), - onPressed: () { - if (userNameKey.currentState!.validate() && - passwordKey.currentState!.validate()) { - authenticationBloc!.add( - AuthenticationSaveChanges( - userName: userNameController.text, - password: passwordController.text)); - Navigator.pop(context); - } - }, + margin: Space.v1, + child: CupertinoButton.filled( + + child: Text( + "Save", ), + onPressed: () { + if (userNameKey.currentState!.validate() && + passwordKey.currentState!.validate()) { + authenticationBloc!.add( + AuthenticationSaveChanges( + userName: userNameController.text, + password: passwordController.text)); + Navigator.pop(context); + } + }, ), ) ], @@ -157,14 +144,12 @@ class _AuthenticationScreenState extends State { snackBar( title: "Account", message: "Account not found", - // textStyle: textStyle, - /*colors: colors*/); + ); } else if (state is LoginUnSuccess) { snackBar( title: "Incorrect information", message: "Incorrect username and password entered", - // textStyle: textStyle, - /* colors: colors*/); + ); } }); authenticationBloc = bloc; @@ -177,10 +162,8 @@ class _AuthenticationScreenState extends State { final profileController = state.profileController; - const EdgeInsetsGeometry edgeInsets = EdgeInsets.all(15); + EdgeInsetsGeometry edgeInsets = Space.all(.5,.5); return DuplicateTemplate( - // colors: colors, - // textStyle: textStyle, title: "Login", child: Column( children: [ @@ -190,38 +173,34 @@ class _AuthenticationScreenState extends State { child: Column( children: [ Padding( - padding: const EdgeInsets.only(top: 30, bottom: 20), + padding:Space.all(.5,.5), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ AutoSizeText( "Let's sign you in", - // style: textStyle.titleLarge, + style:AppText.h3b , maxLines: 1, ), - const SizedBox( - height: 5, - ), + Space.y!, AutoSizeText( "welcome back, we've been missed you", - // style: textStyle.bodySmall, + style: AppText.b1b, maxLines: 1, ) ], ), ), - const SizedBox( - height: 20, - ), + Space.y1!, textField( + context: context, edgeInsetsGeometry: edgeInsets, - // colors: colors, - // textStyle: textStyle, controller: userNameController, formKey: userNameKey, lable: "UserName or Email"), Obx( () => textField( + context: context, suffix: CupertinoButton( child: Icon(profileController.obscureText ? CupertinoIcons.eye @@ -235,8 +214,6 @@ class _AuthenticationScreenState extends State { ), obscureText: profileController.obscureText, edgeInsetsGeometry: edgeInsets, - // colors: colors, - // textStyle: textStyle, controller: passwordController, formKey: passwordKey, lable: "Password"), @@ -250,7 +227,6 @@ class _AuthenticationScreenState extends State { children: [ Obx( () => Checkbox( - // activeColor: colors.primary, value: profileController.rememberMeStatus, onChanged: (value) { @@ -264,14 +240,12 @@ class _AuthenticationScreenState extends State { ), Text( "Remember me", - // style: textStyle.bodySmall, ) ], ), CupertinoButton( child: Text( "Forgat password?", - // style: textStyle.bodyNormal, ), onPressed: () { authenticationBloc! @@ -283,24 +257,19 @@ class _AuthenticationScreenState extends State { ), Padding( padding: edgeInsets, - child: CupertinoTheme( - data: CupertinoThemeData( - primaryColor: Colors.white), - child: CupertinoButton.filled( - borderRadius: BorderRadius.circular(20), - child: Text( - "Login", - // style: textStyle.bodyNormal - // .copyWith(color: colors.whiteColor), - ), - onPressed: () async { - authenticationBloc!.add( - AuthenticatioLogin( - userName: userNameController.text, - password: passwordController.text, - isRemember: profileController - .rememberMeStatus)); - })), + child: CupertinoButton.filled( + borderRadius: BorderRadius.circular(AppDimensions.normalize(5)), + child: Text( + "Login", + ), + onPressed: () async { + authenticationBloc!.add( + AuthenticatioLogin( + userName: userNameController.text, + password: passwordController.text, + isRemember: profileController + .rememberMeStatus)); + }), ), ], ), @@ -311,6 +280,7 @@ class _AuthenticationScreenState extends State { children: [ AutoSizeText( "Don't have an account?", + style: AppText.b1b, ), CupertinoButton( child: Text( @@ -359,17 +329,20 @@ class _AuthenticationScreenState extends State { ), Space.y1!, textField( + context: context, edgeInsetsGeometry: edgeInsets, controller: nameController, formKey: nameKey, lable: "Full Name"), textField( + context: context, edgeInsetsGeometry: edgeInsets, controller: userNameController, formKey: userNameKey, lable: "UserName or Email"), Obx( () => textField( + context: context, suffix: CupertinoButton( child: Icon(profileController.obscureText ? CupertinoIcons.eye diff --git a/lib/view/profilescreen/favourites_screen/favorite_screen.dart b/lib/view/profilescreen/favourites_screen/favorite_screen.dart index cb0633f..35be97d 100755 --- a/lib/view/profilescreen/favourites_screen/favorite_screen.dart +++ b/lib/view/profilescreen/favourites_screen/favorite_screen.dart @@ -1,3 +1,4 @@ +import 'package:beautify/configs/configs.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -33,8 +34,6 @@ class _FavoriteScreenState extends State { final profileController = Get.find(); final ProfileFunctions profileFunctions = profileController.profileFunctions; - // final textStyle = duplicateController.textStyle; - //final colors = duplicateController.colors; return BlocProvider( create: (context) { final bloc = FavoriteBloc(); @@ -47,22 +46,17 @@ class _FavoriteScreenState extends State { if (state is FavoriteSuccess) { return DuplicateTemplate( title: "Favorite Screen", - // colors: colors, - //textStyle: textStyle, child: ListView.builder( - padding: const EdgeInsets.only(bottom: 40), + padding: Space.v, physics: duplicateController.uiDuplicate.defaultScroll, itemCount: state.productList.length, itemBuilder: (context, index) { final product = state.productList[index]; return HorizontalProductView( - // colors: colors, product: product, - //textStyle: textStyle, widget: CupertinoButton( child: Icon( Icons.delete, - // color: colors.whiteColor, ), onPressed: () async { bool isDeleted = await profileFunctions @@ -72,15 +66,12 @@ class _FavoriteScreenState extends State { } }, ), - margin: const EdgeInsets.only( - top: 15, right: 8, left: 8, bottom: 15)); + margin: Space.all(.5,.5)); }, ), ); } else if (state is FavoriteEmpty) { return EmptyScreen( - // colors: colors, - // textStyle: textStyle, title: "Favorite Screen", content: "you're favorite list is empty", lottieName: emptyListLottie); diff --git a/lib/view/profilescreen/order_screen/order_detail_screen.dart b/lib/view/profilescreen/order_screen/order_detail_screen.dart index 17a2062..271cfe7 100755 --- a/lib/view/profilescreen/order_screen/order_detail_screen.dart +++ b/lib/view/profilescreen/order_screen/order_detail_screen.dart @@ -1,8 +1,9 @@ +import 'package:beautify/configs/app_dimensions.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:get/get.dart'; - +import 'package:beautify/configs/configs.dart'; import '../../../model/controllers/duplicate_controller.dart'; import '../../../model/tools/jsonparse/product_parse.dart'; import '../../widgets/duplicatetempelate_widget.dart'; @@ -14,57 +15,44 @@ class OrderDetailScreen extends StatelessWidget { @override Widget build(BuildContext context) { final duplicateController = Get.find(); - // final colors = duplicateController.colors; - // final textStyle = duplicateController.textStyle; - return DuplicateTemplate( - // colors: colors, - //textStyle: textStyle, title: "Order detail", child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Container( - height: Get.height * 0.8, + height:AppDimensions.normalize(250), margin: - const EdgeInsets.only(top: 12, right: 15, bottom: 12, left: 15), - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - /* color: colors.gray,*/ borderRadius: BorderRadius.circular(15)), + Space.all(1.5,1.5), child: AlignedGridView.count( physics: duplicateController.uiDuplicate.defaultScroll, crossAxisCount: 2, - mainAxisSpacing: 5, - crossAxisSpacing: 10, + mainAxisSpacing: AppDimensions.normalize(2), + crossAxisSpacing: AppDimensions.normalize(2), itemCount: productList.length, itemBuilder: (context, index) { final product = productList[index]; return Container( - height: 250, - decoration: BoxDecoration( - // color: colors.whiteColor, - borderRadius: BorderRadius.circular(15)), + height: AppDimensions.normalize(90), child: Column( children: [ Container( - margin: const EdgeInsets.only(top: 10, bottom: 10), - width: 130, + margin: Space.v, + width: AppDimensions.normalize(47), child: networkImage(imageUrl: product.imageUrl)), Column( children: [ Text( product.name, - // style: textStyle.bodyNormal, + style: AppText.b1b, maxLines: 1, overflow: TextOverflow.clip, textAlign: TextAlign.center, ), - const SizedBox( - height: 10, - ), + Space.y!, Text( "€${product.price}", - // style: textStyle.bodyNormal, + style: AppText.h3b, ), ], ), diff --git a/lib/view/profilescreen/order_screen/order_screen.dart b/lib/view/profilescreen/order_screen/order_screen.dart index d46321e..7f85fb8 100755 --- a/lib/view/profilescreen/order_screen/order_screen.dart +++ b/lib/view/profilescreen/order_screen/order_screen.dart @@ -1,3 +1,4 @@ +import 'package:beautify/configs/configs.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -38,11 +39,8 @@ class _OrderScreenState extends State { builder: (context, state) { if (state is OrderInitialScreen) { final duplicateController = state.duplicateController; - // final colors = duplicateController.colors; - // final textStyle = duplicateController.textStyle; + return DuplicateTemplate( - // colors: colors, - // textStyle: textStyle, title: "Order history", child: ListView.builder( physics: duplicateController.uiDuplicate.defaultScroll, @@ -50,50 +48,43 @@ class _OrderScreenState extends State { itemBuilder: (context, index) { final order = state.orderHistoryList[index]; return Container( - margin: const EdgeInsets.fromLTRB(15, 10, 15, 10), - padding: const EdgeInsets.all(12), + margin:Space.all(.8,.8), + padding: Space.all(1,1.1), decoration: BoxDecoration( - // color: colors.gray, - borderRadius: BorderRadius.circular(15), + color: Color(0xffc9c88f), + borderRadius: BorderRadius.circular(AppDimensions.normalize(7)), ), child: Column( children: [ - Padding( - padding: const EdgeInsets.only( - top: 10, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "Order : ${order.productList[0].id}", - // style: textStyle.bodyNormal, - ), - CupertinoButton( - child: Text( - "View detail", - // style: textStyle.bodyNormal - // .copyWith(color: colors.primary), - ), - onPressed: () { - Get.to(OrderDetailScreen( - productList: order.productList)); - }, - ) - ], - ), - ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Order : ${order.productList[0].id}", + style:AppText.b1b, + ), + CupertinoButton( + child: Text( + "View detail", + style: AppText.h3b, + ), + onPressed: () { + Get.to(OrderDetailScreen( + productList: order.productList)); + }, + ) + ], + ), orderHistoryItem( rightTitle: order.time.toString().substring(0, 16), leftTitle: "Date :", - leftStyle: TextStyle(), - rightStyle: TextStyle()), - // .copyWith(color: colors.captionColor)), + leftStyle: AppText.b2!, + rightStyle: AppText.b2b!,), orderHistoryItem( rightTitle: order.totalPrice, leftTitle: "Amount :", - leftStyle: TextStyle(), - rightStyle: TextStyle() + leftStyle: AppText.b2!, + rightStyle: AppText.b2b!, // .copyWith(color: colors.captionColor) ), ], @@ -103,10 +94,7 @@ class _OrderScreenState extends State { ), ); } else if (state is OrderEmpty) { - final duplicateController = state.duplicateController; return EmptyScreen( - // colors: duplicateController.colors, - // textStyle: duplicateController.textStyle, title: "Order history", content: "Your order history is empty", lottieName: emptyListLottie); @@ -124,21 +112,18 @@ class _OrderScreenState extends State { required String leftTitle, required TextStyle leftStyle, required TextStyle rightStyle}) { - return Padding( - padding: const EdgeInsets.only(left: 5, right: 5, top: 10, bottom: 10), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - leftTitle, - style: leftStyle, - ), - Text( - rightTitle, - style: rightStyle, - ) - ], - ), + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + leftTitle, + style: leftStyle, + ), + Text( + rightTitle, + style: rightStyle, + ) + ], ); } } diff --git a/lib/view/profilescreen/profile_screen.dart b/lib/view/profilescreen/profile_screen.dart index c526fca..dd8d00a 100755 --- a/lib/view/profilescreen/profile_screen.dart +++ b/lib/view/profilescreen/profile_screen.dart @@ -1,11 +1,12 @@ import 'dart:io'; -import 'package:badges/badges.dart'as badges; +import 'package:badges/badges.dart' as badges; import 'package:badges/badges.dart'; +import 'package:beautify/providers/theme_provider.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; -import '../../model/controllers/duplicate_controller.dart'; +import 'package:provider/provider.dart'; import '../../model/controllers/profile_controller.dart'; import '../../viewmodel/profile/profile.dart'; import '../widgets/duplicatetempelate_widget.dart'; @@ -14,29 +15,25 @@ import 'address_screen/address_screen.dart'; import 'auth_screen/authentication_screen.dart'; import 'favourites_screen/favorite_screen.dart'; import 'order_screen/order_screen.dart'; +import 'package:beautify/configs/configs.dart'; class ProfileScreen extends StatelessWidget { const ProfileScreen({super.key}); @override Widget build(BuildContext context) { - final duplicateController = Get.find(); + final themeprovider = Provider.of(context); final profileController = Get.find(); final ProfileFunctions profileFunctions = profileController.profileFunctions; - // final colors = duplicateController.colors; - //final textStyle = duplicateController.textStyle; return DuplicateTemplate( - // colors: colors, - //textStyle: textStyle, title: "Profile", child: Padding( - padding: const EdgeInsets.only(top: 20, right: 15, left: 15), + padding: Space.all(.8, .8), child: Column( children: [ badges.Badge( position: BadgePosition.bottomEnd(), - // badgeColor: colors.primary, badgeContent: SizedBox( width: 30, height: 30, @@ -49,7 +46,6 @@ class ProfileScreen extends StatelessWidget { }, child: Icon( CupertinoIcons.switch_camera, - // color: colors.whiteColor, size: 20, ), ), @@ -58,125 +54,112 @@ class ProfileScreen extends StatelessWidget { height: 100, width: 100, decoration: BoxDecoration( - /* color: colors.blackColor,*/ shape: BoxShape.circle), - child: profileImage(/*colors: colors*/), + color: themeprovider.isDark + ? Color(0xFC8F6E81) + : Color(0xffd06dae), + shape: BoxShape.circle), + child: profileImage(), ), ), Padding( - padding: const EdgeInsets.only(top: 30, bottom: 20), + padding: Space.all(1, 1.5), child: Column( children: [ - profileName( - // textStyle: textStyle, - profileController: profileController), - /*const SizedBox( - height: 10, - ),*/ - profileEmail( - // textStyle: textStyle, - profileController: profileController) + profileName(profileController: profileController), + Space.y!, + profileEmail(profileController: profileController) ], ), ), profileItem( - callback: () { - Get.to(const FavoriteScreen()); - }, - itemName: "Favourits", - // textStyle: textStyle, - /* colors: colors*/), + callback: () { + Get.to(const FavoriteScreen()); + }, + itemName: "Favourits", + ), profileItem( - callback: () { - bool isLogin = profileController.islogin; - if (isLogin) { - Get.to(const AddressScreen()); - } else { - loginRequiredDialog(/*textStyle: textStyle*/); - } - }, - itemName: "My Address", - // textStyle: textStyle, - /* colors: colors*/), + callback: () { + bool isLogin = profileController.islogin; + if (isLogin) { + Get.to(const AddressScreen()); + } else { + loginRequiredDialog(); + } + }, + itemName: "My Address", + ), profileItem( + callback: () { + bool isLogin = profileController.islogin; + if (isLogin) { + Get.to(const OrderScreen()); + } else { + loginRequiredDialog(); + } + }, + itemName: "Order History", + ), + Obx( + () => profileItem( callback: () { - bool isLogin = profileController.islogin; + final isLogin = + profileController.authenticationFunctions.isUserLogin(); if (isLogin) { - Get.to(const OrderScreen()); + showCupertinoDialog( + context: context, + builder: (context) { + return CupertinoAlertDialog( + title: Text( + "Log Out", + ), + content: Text( + "Are you sure you want log out?", + overflow: TextOverflow.clip, + textAlign: TextAlign.start, + ), + actions: [ + CupertinoButton( + child: Text( + "No", + ), + onPressed: () async { + Get.back(); + }, + ), + CupertinoButton( + child: Text( + "yes", + ), + onPressed: () async { + await profileController + .authenticationFunctions + .signOut(); + Get.back(); + }, + ), + ], + ); + }, + ); } else { - loginRequiredDialog(/*textStyle: textStyle*/); + Get.to(const AuthenticationScreen()); } }, - itemName: "Order History", - // textStyle: textStyle, - /* colors: colors*/), - Obx( - () => profileItem( - callback: () { - final isLogin = profileController.authenticationFunctions - .isUserLogin(); - if (isLogin) { - showCupertinoDialog( - context: context, - builder: (context) { - return CupertinoAlertDialog( - title: Text( - "Log Out", - // style: textStyle.titleLarge - // .copyWith(color: colors.red), - ), - content: Text( - "Are you sure you want log out?", - // style: textStyle.bodyNormal, - overflow: TextOverflow.clip, - textAlign: TextAlign.start, - ), - actions: [ - CupertinoButton( - child: - Text("No", /*style: textStyle.bodyNormal*/), - onPressed: () async { - Get.back(); - }, - ), - CupertinoButton( - child: Text( - "yes", - // style: textStyle.bodyNormal - // .copyWith(color: colors.red), - ), - onPressed: () async { - await profileController - .authenticationFunctions - .signOut(); - Get.back(); - }, - ), - ], - ); - }, - ); - } else { - Get.to(const AuthenticationScreen()); - } - }, - itemName: signStatus(profileController: profileController), - // textStyle: textStyle, - /* colors: colors*/), + itemName: signStatus(profileController: profileController), + ), ), ], ), )); } - Widget profileImage(/*{ - //required CustomColors colors, - }*/) { + Widget profileImage() { return GetX( builder: (controller) { if (controller.userSetImage) { final File file = controller.profileFunctions.imageFile()!; return ClipRRect( - borderRadius: BorderRadius.circular(49), + borderRadius: BorderRadius.circular(AppDimensions.normalize(50)), child: Image.file( file, fit: BoxFit.cover, @@ -185,7 +168,6 @@ class ProfileScreen extends StatelessWidget { } else { return Icon( CupertinoIcons.person_alt_circle, - // color: colors.whiteColor, size: 40, ); } @@ -193,37 +175,33 @@ class ProfileScreen extends StatelessWidget { ); } - Widget profileName( - {/*required CustomTextStyle textStyle,*/ - required ProfileController profileController}) { + Widget profileName({required ProfileController profileController}) { return Obx(() { if (profileController.islogin) { return Text( profileController.information.name, - // style: textStyle.titleLarge, + style: AppText.h3b, ); } else { return Text( "Mohamed Ali", - // style: textStyle.titleLarge, + style: AppText.h3b, ); } }); } - Widget profileEmail( - {/*required CustomTextStyle textStyle,*/ - required ProfileController profileController}) { + Widget profileEmail({required ProfileController profileController}) { return Obx(() { if (profileController.islogin) { return Text( profileController.information.userName, - // style: textStyle.bodyNormal, + style: AppText.b1b, ); } else { return Text( "mo7amedaliebaid@gmail.com", - // style: textStyle.bodyNormal, + style: AppText.b1b, ); } }); @@ -231,39 +209,33 @@ class ProfileScreen extends StatelessWidget { Widget profileItem( {required String itemName, - // required CustomTextStyle textStyle, - //required CustomColors colors, required GestureTapCallback callback}) { return Padding( - padding: const EdgeInsets.only(top: 5, bottom: 5), + padding: Space.all(.3,.2), child: Column( children: [ Container( - padding: const EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - ), + padding: Space.h, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( itemName, - // style: textStyle.bodyNormal.copyWith(fontSize: 25), + style: AppText.b1b, ), CupertinoButton( onPressed: callback, child: Icon( CupertinoIcons.right_chevron, - // color: colors.blackColor, ), ) ], ), ), Container( - height: 2, + height: 1, width: Get.mediaQuery.size.width, - // color: colors.captionColor, + color: Colors.red, ) ], ), diff --git a/lib/view/rootscreen/root.dart b/lib/view/rootscreen/root.dart index 89c7d43..6588757 100755 --- a/lib/view/rootscreen/root.dart +++ b/lib/view/rootscreen/root.dart @@ -20,9 +20,6 @@ class RootScreen extends StatefulWidget { class _RootScreenState extends State with WidgetsBindingObserver { final duplicateController = Get.find(); final initialController = Get.find(); - - // late CustomColors colors = duplicateController.colors; - //late CustomTextStyle textStyle = duplicateController.textStyle; late int slectedIndex = widget.index; late PageController pageController = PageController(initialPage: slectedIndex, keepPage: true); @@ -69,35 +66,26 @@ class _RootScreenState extends State with WidgetsBindingObserver { selectedIndex: slectedIndex, items: [ BottomNavyBarItem( - // activeColor: colors.primary, textAlign: TextAlign.center, - // inactiveColor: colors.blackColor, icon: const Icon( CupertinoIcons.home, ), title: Text( "Home", - // style: textStyle.bodyNormal.copyWith(color: colors.primary), )), BottomNavyBarItem( - // activeColor: colors.primary, textAlign: TextAlign.center, - // inactiveColor: colors.blackColor, icon: const Icon( CupertinoIcons.cart, ), title: Text( "Cart", - // style: textStyle.bodyNormal.copyWith(color: colors.primary), )), BottomNavyBarItem( - // activeColor: colors.primary, - // inactiveColor: colors.blackColor, textAlign: TextAlign.center, icon: const Icon(CupertinoIcons.person_alt_circle), title: Text( "Profile", - // style: textStyle.bodyNormal.copyWith(color: colors.primary), )), ], onItemSelected: (value) { diff --git a/lib/view/widgets/adreebottomsheet_widget.dart b/lib/view/widgets/adreebottomsheet_widget.dart index 5ed8436..e077bc0 100755 --- a/lib/view/widgets/adreebottomsheet_widget.dart +++ b/lib/view/widgets/adreebottomsheet_widget.dart @@ -24,7 +24,7 @@ void addAddressBottomSheet( context: Get.context!, builder: (context) { return Container( - height: AppDimensions.normalize(190), + height: AppDimensions.normalize(250), child: Scaffold( floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, @@ -52,7 +52,7 @@ void addAddressBottomSheet( }, ), SizedBox( - height: Get.size.height * 0.6, + height: AppDimensions.normalize(170), child: SingleChildScrollView( physics: scrollPhysics, child: Column( @@ -60,24 +60,28 @@ void addAddressBottomSheet( children: [ dropDown, textField( + context: context, inputType: TextInputType.streetAddress, controller: stateController, formKey: stateKey, lable: "State", edgeInsetsGeometry: Space.all(1,.2)), textField( + context: context, inputType: TextInputType.streetAddress, controller: addressController, formKey: addressKey, lable: "Address detail", edgeInsetsGeometry: Space.all(1,.2)), textField( + context: context, inputType: TextInputType.streetAddress, controller: adNameController, formKey: adNameKey, lable: "Address name", edgeInsetsGeometry: Space.all(1,.2)), textField( + context: context, controller: postalController, formKey: postalKey, lable: "Postal code", diff --git a/lib/view/widgets/cartbadge_widget.dart b/lib/view/widgets/cartbadge_widget.dart index 8e382e2..dd53026 100755 --- a/lib/view/widgets/cartbadge_widget.dart +++ b/lib/view/widgets/cartbadge_widget.dart @@ -1,10 +1,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:badges/badges.dart'as badges; -import 'package:provider/provider.dart'; import 'package:beautify/configs/configs.dart'; import '../../model/controllers/duplicate_controller.dart'; -import '../../providers/theme_provider.dart'; class CartLengthBadge extends StatelessWidget { const CartLengthBadge({ Key? key, @@ -16,7 +14,6 @@ class CartLengthBadge extends StatelessWidget { final GestureTapCallback badgeCallback; @override Widget build(BuildContext context) { - final themeProvider=Provider.of(context); return ValueListenableBuilder( valueListenable: duplicateController.cartBoxListenable, builder: (context, value, child) { diff --git a/lib/view/widgets/cartitem_widget.dart b/lib/view/widgets/cartitem_widget.dart index 13c9379..1016e5d 100755 --- a/lib/view/widgets/cartitem_widget.dart +++ b/lib/view/widgets/cartitem_widget.dart @@ -36,12 +36,10 @@ class CartBottomItem extends StatelessWidget { widget != null ? widget! : Container(), Expanded( child: SizedBox( - height: 50, + height: AppDimensions.normalize(15), child: ClipRRect( - borderRadius: BorderRadius.circular(20), + borderRadius: BorderRadius.circular(AppDimensions.normalize(4)), child: ElevatedButton( - style: ButtonStyle( - ), onPressed: callback, child: Text( navigateName, diff --git a/lib/view/widgets/customloading_widget.dart b/lib/view/widgets/customloading_widget.dart index a5969a6..70412ef 100755 --- a/lib/view/widgets/customloading_widget.dart +++ b/lib/view/widgets/customloading_widget.dart @@ -6,7 +6,6 @@ class CustomLoading extends StatelessWidget { @override Widget build(BuildContext context) { - // final CustomColors colors = CustomColors(); return Scaffold( body: Center( child: LoadingAnimationWidget.staggeredDotsWave( diff --git a/lib/view/widgets/dropdowndecoration_widget.dart b/lib/view/widgets/dropdowndecoration_widget.dart index 28b54f0..d0286d9 100755 --- a/lib/view/widgets/dropdowndecoration_widget.dart +++ b/lib/view/widgets/dropdowndecoration_widget.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:beautify/configs/configs.dart'; BoxDecoration dropDownDecoration() { - return BoxDecoration(borderRadius: BorderRadius.circular(15)); + return BoxDecoration(borderRadius: BorderRadius.circular(AppDimensions.normalize(3))); } diff --git a/lib/view/widgets/duplicatecontainer_widget.dart b/lib/view/widgets/duplicatecontainer_widget.dart index f85c50d..dd9e88c 100755 --- a/lib/view/widgets/duplicatecontainer_widget.dart +++ b/lib/view/widgets/duplicatecontainer_widget.dart @@ -1,15 +1,15 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:get/get_core/src/get_main.dart'; - +import 'package:beautify/configs/configs.dart'; Widget duplicateContainer( - {/*required CustomColors colors,*/ required Widget child}) { + {required Widget child}) { return Container( width: Get.mediaQuery.size.width, - margin: const EdgeInsets.only(top: 10), + margin: EdgeInsets.only(top: AppDimensions.normalize(2)), decoration: BoxDecoration( - borderRadius: const BorderRadius.vertical(top: Radius.circular(15)), - /* color: colors.whiteColor*/), + borderRadius: BorderRadius.vertical(top: Radius.circular(AppDimensions.normalize(5))), + ), child: child, ); } \ No newline at end of file diff --git a/lib/view/widgets/duplicatetempelate_widget.dart b/lib/view/widgets/duplicatetempelate_widget.dart index 9825e90..e747578 100755 --- a/lib/view/widgets/duplicatetempelate_widget.dart +++ b/lib/view/widgets/duplicatetempelate_widget.dart @@ -4,31 +4,23 @@ import 'duplicatecontainer_widget.dart'; class DuplicateTemplate extends StatelessWidget { const DuplicateTemplate({ Key? key, - // required this.colors, - //required this.textStyle, required this.child, required this.title, }) : super(key: key); - // final CustomColors colors; - //final CustomTextStyle textStyle; final Widget child; final String title; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - // foregroundColor: colors.whiteColor, - //backgroundColor: colors.blackColor, centerTitle: true, title: Text( title, - // style: textStyle.titleLarge.copyWith(color: colors.whiteColor), ), ), body: Container( - // color: colors.blackColor, - child: duplicateContainer(/*colors: colors,*/ child: child), + child: duplicateContainer(child: child), ), ); } diff --git a/lib/view/widgets/editadressbutton_widget.dart b/lib/view/widgets/editadressbutton_widget.dart index b58650f..7b4854c 100755 --- a/lib/view/widgets/editadressbutton_widget.dart +++ b/lib/view/widgets/editadressbutton_widget.dart @@ -1,18 +1,13 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - - - -Widget addressEditButton( - {required GestureTapCallback callback, - // required CustomColors colors, -/* required CustomTextStyle textStyle*/}) { +Widget addressEditButton({ + required GestureTapCallback callback, +}) { return CupertinoButton( onPressed: callback, child: Icon( CupertinoIcons.pencil, - // color: colors.blackColor, size: 24, )); -} \ No newline at end of file +} diff --git a/lib/view/widgets/exception_widget.dart b/lib/view/widgets/exception_widget.dart index 257b69f..789d77b 100755 --- a/lib/view/widgets/exception_widget.dart +++ b/lib/view/widgets/exception_widget.dart @@ -1,3 +1,4 @@ +import 'package:beautify/configs/configs.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:get/get_core/src/get_main.dart'; @@ -12,8 +13,6 @@ class AppException extends StatelessWidget { @override Widget build(BuildContext context) { - final controller = Get.find(); - // final textStyle = controller.textStyle; return Scaffold( body: Center( child: Column( @@ -22,20 +21,15 @@ class AppException extends StatelessWidget { errorMessage == null ? Text( "Undefined Error", - // style: textStyle.titleLarge, ) : Text( errorMessage!, - // style: textStyle.titleLarge, - ), - const SizedBox( - height: 10, ), + Space.y!, ElevatedButton( onPressed: callback, child: Text( "try Again", - // style: textStyle.bodyNormal, )) ], ), diff --git a/lib/view/widgets/imageloading_widget.dart b/lib/view/widgets/imageloading_widget.dart index 3e9cbc0..66108bc 100755 --- a/lib/view/widgets/imageloading_widget.dart +++ b/lib/view/widgets/imageloading_widget.dart @@ -6,8 +6,6 @@ import 'package:loading_animation_widget/loading_animation_widget.dart'; import '../../model/controllers/duplicate_controller.dart'; Widget imageLoading() { - final controller = Get.find(); - // final colors = controller.colors; return LoadingAnimationWidget.halfTriangleDot( color: Colors.white, size: 20); } diff --git a/lib/view/widgets/snackbar_widget.dart b/lib/view/widgets/snackbar_widget.dart index 46d27dd..edd545b 100755 --- a/lib/view/widgets/snackbar_widget.dart +++ b/lib/view/widgets/snackbar_widget.dart @@ -7,14 +7,11 @@ import 'package:get/get_core/src/get_main.dart'; void snackBar( {required String title, - required String message, - // required CustomTextStyle textStyle, -/* required CustomColors colors*/}) { + required String message,}) { Get.snackbar(title, "", messageText: AutoSizeText( message, - // style: textStyle.bodyNormal, maxLines: 1, ), - /* backgroundColor: colors.gray*/); + ); } \ No newline at end of file diff --git a/lib/view/widgets/textfield_widget.dart b/lib/view/widgets/textfield_widget.dart index 06ceb1d..20f1703 100755 --- a/lib/view/widgets/textfield_widget.dart +++ b/lib/view/widgets/textfield_widget.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; Widget textField( { + required BuildContext context, required TextEditingController controller, required GlobalKey formKey, required String lable, @@ -15,6 +16,7 @@ Widget textField( child: Form( key: formKey, child: TextFormField( + onTapOutside: (event)=>FocusScope.of(context).unfocus(), obscureText: obscureText, keyboardType: inputType, validator: (value) {