components/container
library
Classes
-
UAnimatedContainer
-
UContainer that animates size, color, radius and padding changes.
UAnimatedContainer(duration: 300.ms, width: open ? 200 : 60, child: icon)
-
UAspectRatio
-
Keeps a width/height ratio.
UAspectRatio(aspectRatio: 16 / 9, child: video)
-
UCard
-
Material card with u's box, tap and flex options.
UCard(onTap: open, child: content)
-
UCenter
-
Center with size factors.
UCenter(child: logo)
-
UColumn
-
Column with gap spacing, box decoration, tap and flex options.
UColumn(spacing: 8, children: [a, b, c])
-
UConstrained
-
Applies min/max width and height.
UConstrained(maxWidth: 600, child: form)
-
UContainer
-
Container with everything built in: radius, border, gradient, shadow, tap/press/hover, tooltip, hero, fit, flex, position.
UContainer(radius: 12, color: Colors.white, padding: const EdgeInsets.all(16), onTap: open, child: Text("Card"))
-
UDefaultTabBar
-
Tab bar + swipeable pages in one widget.
UDefaultTabBar(tabBar: const TabBar(tabs: [Tab(text: "A"), Tab(text: "B")]), children: [PageA(), PageB()])
-
UDivider
-
Horizontal or vertical line.
const UDivider(), const UDivider(axis: Axis.vertical)
-
UGridView
-
GridView by column count or max tile width.
UGridView(crossAxisCount: 2, itemCount: items.length, itemBuilder: (c, i) => Tile(items[i]))
-
UIconTextHorizontal
-
Icon/leading widget next to text/trailing widget, with spacing and box options.
UIconTextHorizontal(leading: const Icon(Icons.phone), trailing: const Text("0912…"))
-
UIconTextVertical
-
Leading widget above trailing widget, with spacing and box options.
-
UKeyValue
-
Key on one side, value on the other (spaceBetween), with box options.
UKeyValue(leading: const Text("Price"), trailing: Text(price.toman()))
-
UListView
-
ListView with separators, box options and shrinkWrap.
UListView(itemCount: items.length, itemBuilder: (c, i) => Text(items[i]))
-
UResponsive
-
Shows a different widget on phone (<850), tablet (850-1100) and desktop (1100+) widths.
UResponsive(mobile: const ListLayout(), desktop: const GridLayout())
-
URow
-
Row with gap spacing, box decoration, tap and flex options.
URow(spacing: 8, children: [icon, text])
-
UScaffold
-
Scaffold that also closes the keyboard on outside taps, adds SafeArea and pads/decorates the body.
UScaffold(appBar: AppBar(title: const Text("Home")), body: content)
-
USliverGrid
-
Sliver grid for CustomScrollView.
-
USliverList
-
Sliver list for CustomScrollView.
-
UStack
-
Stack with box decoration, tap and flex options.
UStack(children: [image, badge.position(top: 4, right: 4)])
-
UWrap
-
Wrap (flows children onto new lines) with decoration and tap options.
UWrap(spacing: 8, runSpacing: 8, children: chips)
Functions
-
uWrap(Widget child, {BorderRadius? borderRadius, double? radius, GestureTapCallback? onTap, VoidCallback? onPress, GestureTapCallback? onDoubleTap, GestureLongPressCallback? onLongPress, GestureTapDownCallback? onTapDown, GestureTapUpCallback? onTapUp, GestureTapCancelCallback? onTapCancel, GestureTapCallback? onSecondaryTap, HitTestBehavior? hitTestBehavior, bool splash = false, Color? splashColor, Color? highlightColor, Color? hoverColor, double? pressedScale, Duration pressDuration = const Duration(milliseconds: 120), bool enableFeedback = true, MouseCursor? cursor, ValueChanged<bool>? onHover, double? opacity, String? tooltip, String? heroTag, EdgeInsetsGeometry? margin, String? semanticsLabel, bool? semanticsButton, bool visible = true, BoxFit? fit, AlignmentGeometry fitAlignment = Alignment.center, double? scale, double? rotate, Offset? translate, bool center = false, bool safeArea = false, Axis? scrollable, ScrollController? scrollController, TextDirection? textDirection, int? expanded, int? flexible, bool positioned = false, double? left, double? top, double? right, double? bottom, double? positionedWidth, double? positionedHeight})
→ Widget
-
Adds u's box, tap, hover, tooltip, hero, fit, transform and position options to any widget (what every U-widget uses).
uWrap(Text("Hi"), onTap: open, tooltip: "Open")