SFResponsiveRow class
Un widget qui agit comme un conteneur de disposition responsive pour les SFResponsiveColumn.
Organise ses enfants horizontalement et gère la disposition responsive en fonction des points de rupture (breakpoints) définis. Cette classe fournit un contexte pour que les colonnes enfants puissent déterminer leur largeur relative.
Paramètres:
- children : Liste des colonnes responsives à afficher dans la rangée.
- totalColumns : Nombre total de colonnes dans la grille (par défaut: 12).
- spacing : Espacement horizontal entre les colonnes.
verticalSpacing: Espacement vertical lorsque les colonnes se wrappent sur plusieurs lignes.mainAxisAlignment: Alignement des enfants le long de l'axe principal.crossAxisAlignment: Alignement des enfants le long de l'axe transversal.- wrap : Si true, les colonnes s'enrouleront sur plusieurs lignes si nécessaire.
Exemple d'utilisation:
SFResponsiveRow(
spacing: 16.0,
verticalSpacing: 24.0,
children: [
SFResponsiveColumn(
xs: 12,
sm: 6,
md: 4,
child: Container(
height: 100,
color: Colors.blue,
child: Center(child: Text('Colonne 1')),
),
),
SFResponsiveColumn(
xs: 12,
sm: 6,
md: 4,
child: Container(
height: 100,
color: Colors.green,
child: Center(child: Text('Colonne 2')),
),
),
SFResponsiveColumn(
xs: 12,
sm: 12,
md: 4,
child: Container(
height: 100,
color: Colors.orange,
child: Center(child: Text('Colonne 3')),
),
),
],
)
Sur un écran mobile, chaque colonne occupera toute la largeur. Sur une tablette, les deux premières colonnes partageront une ligne, et la troisième sera sur une nouvelle ligne. Sur un desktop, toutes les colonnes seront disposées sur une seule ligne, chacune occupant un tiers de la largeur.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- SFResponsiveRow
Constructors
-
SFResponsiveRow({required List<
Widget> children, double? spacing, bool wrap = true, EdgeInsetsGeometry? margin, EdgeInsetsGeometry? padding, int totalColumns = 12, Key? key}) -
const
Properties
-
children
→ List<
Widget> -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- margin → EdgeInsetsGeometry?
-
final
- padding → EdgeInsetsGeometry?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spacing → double?
-
final
- totalColumns → int
-
final
- wrap → bool
-
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
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