Skip to main content

una 0.1.0 copy "una: ^0.1.0" to clipboard
una: ^0.1.0 copied to clipboard

A themeable Flutter design system: 100+ widgets, frosted-glass surfaces, desktop and phone metrics in one theme, Liquid Glass on iOS and macOS, and no Material dependency.

example/example.md

una example #

A minimal app: a themed UnaApp with a card holding a text field, a select and a button that shows a toast.

import 'package:flutter/widgets.dart';
import 'package:una/una.dart';

void main() => runApp(const App());

class App extends StatelessWidget {
  const App({super.key});

  @override
  Widget build(BuildContext context) {
    return UnaApp(
      theme: UnaThemeData(
        colorScheme: const GraphiteColorScheme.light(),
        // One of the four styles: fluid (the default), crisp, pebble or
        // sharp.
        style: StyleTokens.crisp,
      ),
      darkTheme: UnaThemeData(
        colorScheme: const GraphiteColorScheme.dark(),
        style: StyleTokens.crisp,
      ),
      home: const Center(child: SignUpCard()),
    );
  }
}

class SignUpCard extends StatelessWidget {
  const SignUpCard({super.key});

  @override
  Widget build(BuildContext context) {
    return UnaCard(
      style: const UnaCardTheme(width: 360),
      title: const Text('Create an account'),
      description: const Text('Enter your details to get started.'),
      footer: Row(
        mainAxisAlignment: MainAxisAlignment.end,
        children: [
          UnaButton(
            onPressed: () => UnaToaster.of(context).show(
              const UnaToast(title: Text('Account created')),
            ),
            child: const Text('Sign up'),
          ),
        ],
      ),
      child: UnaColumn(
        gap: GapSize.md,
        crossAxisAlignment: CrossAxisAlignment.stretch,
        children: [
          const UnaTextField(placeholder: Text('Email')),
          UnaSelect<String>(
            placeholder: const Text('Plan'),
            options: const [
              UnaSelectOption(value: 'free', child: Text('Free')),
              UnaSelectOption(value: 'pro', child: Text('Pro')),
            ],
            selectedOptionBuilder: (context, value) => Text(value),
          ),
        ],
      ),
    );
  }
}

Fonts #

una bundles no text fonts, so the app above uses the platform's font. To use a Google font, add google_fonts, import package:google_fonts/google_fonts.dart and set:

UnaThemeData(textTheme: UnaTextTheme.fromGoogleFont(GoogleFonts.inter))

More #

The rest of this directory is the component library: every component with live previews and their source, guides, and a theme editor. README.md says how to run it.

11
likes
0
points
223
downloads

Publisher

unverified uploader

Weekly Downloads

A themeable Flutter design system: 100+ widgets, frosted-glass surfaces, desktop and phone metrics in one theme, Liquid Glass on iOS and macOS, and no Material dependency.

Homepage
Repository (GitHub)
View/report issues

Topics

#user-interface #design-system #theming #material-alternative #widget

License

unknown (license)

Dependencies

boxy, collection, cupertino_icons, flutter, flutter_localizations, intl, liquid_glass_widgets, slang, slang_flutter, theme_extensions_builder_annotation, two_dimensional_scrollables, web

More

Packages that depend on una