desktop 5.0.1 copy "desktop: ^5.0.1" to clipboard
desktop: ^5.0.1 copied to clipboard

Flutter design standard for desktop. Just simple, usable wigdets to create apps. See the gallery for examples of the components used.

example/lib/main.dart

import 'package:desktop/desktop.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return DesktopApp(
      theme: ThemeData(
        brightness: Brightness.dark,
        primaryColor: PrimaryColors.royalBlue.primaryColor,
      ),
      home: const HomePage(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Tree(
      title: Builder(
        builder: (context) => Padding(
          padding: const EdgeInsets.only(top: 12.0),
          child: Text(
            'Tree with widgets',
            style: Theme.of(context).textTheme.body2,
          ),
        ),
      ),
      nodes: [
        TreeNode.child(
          titleBuilder: (context) => const Row(
            children: [
              Padding(
                padding: EdgeInsets.only(right: 8),
                child: Icon(Icons.camera_enhance),
              ),
              Text('Node 0'),
            ],
          ),
          builder: (context) => Center(
              child: Text(
            'Node 0',
            style: Theme.of(context).textTheme.title,
          )),
        ),
        TreeNode.children(
          titleBuilder: (context) => const Row(
            children: [
              Padding(
                padding: EdgeInsets.only(right: 8),
                child: Icon(Icons.place),
              ),
              Text('Node 1'),
            ],
          ),
          children: [
            TreeNode.child(
              titleBuilder: (context) => const Row(
                children: [
                  Padding(
                    padding: EdgeInsets.only(right: 8),
                    child: Icon(Icons.location_city),
                  ),
                  Text('Node 0'),
                ],
              ),
              builder: (context) => Center(
                child: Text(
                  'Node 1 -> 0',
                  style: Theme.of(context).textTheme.title,
                ),
              ),
            ),
            TreeNode.child(
              titleBuilder: (context) => const Row(
                children: [
                  Padding(
                    padding: EdgeInsets.only(right: 8),
                    child: Icon(Icons.map),
                  ),
                  Text('Node 1'),
                ],
              ),
              builder: (context) => Center(
                  child: Text(
                'Node 1 -> 1',
                style: Theme.of(context).textTheme.title,
              )),
            ),
          ],
        ),
        TreeNode.child(
          titleBuilder: (context) => const Row(
            children: [
              Padding(
                padding: EdgeInsets.only(right: 8),
                child: Icon(Icons.message),
              ),
              Text('Node 2'),
            ],
          ),
          builder: (context) => Center(
              child: Text(
            'Node 2 ',
            style: Theme.of(context).textTheme.title,
          )),
        ),
      ],
    );
  }
}
147
likes
90
pub points
80%
popularity

Publisher

verified publisheradrianosouza.dev

Flutter design standard for desktop. Just simple, usable wigdets to create apps. See the gallery for examples of the components used.

Homepage
Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

Funding

Consider supporting this project:

github.com

License

MIT (LICENSE)

Dependencies

collection, flutter

More

Packages that depend on desktop