moon_design 0.59.1 copy "moon_design: ^0.59.1" to clipboard
moon_design: ^0.59.1 copied to clipboard

Moon Design System for Flutter. A set of coherent, themable, and extensible widgets following the Moon Design System.

example/lib/main.dart

import 'package:example/src/storybook/storybook.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_web_plugins/url_strategy.dart';
import 'package:moon_design/moon_design.dart';

void main() async {
  usePathUrlStrategy();

  WidgetsFlutterBinding.ensureInitialized();

  await SystemChrome.setPreferredOrientations(
    [DeviceOrientation.portraitUp],
  );

  runApp(const MyApp());
}

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

  bool get _isInStorybookMode => true;

  @override
  Widget build(BuildContext context) {
    return _isInStorybookMode
        ? const StorybookPage()
        : MaterialApp(
            theme: ThemeData.light().copyWith(
              extensions: <ThemeExtension<dynamic>>[
                MoonTheme(tokens: MoonTokens.light),
              ],
            ),
            darkTheme: ThemeData.dark().copyWith(
              extensions: <ThemeExtension<dynamic>>[
                MoonTheme(tokens: MoonTokens.dark),
              ],
            ),
            home: Scaffold(
              body: Center(
                child: Text(
                  "Moon Design for Flutter",
                  style: TextStyle(
                    fontSize: MediaQuery.of(context).size.width > 800 ? 72 : 32,
                  ),
                ),
              ),
            ),
          );
  }
}
29
likes
140
pub points
77%
popularity

Publisher

verified publisheryolo.com

Moon Design System for Flutter. A set of coherent, themable, and extensible widgets following the Moon Design System.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, moon_icons, moon_tokens

More

Packages that depend on moon_design