@@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart';
4
4
5
5
import '../../core/styled_widget.dart' ;
6
6
import '../../modifiers/internal/render_widget_modifier.dart' ;
7
- import '../box/box_spec.dart' ;
8
7
import 'flex_spec.dart' ;
9
8
10
9
/// A flexible layout widget enhanced with `Style` for simplified styling.
@@ -88,16 +87,19 @@ class FlexSpecWidget extends StatelessWidget {
88
87
mainAxisSize: spec? .mainAxisSize ?? _defaultFlex.mainAxisSize,
89
88
crossAxisAlignment:
90
89
spec? .crossAxisAlignment ?? _defaultFlex.crossAxisAlignment,
90
+ textDirection: spec? .textDirection ?? _defaultFlex.textDirection,
91
91
verticalDirection:
92
92
spec? .verticalDirection ?? _defaultFlex.verticalDirection,
93
+ textBaseline: spec? .textBaseline ?? _defaultFlex.textBaseline,
94
+ clipBehavior: spec? .clipBehavior ?? _defaultFlex.clipBehavior,
93
95
children: _buildChildren (gap),
94
96
);
95
97
96
98
return spec == null
97
99
? flexWidget
98
100
: RenderSpecModifiers (
99
- orderOfModifiers: orderOfModifiers,
100
101
spec: spec! ,
102
+ orderOfModifiers: orderOfModifiers,
101
103
child: flexWidget,
102
104
);
103
105
}
@@ -200,98 +202,4 @@ class StyledColumn extends StyledFlex {
200
202
}) : super (direction: Axis .vertical);
201
203
}
202
204
203
- /// A flex container widget with integrated `Style` for enhanced styling.
204
- ///
205
- /// `FlexBox` combines the features of `StyledContainer` and `StyledFlex` , offering
206
- /// a powerful tool for creating flexible layouts with advanced styling capabilities
207
- /// through `Style` . It's perfect for designing complex layouts that require both
208
- /// container and flex properties with uniform styling.
209
- ///
210
- /// The `direction` parameter sets the layout's orientation, while the `Style`
211
- /// integration simplifies the process of applying consistent styles to all elements.
212
- ///
213
- /// Example Usage:
214
- /// ```dart
215
- /// FlexBox(
216
- /// direction: Axis.horizontal,
217
- /// style: yourStyle,
218
- /// children: [Widget1(), Widget2()],
219
- /// );
220
- /// ```
221
- class FlexBox extends StyledWidget {
222
- const FlexBox ({
223
- super .style,
224
- super .key,
225
- super .inherit,
226
- required this .direction,
227
- required this .children,
228
- super .orderOfModifiers = const [],
229
- });
230
-
231
- final List <Widget > children;
232
- final Axis direction;
233
-
234
- @override
235
- Widget build (BuildContext context) {
236
- return withMix (context, (mix) {
237
- final boxSpec = BoxSpec .of (mix);
238
- final flexSpec = FlexSpec .of (mix);
239
-
240
- return boxSpec (
241
- orderOfModifiers: orderOfModifiers,
242
- child: flexSpec (direction: direction, children: children),
243
- );
244
- });
245
- }
246
- }
247
-
248
- /// A horizontal flex container with `Style` for easy and consistent styling.
249
- ///
250
- /// `HBox` is a specialized `FlexBox` designed for horizontal layouts, simplifying
251
- /// the process of applying horizontal alignment with advanced styling via `Style` .
252
- /// It's an efficient way to achieve consistent styling in horizontal arrangements.
253
- ///
254
- /// Inherits all functionalities of `FlexBox` , optimized for horizontal layouts.
255
- ///
256
- /// Example Usage:
257
- /// ```dart
258
- /// HBox(
259
- /// style: yourStyle,
260
- /// children: [Widget1(), Widget2()],
261
- /// );
262
- /// ```
263
- class HBox extends FlexBox {
264
- const HBox ({
265
- super .style,
266
- super .key,
267
- super .inherit,
268
- super .children = const < Widget > [],
269
- }) : super (direction: Axis .horizontal);
270
- }
271
-
272
- /// A vertical flex container that uses `Style` for streamlined styling.
273
- ///
274
- /// `VBox` is a vertical counterpart to `HBox` , utilizing `Style` for efficient
275
- /// and consistent styling in vertical layouts. It offers an easy way to manage
276
- /// vertical alignment and styling in a cohesive manner.
277
- ///
278
- /// Inherits the comprehensive styling and layout capabilities of `FlexBox` , tailored
279
- /// for vertical orientations.
280
- ///
281
- /// Example Usage:
282
- /// ```dart
283
- /// VBox(
284
- /// style: yourStyle,
285
- /// children: [Widget1(), Widget2()],
286
- /// );
287
- /// ```
288
- class VBox extends FlexBox {
289
- const VBox ({
290
- super .style,
291
- super .key,
292
- super .inherit,
293
- super .children = const < Widget > [],
294
- }) : super (direction: Axis .vertical);
295
- }
296
-
297
205
final _defaultFlex = Flex (direction: Axis .horizontal, children: const []);
0 commit comments