Skip to main content

antd_flutter_ui 1.0.3 copy "antd_flutter_ui: ^1.0.3" to clipboard
antd_flutter_ui: ^1.0.3 copied to clipboard

Ant Design v6 Flutter UI component library (base layer). Shared engines and basic/generic components, ported from antd and antd-mobile.

example/lib/main.dart

import 'package:antd_flutter_ui/antd_flutter_ui.dart';
import 'package:antd_theme/antd_theme.dart';
import 'package:material_ui/material_ui.dart';

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

/// Minimal gallery that demonstrates the core `antd_flutter_ui` widgets.
class AntdUiExampleApp extends StatelessWidget {
  const AntdUiExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return AntTheme(
      data: AntThemeData.light(),
      child: const MaterialApp(
        title: 'antd_flutter_ui example',
        home: _HomePage(),
      ),
    );
  }
}

class _HomePage extends StatefulWidget {
  const _HomePage();

  @override
  State<_HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<_HomePage> {
  int _count = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('antd_flutter_ui')),
      body: Padding(
        padding: const EdgeInsets.all(16),
        child: AntSpace(
          direction: AntSpaceDirection.vertical,
          children: [
            const AntDivider(child: Text('Buttons')),
            AntSpace(
              wrap: true,
              children: [
                AntButton(
                  type: AntButtonType.primary,
                  child: const Text('Primary'),
                  onTap: () => setState(() => _count++),
                ),
                const AntButton(child: Text('Default')),
                const AntButton(
                  type: AntButtonType.dashed,
                  child: Text('Dashed'),
                ),
                const AntButton(danger: true, child: Text('Danger')),
              ],
            ),
            const AntDivider(child: Text('Tags')),
            const AntSpace(
              wrap: true,
              children: [
                AntTag(child: 'Tag A'),
                AntTag(child: 'Tag B'),
              ],
            ),
            const AntDivider(child: Text('Counter')),
            Text('Tapped $_count time(s)'),
          ],
        ),
      ),
    );
  }
}
1
likes
160
points
0
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Ant Design v6 Flutter UI component library (base layer). Shared engines and basic/generic components, ported from antd and antd-mobile.

Homepage
Repository (GitHub)
View/report issues

Topics

#ui #components #design-system #ant-design

License

MIT (license)

Dependencies

antd_color, antd_icons_flutter, antd_theme, cached_network_image, cupertino_ui, flutter, flutter_cache_manager, material_ui

More

Packages that depend on antd_flutter_ui