UniversalListView class
Create ListView to provide a consistent UI across web, desktop, and mobile.
The UniversalAppBar and UniversalSliverAppBar will automatically select and set whether to use the normal list or the Sliver list.
Otherwise, it can be used in the same way as a normal ListView.
When onRefresh is specified, RefreshIndicator is automatically set.
Setting showScrollbarWhenDesktopOrWeb to true
will show scrollbars on desktop and web.
It is responsive and the maximum width is set by UniversalScaffold.breakpoint.
Webとデスクトップ、モバイルで一貫したUIを提供するためのListViewを作成します。
UniversalAppBar、UniversalSliverAppBarによって通常のリストかSliverのリストかを自動で選択して設定します。
その他は通常のListViewと同じように利用可能です。
onRefreshを指定するとRefreshIndicatorを自動で設定します。
showScrollbarWhenDesktopOrWebをtrue
にするとデスクトップとWebでスクロールバーを表示します。
レスポンシブ対応しておりUniversalScaffold.breakpointによって最大の横幅が設定されます。
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- UniversalListView
- Available extensions
Constructors
-
UniversalListView.new({Key? key, required List<
Widget> children, Decoration? decoration, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollController? controller, Future<void> onRefresh()?, Future<void> onLoadNext()?, bool canLoadNext = true, bool? primary, ScrollPhysics? physics, ScrollBehavior? scrollBehavior, bool shrinkWrap = false, Key? center, double anchor = 0.0, double? cacheExtent, int? semanticChildCount, DragStartBehavior dragStartBehavior = DragStartBehavior.start, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual, String? restorationId, Clip clipBehavior = Clip.hardEdge, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.start, int rowSegments = 12, double? maxWidth, EdgeInsetsGeometry? padding, bool? enableResponsivePadding, bool showScrollbarWhenDesktopOrWeb = true, Radius? scrollbarRadius, double? scrollbarThickness, bool displayInvisibleArea = false, double? bottomExtent, double? topExtent}) -
Create ListView to provide a consistent UI across web, desktop, and mobile.
const
Properties
- anchor → double
-
The relative position of the zero scroll offset.
final
- bottomExtent → double?
-
Specify the space at the bottom.
final
- cacheExtent → double?
-
The viewport has an area before and after the visible area to cache items
that are about to become visible when the user scrolls.
final
- canLoadNext → bool
-
If this is
false
, onLoadNext will not be executed.final - center → Key?
-
final
-
children
→ List<
Widget> -
A list of child elements for display in ListView.
final
- clipBehavior → Clip
-
The content will be clipped (or not) according to this option.
final
- controller → ScrollController?
-
An object that can be used to control the position to which this scroll
view is scrolled.
final
- crossAxisAlignment → CrossAxisAlignment
-
You can change the placement of
ResponsiveCol
.final - decoration → Decoration?
-
Sets the container background decoration.
final
- displayInvisibleArea → bool
-
Return
true
if invisible areas should also be drawn.final - dragStartBehavior → DragStartBehavior
-
final
- enableResponsivePadding → bool?
-
Specify whether to enable responsive padding.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardDismissBehavior → ScrollViewKeyboardDismissBehavior
-
ScrollViewKeyboardDismissBehavior the defines how this ScrollView will
dismiss the keyboard automatically.
final
- maxWidth → double?
-
Maximum width.
final
-
onLoadNext
→ Future<
void> Function()? -
一番最後の要素が表示されたときに呼ばれるメソッド。
final
-
onRefresh
→ Future<
void> Function()? -
Method called by RefreshIndicator.
final
- padding → EdgeInsetsGeometry?
-
final
- physics → ScrollPhysics?
-
How the scroll view should respond to user input.
final
- primary → bool
-
Whether this is the primary scroll view associated with the parent
PrimaryScrollController.
final
- restorationId → String?
-
Restoration ID to save and restore the scroll offset of the scrollable.
final
- reverse → bool
-
Whether the scroll view scrolls in the reading direction.
final
- rowSegments → int
-
The number of segments in the horizontal direction.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollbarRadius → Radius?
-
Scrollbar corner radius.
final
- scrollbarThickness → double?
-
Scrollbar width.
final
- scrollBehavior → ScrollBehavior?
-
final
- scrollDirection → Axis
-
The Axis along which the scroll view's offset increases.
final
- semanticChildCount → int?
-
final
- showScrollbarWhenDesktopOrWeb → bool
-
Setting this to
true
will display scrollbars on desktop and web.final - shrinkWrap → bool
-
Whether the extent of the scroll view in the scrollDirection should be
determined by the contents being viewed.
final
- topExtent → double?
-
Specify the space at the top.
final
Methods
-
alignAt(
Alignment alignment, {Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the UniversalUIWidgetStructureExtensions extension
Move Widget toalignment
. -
background(
Color backgroundColor) → DecoratedBox -
Available on Widget, provided by the UniversalUIDecorationExtensions extension
Change thebackgroundColor
of the Widget. -
border(
BoxBorder border) → DecoratedBox -
Available on Widget, provided by the UniversalUIDecorationExtensions extension
Addborder
to Widget. -
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
centerAt(
) → Center -
Available on Widget, provided by the UniversalUIWidgetStructureExtensions extension
Center the Widget. -
clipOval(
{CustomClipper< Rect> ? clipper, Clip clipBehavior = Clip.antiAlias}) → ClipOval -
Available on Widget, provided by the UniversalUIClipExtensions extension
Clip Widget in a circle. -
clipRect(
{required BorderRadiusGeometry borderRadius, CustomClipper< RRect> ? clipper, Clip clipBehavior = Clip.antiAlias}) → ClipRRect -
Available on Widget, provided by the UniversalUIClipExtensions extension
Clip Widget with a rounded rectangle. -
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
decoration(
{Color? backgroundColor, BoxBorder? border}) → DecoratedBox -
Available on Widget, provided by the UniversalUIDecorationExtensions extension
Add abackgroundColor
background orborder
to the Widget. -
expanded(
{int flex = 1}) → Expanded -
Available on Widget, provided by the UniversalUIWidgetStructureExtensions extension
Give Expanded to Widget. -
flexible(
{int flex = 1}) → Flexible -
Available on Widget, provided by the UniversalUIWidgetStructureExtensions extension
Give Flexible to Widget. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDoubleTap(
VoidCallback callback) → GestureDetector -
Available on Widget, provided by the UniversalUIGestureDetectorExtensions extension
callback
when a double-tap is performed. -
onDoubleTapWithInk(
VoidCallback callback) → InkWell -
Available on Widget, provided by the UniversalUIGestureDetectorExtensions extension
callback
when a double-tap is performed. -
onLongPress(
VoidCallback callback) → GestureDetector -
Available on Widget, provided by the UniversalUIGestureDetectorExtensions extension
Executecallback
when a long press is performed. -
onLongPressWithInk(
VoidCallback callback) → InkWell -
Available on Widget, provided by the UniversalUIGestureDetectorExtensions extension
Executecallback
when a long press is performed. -
onTap(
VoidCallback callback) → GestureDetector -
Available on Widget, provided by the UniversalUIGestureDetectorExtensions extension
callback
when a tap is performed. -
onTapWithInk(
VoidCallback callback) → InkWell -
Available on Widget, provided by the UniversalUIGestureDetectorExtensions extension
callback
when a tap is performed. -
opacity(
{required double opacity}) → Opacity -
Available on Widget, provided by the UniversalUIDecorationExtensions extension
Change the transparency of Widget toopacity
. -
padding(
EdgeInsetsGeometry padding) → Padding -
Available on Widget, provided by the UniversalUIPaddingExtensions extension
Set Widget padding topadding
. -
paddingLTRB(
double left, double top, double right, double bottom) → Padding -
Available on Widget, provided by the UniversalUIPaddingExtensions extension
Set the padding of Widget based onleft
,top
,right
, andbottom
. -
shadow(
{Color shadowColor = const Color(_kColorDefault), double blurRadius = 0.0, double spreadRadius = 0.0, Offset offset = Offset.zero, BlurStyle blurStyle = BlurStyle.normal}) → DecoratedBox -
Available on Widget, provided by the UniversalUIDecorationExtensions extension
Add shadow to Widget. -
sizeTo(
{double? width, double? height}) → SizedBox -
Available on Widget, provided by the UniversalUIClipExtensions extension
Set the size of the Widget towidth
andheight
. -
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited