feat: app text form field done
This commit is contained in:
3
assets/icons/Vector (8).svg
Normal file
3
assets/icons/Vector (8).svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M18 16.25L14.3335 12.5833C15.2502 11.25 15.8333 9.6667 15.8333 7.9167C15.8333 3.58336 12.25 0 7.91665 0C3.58334 0 0 3.58336 0 7.9167C0 12.25 3.58334 15.8334 7.91665 15.8334C9.66665 15.8334 11.2501 15.25 12.5835 14.3333L16.25 18L18 16.25ZM2.5 8C2.5 5.00001 4.91667 2.58334 7.91665 2.58334C10.9166 2.58334 13.3333 5.00001 13.3333 8C13.3333 11 10.9166 13.4167 7.91665 13.4167C4.91667 13.4167 2.5 11 2.5 8Z" fill="black"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 531 B |
@@ -9,11 +9,6 @@ class WBasketBody extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return BlocBuilder<BasketBloc, BasketState>(
|
return BlocBuilder<BasketBloc, BasketState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
log("qweqweqweqwe:${state.orders}");
|
|
||||||
log("qweqweqweqwe:${state.orders.isEmpty}");
|
|
||||||
log("qweqweqweqwe:${state.orders.isNotEmpty}");
|
|
||||||
|
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
WBasketHeader(),
|
WBasketHeader(),
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
export 'presentation/pages/browse_page/browse_page.dart';
|
export 'presentation/pages/browse_page/browse_page.dart';
|
||||||
|
export 'package:food_delivery_client/feature/browse/presentation/pages/browse_page/widgets/w_browse_body.dart';
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
import '../../../../../food_delivery_client.dart';
|
import '../../../../../food_delivery_client.dart';
|
||||||
|
|
||||||
class BrowsePage extends StatelessWidget {
|
class BrowsePage extends StatelessWidget {
|
||||||
@@ -6,7 +7,7 @@ class BrowsePage extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return WLayout(
|
return WLayout(
|
||||||
child: Scaffold(body: Center(child: Text(context.loc.mobileNumber))),
|
child: Scaffold(body:WBrowseBody() ),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import 'package:food_delivery_client/feature/common/presentation/widgets/app_text_form_field.dart';
|
||||||
|
|
||||||
|
import '../../../../../../food_delivery_client.dart';
|
||||||
|
|
||||||
|
class WBrowseBody extends StatelessWidget {
|
||||||
|
const WBrowseBody({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
6.verticalSpace,
|
||||||
|
AppTextFormField(
|
||||||
|
controller: TextEditingController(),
|
||||||
|
prefixIcon: SvgPicture.asset(
|
||||||
|
AppIcons.icSearch,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
).paddingSymmetric(horizontal: 16);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
import '../../../../food_delivery_client.dart';
|
||||||
|
|
||||||
|
class AppTextFormField extends StatelessWidget {
|
||||||
|
AppTextFormField({
|
||||||
|
super.key,
|
||||||
|
this.maxLines,
|
||||||
|
this.minLines,
|
||||||
|
this.textStyle,
|
||||||
|
this.onTap,
|
||||||
|
this.textAlign,
|
||||||
|
this.onChanged,
|
||||||
|
this.inputFormatters,
|
||||||
|
this.keyBoardType,
|
||||||
|
this.fillColor,
|
||||||
|
this.hintText,
|
||||||
|
this.hintTextStyle,
|
||||||
|
this.obscureText = false,
|
||||||
|
required this.controller,
|
||||||
|
this.prefixIcon,
|
||||||
|
this.prefixSvgPath,
|
||||||
|
});
|
||||||
|
|
||||||
|
final int? maxLines;
|
||||||
|
final int? minLines;
|
||||||
|
final TextStyle? textStyle;
|
||||||
|
final VoidCallback? onTap;
|
||||||
|
final TextAlign? textAlign;
|
||||||
|
final TextEditingController controller;
|
||||||
|
final Function(String? value)? onChanged;
|
||||||
|
final List<TextInputFormatter>? inputFormatters;
|
||||||
|
final TextInputType? keyBoardType;
|
||||||
|
FormFieldValidator<String>? validator;
|
||||||
|
final bool obscureText;
|
||||||
|
final Color? fillColor;
|
||||||
|
final String? hintText;
|
||||||
|
final TextStyle? hintTextStyle;
|
||||||
|
late final Widget? prefixIcon;
|
||||||
|
final String? prefixSvgPath;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return TextFormField(
|
||||||
|
enabled: true,
|
||||||
|
autofocus: true,
|
||||||
|
maxLines: maxLines ?? 1,
|
||||||
|
minLines: minLines ?? 1,
|
||||||
|
onChanged: onChanged,
|
||||||
|
inputFormatters: inputFormatters,
|
||||||
|
keyboardType: keyBoardType,
|
||||||
|
style: textStyle ?? AppTextStyles.size16Regular,
|
||||||
|
onTap: onTap,
|
||||||
|
textAlign: textAlign ?? TextAlign.start,
|
||||||
|
controller: controller,
|
||||||
|
validator: validator,
|
||||||
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
enabled: true,
|
||||||
|
filled: true,
|
||||||
|
fillColor: fillColor ?? AppColors.cEEEEEE,
|
||||||
|
hintText: hintText,
|
||||||
|
hintStyle: hintTextStyle,
|
||||||
|
prefixIconConstraints: BoxConstraints(
|
||||||
|
minHeight: 0,
|
||||||
|
maxHeight: 24,
|
||||||
|
maxWidth: 34,
|
||||||
|
minWidth: 0,
|
||||||
|
),
|
||||||
|
prefixIcon: prefixIcon?.paddingOnly(left: 10).paddingAll(3),
|
||||||
|
contentPadding: EdgeInsets.symmetric(vertical: 12, horizontal: 12),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: AppUtils.kBorderRadius40,
|
||||||
|
borderSide: BorderSide.none,
|
||||||
|
),
|
||||||
|
errorBorder: OutlineInputBorder(
|
||||||
|
borderRadius: AppUtils.kBorderRadius40,
|
||||||
|
borderSide: BorderSide.none,
|
||||||
|
),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderRadius: AppUtils.kBorderRadius40,
|
||||||
|
borderSide: BorderSide.none,
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderRadius: AppUtils.kBorderRadius40,
|
||||||
|
borderSide: BorderSide.none,
|
||||||
|
),
|
||||||
|
disabledBorder: OutlineInputBorder(
|
||||||
|
borderRadius: AppUtils.kBorderRadius40,
|
||||||
|
borderSide: BorderSide.none,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user