stylix_ui 1.0.4 copy "stylix_ui: ^1.0.4" to clipboard
stylix_ui: ^1.0.4 copied to clipboard

A semantic Flutter design system with customizable themes, brand presets, typography, and reusable UI components.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:stylix_ui/stylix_ui.dart';
import 'design_system_preview_page.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  static _MyAppState of(BuildContext context) =>
      context.findAncestorStateOfType<_MyAppState>()!;

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  ThemeMode themeMode = ThemeMode.system;
  StylixBrand brand = StylixBrand.defaultBrand;

  void toggleThemeMode() {
    setState(() {
      themeMode =
          themeMode == ThemeMode.light ? ThemeMode.dark : ThemeMode.light;
    });
  }

  void setThemeMode(ThemeMode mode) {
    setState(() {
      themeMode = mode;
    });
  }

  void setBrand(StylixBrand newBrand) {
    setState(() {
      brand = newBrand;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Stylix UI Example',
      themeMode: themeMode,
      theme: StylixTheme.light(brand, locale: const Locale('en', 'US')),
      darkTheme: StylixTheme.dark(brand, locale: const Locale('en', 'US')),
      home: const DesignSystemPreviewPage(),
    );
  }
}
0
likes
150
points
188
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A semantic Flutter design system with customizable themes, brand presets, typography, and reusable UI components.

Repository (GitHub)
View/report issues

Topics

#flutter #design-system #theme #material3 #design-tokens

License

MIT (license)

Dependencies

flutter, google_fonts

More

Packages that depend on stylix_ui