Skip to main content

camouflage_skin_fluent 0.2.0 copy "camouflage_skin_fluent: ^0.2.0" to clipboard
camouflage_skin_fluent: ^0.2.0 copied to clipboard

The Fluent 2 skin, built on widgets: Solid surfaces, Subtle feedback, Fluent's tokens. No Material.

camouflage_skin_fluent #

pub package License Docs

The Fluent skin for Camouflage. Microsoft's Fluent 2 for Camouflage: Solid, Acrylic and Mica surfaces, subtle feedback and a density that follows the input.

A skin is the part of Camouflage that decides how every component looks and feels; the components themselves (CamoButton, CamoTextField, CamoDialog, ...) live in camouflage_core and know nothing about it. Swap the skin and the same screen is restyled, with no change to your widgets.

Features #

  • Three surface treatments: solid, Acrylic (blur for flyouts and dialogs) and Mica
  • Subtle hover and press layers, a focus ring in the brand color
  • Density that follows the input device (FluentDensity)
  • A brand ramp derived from one color: fluentTheme(brand:)
  • All 57 components

Getting started #

flutter pub add camouflage_core camouflage_skin_fluent

Wrap your app once with a CamouflageProvider, giving it this skin and one of its themes. The provider goes above the Navigator, so dialogs, menus and sheets inherit it:

import 'package:camouflage_core/camouflage_core.dart';
import 'package:camouflage_skin_fluent/camouflage_skin_fluent.dart';
import 'package:flutter/widgets.dart';

void main() => runApp(
  WidgetsApp(
    color: const Color(0xFF0B57D0),
    pageRouteBuilder: <T>(settings, builder) => PageRouteBuilder<T>(
      settings: settings,
      pageBuilder: (context, _, _) => builder(context),
    ),
    builder: (context, child) => CamouflageProvider(
      skin: fluentSkinDefault,
      theme: fluentTheme(),
      child: child!,
    ),
    home: const MyHome(),
  ),
);

You do not need MaterialApp.

Usage #

Build screens from Camouflage components; they read the skin and theme from the provider:

CamoSurface(
  child: Column(
    children: [
      const CamoText('Create your account'),
      CamoTextField(value: email, onChanged: setEmail, label: 'Email'),
      CamoButton(text: 'Sign up', onPressed: submit),
    ],
  ),
)

A complete app is in example/main.dart. The example app in the repository shows every component and lets you switch skin, brand and light or dark live.

Themes #

fluentTheme()                 // the default light theme
fluentTheme(brightness: Brightness.dark)                  // dark
fluentTheme(brand: const Color(0xFF8A3FFC))                 // your brand color

Pick a surface with fluentSkin(surface: FluentSurface.acrylic); fluentSkinDefault is the solid one. The Acrylic blur falls back to a solid fill when CamoCapabilities.reduceTransparency is on. Flutter cannot detect that platform setting by itself, so set it through the environment of CamouflageProvider if you need it.

Every theme can be checked with theme.validate(), which reports contrast and value problems without changing a color.

Other skins #

Minimal, Fluent, Material, Cupertino and Carbon share the same components and the same contract: camouflage_skin_minimal, camouflage_skin_fluent, camouflage_skin_material, camouflage_skin_cupertino, camouflage_skin_carbon. You can write your own skin against the contract in camouflage_core; camouflage_skin_testing has the checks for it.

Learn more #

License #

Apache License 2.0, see LICENSE.

0
likes
160
points
655
downloads
screenshot

Documentation

Documentation
API reference

Publisher

verified publishersrctool.com

Weekly Downloads

The Fluent 2 skin, built on widgets: Solid surfaces, Subtle feedback, Fluent's tokens. No Material.

Repository (GitHub)
View/report issues
Contributing

Topics

#ui #design-system #theming #widget #accessibility

License

Apache-2.0 (license)

Dependencies

camouflage_core, flutter, material_color_utilities

More

Packages that depend on camouflage_skin_fluent