naked_ui 0.2.0-beta.7 copy "naked_ui: ^0.2.0-beta.7" to clipboard
naked_ui: ^0.2.0-beta.7 copied to clipboard

A library of behavior-first UI components for Flutter that separate state from presentation.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'registry.dart';
import 'shell/shell.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Naked Kitchen Sink',
      theme: ThemeData(
        colorSchemeSeed: Colors.blue,
        useMaterial3: true,
      ),
      onGenerateRoute: (settings) {
        final name = settings.name ?? '/';
        // Expecting hash URLs on web (/#/component/<id>)
        final path = name.startsWith('/#/') ? name.substring(3) : name;
        final parts = path.split('/').where((p) => p.isNotEmpty).toList();

        if (parts.isEmpty) {
          return MaterialPageRoute(
            builder: (_) => const KitchenShell(),
          );
        }

        if (parts.length >= 2 &&
            (parts[0] == 'component' || parts[0] == 'embed')) {
          final id = parts[1];
          final demo = DemoRegistry.find(id);
          if (demo != null) {
            return MaterialPageRoute(
              builder: (_) => KitchenShell(
                initialDemoId: id,
                embed: parts[0] == 'embed',
              ),
            );
          }
        }

        // Fallback to index shell
        return MaterialPageRoute(
          builder: (_) => const KitchenShell(),
        );
      },
      home: const KitchenShell(),
    );
  }
}
5
likes
150
points
289
downloads

Publisher

verified publisherleoafarias.com

Weekly Downloads

A library of behavior-first UI components for Flutter that separate state from presentation.

Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on naked_ui