Divider
A simple visual separator component for dividing content into distinct sections
A visual separator component for dividing content into distinct sections.
When to use this
- Content separation: Divide sections of content visually
- List items: Separate items in lists or menus
- Form sections: Group form fields into logical sections
- Visual hierarchy: Create clear visual breaks in layouts
Basic implementation
Basic implementation
import 'package:flutter/material.dart';
import 'package:remix/remix.dart';
class DividerExample extends StatelessWidget {
const DividerExample({super.key});
@override
Widget build(BuildContext context) {
return RemixDivider(
style: style,
);
}
DividerStyler get style {
return DividerStyler()
.height(1)
.color(Colors.grey.shade400)
.width(300);
}
}Fortal widgets
The application-owned Fortal preset provides a themed widget for this component:
Fortal widget
import 'package:flutter/material.dart';
import 'ui/ui.dart';
class FortalDividerExample extends StatelessWidget {
const FortalDividerExample({super.key});
@override
Widget build(BuildContext context) {
return Column(
spacing: 16,
children: [
FortalDivider(size: FortalDividerSize.size1),
FortalDivider(size: FortalDividerSize.size3),
],
);
}
}See the fortalDividerStyle source code for all available options.
Constructor
Constructor
import 'package:flutter/material.dart';
import 'package:remix/remix.dart';
RemixDivider remixDividerConstructor({
Key? key,
DividerStyler style = const DividerStyler.create(),
DividerSpec? styleSpec,
}) => throw UnimplementedError();Properties
Widget Properties
style → DividerStyler
Optional. The style configuration for the divider. Customize color, thickness, and spacing.
styleSpec → DividerSpec?
Optional. A pre-resolved style spec that bypasses style resolution. Useful for performance when sharing resolved styles across multiple instances.
key → Key?
Optional. Controls how one widget replaces another widget in the tree.
Style Methods
color(Color value)
Sets divider color
thickness(double value)
Sets divider thickness (height for horizontal, width for vertical)
padding(EdgeInsetsGeometryMix value)
Sets container padding
margin(EdgeInsetsGeometryMix value)
Sets container margin
alignment(Alignment value)
Sets container alignment
decoration(DecorationMix value)
Sets container decoration
wrap(WidgetModifierConfig value)
Applies widget modifiers such as clipping, opacity, or scaling.
animate(AnimationConfig value)
Configures implicit animation for style transitions.
constraints(BoxConstraintsMix value)
Sets size constraints on the component.
foregroundDecoration(DecorationMix value)
Sets a foreground decoration painted on top of the component.
transform(Matrix4 value, AlignmentGeometry alignment = Alignment.center)
Applies a matrix transformation to the component.
call({Key? key})
Creates a RemixDivider widget with this style applied.