tw
A new Flutter project.
Tailwind-like Container and Text Widgets
This project includes custom Flutter widgets FContainer and FText that mimic Tailwind CSS styling.
Features
- Margin:
mx,my,mt,mr,mb,ml - Padding:
px,py,pt,pr,pb,pl - Font size:
fs-{fontSizeValue} - Radius:
rd-{radiusValue} - Shadow:
shadow-{shadowValue} - Border
- Background color:
bg-{color}-{value} - Text color:
text-{color}-{value} - Width:
w-{widthValue} - Height:
h-{heightValue} - Spacing:
gap-{value},gap-x-{value},gap-y-{value} - Text alignment:
text-left,text-center,text-right - Animation:
animate-none,animate-spin,animate-ping,animate-pulse,animate-bounce - Positioning:
left-{value},right-{value},top-{value},bottom-{value} - Layouts:
row,wrap,stack,schild,list,grid - Shrink Wrap:
shrinkWrap - Axis:
axis-x,axis-y
Usage
FContainer
FContainer(
q: 'bg-red-500 text-white rounded-lg p-4 mb-4 shadow-lg rd-16 w-full',
children: [
FText(
"Hello",
q: "text-white text-lg font-bold",
),
FText(
"World",
q: "text-white text-lg font-bold",
),
],
),
FText
FText(
"Hello",
q: "text-white text-lg font-bold",
),
Supported Tailwind-like Classes
Background Color
bg-{color}-{value}
Text Color
text-{color}-{value}
Padding
p-{value}pt-{value}pr-{value}pb-{value}pl-{value}px-{value}py-{value}
Margin
m-{value}mt-{value}mr-{value}mb-{value}ml-{value}mx-{value}my-{value}
Border Radius
rd-{value}rd-t-{value}rd-r-{value}rd-b-{value}rd-l-{value}
Shadow
shadow-xsshadow-smshadow-mdshadow-lgshadow-xlshadow-2xlshadow-innershadow-outlineshadow-none
Width
w-{value}w-1/2w-1/3w-2/3w-1/4w-2/4w-3/4w-1/5w-2/5w-3/5w-4/5w-1/6w-2/6w-3/6w-4/6w-5/6w-1/12w-2/12w-3/12w-4/12w-5/12w-6/12w-7/12w-8/12w-9/12w-10/12w-11/12w-full
Height
h-{value}h-full
Spacing
gap-{value}gap-x-{value}gap-y-{value}
Text Alignment
text-lefttext-centertext-right
Animation
animate-noneanimate-spinanimate-pinganimate-pulseanimate-bounce
Positioning
left-{value}right-{value}top-{value}bottom-{value}
Layouts
rowwrapstackschildlistgrid
Shrink Wrap
shrinkWrap
Axis
axis-xaxis-y