mwidgets 0.0.1 mwidgets: ^0.0.1 copied to clipboard
Contains a custom widgets like MText, MDropdown, MFileImage, MNetworkImage, MLottie, MSvg, MBouncingButton, MRating, MPinPut, MScroll, MTextFiled, MRangeItemWidget, MRadioItemWidget and others
MWidget description #
Contains a custom widgets like MText, MDropdown, MFileImage, MNetworkImage, MLottie, MSvg, MBouncingButton, MRating, MPinPut, MScroll, MTextFiled, MRangeItemWidget, MRadioItemWidget and others
Examples #
MText #
MText(
text: category.name,
size: FoontSize.font16,
weight: FontWeight.w500,
)
MNetworkImage #
MNetworkImage(
url: category.image,
height: 45.0,
width: 45.0,
fit: BoxFit.cover,
),
showMBottomSheet #
showReviewsBottomSheet({
required BuildContext context,
required String productId,
}) {
showMBottomSheet(
context: context,
noScrolling: true,
bottomSheet: ReviewsBottomSheet(productId: productId),
);
}
MScroll #
return MScroll(
axis: Axis.horizontal,
child: Row(
children: cubit.products.map((item) {
return ProductItemWidget(
product: item,
);
}).toList(),
),
);
MSvg #
const MSvg(
name: Svgs.arrowBack,
height: 32.0,
)
.addAction() #
MSvg(
height: 26.0,
name: Svgs.saved ,
color: Coolors.grey,
).addAction(
onGesture: () {
},
);
MText #
MText(
text: product.name,
size: FoontSize.font18,
weight: FontWeight.w500,
).addPadding(vertical: 12.0),
MDividerItemWidget #
const MDividerItemWidget(),
MAnimatedButton #
MAnimatedButton(
onTap: () async {
await cubit.addToCart(productId: product.id);
},
title: context.tr.addToCart,
success: Row(
children: [
const MSvg(
name: Svgs.cartDone,
height: 28.0,
color: Coolors.greenAccent,
).addPadding(end: 12.0),
MText(
text: context.tr.done,
size: FoontSize.font18,
color: Coolors.greenAccent,
)
],
),
);
context.push() #
RecentSearchItemWidget(
product: item,
onTap: () {
context.push(
ProductDetailsScreen(
product: item,
),
);
},
);
MPadding.set() #
const Padding(
padding: MPadding.set(horizontal: 21.0),
child: MSvg(name: Svgs.date),
),
MPinput #
MPinput(
mKey: const Key('pinPut'),
length: 6,
onChanged: verifyCubit.setCode,
keyboardType: TextInputType.number,
).addPadding(bottom: 24.0),
MRatingItem #
MRatingItem(
rating: 4.5,
oneStar: true,
onRatingUpdate: (value) {},
).addPadding(start: 8.0)
showMCupertinoDialog #
showCheckMailDialog({required BuildContext context}) {
showMCupertinoDialog(
context: context,
child: const CheckMailDialog(),
);
}
FToast #
FToast.showError(context: context, message: message);
FToast.showSuccess(context: context, message: message);
MPasswordWidget, MTextFiled, and Validates #
MPasswordWidget(
child: (icon, hide) {
kPrint(hide);
return MTextFiled(
controller: cubit.password,
obscureText: hide,
paddingVertical: 8.0,
suffix: icon,
hintText: context.tr.password,
border: OutlineInputBorder(
borderSide: BorderSide(color: Coolors.highLight),
borderRadius: BorderRadius.circular(5.0),
),
validator: (valid) {
return Validates.isPassword(
password: cubit.password.text,
errorMessage: context.tr.passwordIsShort,
);
},
);
},
).addPadding(bottom: 12.0),
MDropDown #
MDropDown<CategoryModel>(
inFill: false,
options: cubit.categories,
setInitial: cubit.category,
title: context.tr.chooseCategory,
hint: context.tr.chooseCategory,
itemTitle: (item) => item.name,
onChanged: cubit.setCategory,
).addPadding(bottom: 20.0),
MBorderRadius #
borderRadius: MBorderRadius.set(all: 8.0),
License
This library is distributed under Apache 2.0 license for more info see LICENSE DETAILS