feat: app text form field done
This commit is contained in:
@@ -9,11 +9,6 @@ class WBasketBody extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<BasketBloc, BasketState>(
|
||||
builder: (context, state) {
|
||||
log("qweqweqweqwe:${state.orders}");
|
||||
log("qweqweqweqwe:${state.orders.isEmpty}");
|
||||
log("qweqweqweqwe:${state.orders.isNotEmpty}");
|
||||
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
WBasketHeader(),
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
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';
|
||||
|
||||
class BrowsePage extends StatelessWidget {
|
||||
@@ -6,7 +7,7 @@ class BrowsePage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
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