fss library

This is the main library for fss.

It grants you access to the Fss factory class the FssTheme and other widgets.

To use the fss library in your code:

import 'package:fss/fss.dart';

For more details please check out the package documentation and look at the examples.

Classes

FlutterStyleSheet
Represents a style sheet containing a set of rules.
Fss
This is mainly a factory to create widgets which can be then styled from a style sheet file. If offers methods to create common elements which are imitating popular elements of HTML like for example: div, p, h1 - h6, img ...
FssAngle
Defines a angel as used by gradient definitions.
FssBase
Stores some base line values for size conversion
FssBox
A container that will automatically apply some styles of the applicable FssRuleBlock
FssColor
Defines color constants for lookup
FssList
A container that will layout its children in a list (column)
FssListItem
A list item wrapper
FssMediaSelector
A Special selector for a media rules.
FssParent
This widget is a invisible node that is injected into the widget tree to support style inheritance.
FssProperty
Defines all standard properties with their names and initial values.
FssPropertyValue
Simple helper class to represent a property value definition as parsed from a style sheet.
FssRule
Specifies a FSS rule consisting of a selector and a set of properties.
FssRuleBlock
A list of properties representing all properties of a rule block.
FssSelector
Defines a selector based on a "type" an "id" and a list of "classes"
FssSize
Defines a length / size with unit
FssText
A styleable text inline widget.
FssTheme
A widget to install a css like stylesheet into the widget tree as a theme. All fss widgets will then access this stylesheet to resolve rules and to apply the styles to them. To create fss styling aware widgets use the Fss factory class.
FssWidget
Abstract widget that resolves the applicable FssRuleBlock for you and allows you to configure any widget with it. When you inherit from this class you need to implement the buildContent method.

Enums

FssType
Some predefined element type names as known from HTML We add some non standard elements too.

Extensions

FssTypeNameEx on FssType
Some extension to the enum to get the name of an entry.

Functions

parseStylesheet(String? input) List<FssRule>
Parses a style sheet file into a list of rules.
resolveApplicableStyles({required BuildContext context, String? fssType, String? fssId, String? fssClass}) FssRuleBlock
Finds the applicable rule to use for this widget. If no class is set on this container look up the hirarchy

Typedefs

FssWidgetBuilder = Widget Function(BuildContext context, FssRuleBlock applicableRule)
Widget builder callback that gives you access to the "applicable properties".

Exceptions / Errors

FssParseException
An exception thrown if the parsing of the stylesheet or rules fails.