FluttyUI
A Flutter UI toolkit built on the widgets layer. FluttyApp provides navigation,
overlays, localization and application defaults without Material or Cupertino
application shells. Inter 4.1 is bundled, with regular and italic weights 100–900.
Start an application
import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart';
void main() => runApp(const FluttyApp(home: Text('Hello')));
Use FluttyApp.router(routerConfig: router) for declarative navigation. The
standard constructor supports home, routes, initialRoute, navigator keys,
observers and route factories. Named routes use the theme's navigation motion.
Custom routes and router packages control their own transitions.
builder runs inside localization, the theme, scroll configuration and an
overlay. Preserve its child when using navigation. locale,
supportedLocales, localization delegates, shortcuts, actions, restoration,
and debug options are available on both constructors. Widgets and Cupertino
localizations support platform text editing; the application has no Material
widget dependency.
Theme configuration
ThemeData contains six immutable groups with complete defaults:
| Group | Type | Purpose |
|---|---|---|
| colors | ColorTokens | Semantic UI roles, including brand and surface |
| radius | RadiusTokens | Control, surface and rounding values |
| sizes | SizeTokens | Control heights and icon sizes |
| spaces | SpaceTokens | Spacing scale |
| typography | TypographyTokens | Font ownership and text roles |
| motion | MotionTokens | Paired animation durations and curves |
Override just a brand color:
final light = ThemeData(
colors: ColorTokens(brand: Colors.violet.shade600),
);
final dark = ThemeData.dark(
colors: ColorTokens.dark(brand: Colors.violet.shade400),
);
FluttyApp(
theme: light,
darkTheme: dark,
themeMode: ThemeMode.system, // or light / dark
home: const Text('Hello'),
);
Light and dark configurations are independent. Use ColorTokens.dark when
partially customizing a dark color group. copyWith replaces supplied groups;
copy a group first to retain its other custom values:
final compact = light.copyWith(
sizes: light.sizes.copyWith(inputHeight: 44),
spaces: light.spaces.copyWith(lg: 12),
);
Read tokens using context.theme or ThemeScope.of(context). There is one source
of truth for each value: theme.colors.brand, theme.radius.control,
theme.sizes.inputHeight, and so on. Appearance is resolved once by the app;
MediaQuery.platformBrightnessOf(context) reports the chosen brightness.
Resolved text styles never get written back into the configuration.
Apply a local override:
final parent = context.theme;
ThemeScope(
data: parent.copyWith(radius: parent.radius.copyWith(control: 12)),
child: const Text('A local theme'),
);
Theme scopes provide text, icon and selection defaults. They participate in
InheritedTheme.captureAll so you can carry a local theme into an overlay rooted
outside that scope. Ordinary ancestor scopes update their descendants live;
captured themes are snapshots and should be recaptured when their source changes.
Colors anywhere
The palette is context-free and separate from semantic UI roles:
const Color brand = Colors.blue; // shade 500
final background = Colors.zinc.shade100;
final highlight = Colors.blue.shade500;
final sameHighlight = Colors.blue[500];
ColorScale extends Flutter’s Color, so Colors.blue works directly in color
properties and const themes. Its default color is shade 500.
Every family provides shade50, shade100 through shade900, and shade950.
Invalid indexed shades throw ArgumentError. Scales also support copyWith and
value equality. Colors.black, Colors.white and Colors.transparent are
individual colors.
Available families: slate, gray, zinc, neutral, stone, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, and rose. Ramps use the Tailwind CSS 3.4 hex palette; attribution is in THIRD_PARTY_NOTICES.md.
The scales are const colors. Colors.blue can be used in const expressions.
Dart does not allow reading an instance field in a constant expression, so an
explicit shade such as Colors.blue.shade600 uses final.
Font ownership
Font ownership is explicit, including when an application also calls its font "Inter":
const typography = TypographyTokens(
fontFamily: FontFamily.inter(), // bundled package font; the default
);
const appFont = FontFamily.application('MyFont');
const packageFont = FontFamily.package('MyFont', package: 'my_fonts');
const platformFont = FontFamily.system();
Set theme.typography.copyWith(fontFamily: appFont) to change the shared font.
Use FontFamily.system() to clear packaged font ownership. Register application
and external package assets in their respective pubspecs. Roles such as body,
label, caption, h1–h6 and code are plain TextStyle values.
typography.resolve(typography.body) applies shared font ownership at use time;
a role's explicit font family takes precedence.
Motion
Each motion role contains a duration and curve together:
final motion = const MotionTokens().copyWith(
feedback: const MotionSpec(
duration: Duration(milliseconds: 100),
curve: Curves.easeOut,
),
);
final themed = light.copyWith(motion: motion);
// Inside a widget:
final spec = context.theme.motion.resolve(
context,
preset: MotionPreset.feedback,
);
Roles include feedback, transition, expansion, navigation, navigationExit,
spinner and progress. resolve accepts per-widget duration and curve overrides.
Disabling theme motion or the platform's disableAnimations accessibility setting
resolves transient motion to zero duration and linear easing. Repeating indicators
stop while motion is disabled. Navigation retains continuous opacity when an
entrance is interrupted by a pop.
Imports and example
package:fluttyui/fluttyui.dart is the single public entry point for the toolkit.
FluttyApp is the only public API with the library prefix.
The Daybook example provides tasks, rich-text notes, local persistence, and
appearance controls. All application code remains in example/lib/main.dart.
Run it with cd example followed by flutter run.
Run flutter test for foundation, integration and regression tests.