Antd Flutter Mobile

Antd Flutter Mobile is an implementation of Ant Design Mobile for the Flutter platform. With zero dependencies and an ultra-lightweight package (only 200kB in total), it offers 50+ high-quality components covering common interaction scenarios such as themes, overlays, forms, and precise list positioning.

English · 中文

Document · Web Demo

Please Note: This project is currently in its early alpha stage. Please be advised that component properties are subject to change without prior notice. We highly recommend evaluating its suitability before integrating it into your projects.

For immediate support and best practices, you can reach us through the following channels:

✨ Features

  • Zero dependencies, dark mode works out of the box, setup completes upon installation.
  • Feather-light, The complete package weighs in at just 218KB, icons included.
  • Innovative style system, not bound to any specific UI implementation—flexible and powerful, allowing you to customize every element you see
  • Self-contained solution, meeting all needs from pop-ups to scroll interactions with one component library

📦 Installation

flutter pub add antd_flutter_mobile

🔨 Example

import 'package:antd_flutter_mobile/index.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    builder: (context, child) {
      return const Center(
        child: AntdButton(
          child: Text("Button"),
        ),
      );
    },
  ));
}

🔨 Use Layer

import 'package:antd_flutter_mobile/index.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    navigatorObservers: [AntdLayer.observer],
    home: AntdTokenBuilder(builder: (context, token) {
      return AntdBox(
        style: AntdBoxStyle(
            color: token.colorFillTertiary, alignment: Alignment.center),
        child: AntdButton(
          onTap: () {
            AntdToast.show(
              "Toast",
              position: AntdToastPosition.top,
            );
          },
          child: const Text("Button"),
        ),
      );
    }),
  ));
}

🔨 Custom Theme

import 'package:antd_flutter_mobile/index.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(AntdProvider(
      theme: AntdTheme(
          mode: AntdThemeMode.light,
          buttonStyle: (context, button, style, token) {
            if (button.size == AntdSize.large) {
              return AntdButtonStyle(
                  buttonStyle: AntdBoxStyle(color: token.colorWarning));
            }
            return style;
          },
          token: const AntdSeedToken(
            radius: 6,
            colorError: Color(0xffff3141),
            colorInfo: Color(0xff1677ff),
            colorLink: Color(0xff1677ff),
            colorPrimary: Color(0xffad05ef),
            colorSuccess: Color(0xff00b578),
            colorText: Color(0xff171717),
            colorBgBase: Color(0xffffffff),
            colorWarning: Color(0xffff8f1f),
            fontSize: 14,
            lineWidth: 2,
            sizeStep: 4,
            sizeUnit: 2,
            arrow: Size(16, 8),
          )),
      builder: (context, theme) {
        return MaterialApp(
          builder: (context, child) {
            return const Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                AntdButton(
                  child: Text("Pick Button"),
                ),
                AntdButton(
                  size: AntdSize.large,
                  child: Text("Waining Button"),
                )
              ],
            );
          },
        );
      }));
}

🔨 Style System

Priority: 3>4>1>2

import 'package:antd_flutter_mobile/index.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: AntdStyleBuilderProvider<AntdBoxStyle, AntdBox>(
      /// 1
        builder: (context, box, style, token,) {
          return AntdBoxStyle(
              color: token.colorPrimary,
              size: 100,
              textStyle: token.font.md.copyWith(color: token.colorSuccess),
              alignment: Alignment.center);
        },
        child: Row(
          children: [
            AntdStyleProvider<AntdBoxStyle>(
              /// 2
                style: const AntdBoxStyle(size: 50),
                child: AntdBox(
                  /// 4
                  style: AntdBoxStyle(
                      radius: 10.radius.all,
                      textStyle: const TextStyle(color: Colors.white)),
                  /// 3
                  styleBuilder: (context, box, style, token,) {
                    return AntdBoxStyle(
                        border: token.border
                            .copyWith(color: token.colorSuccess, width: 3)
                            .all);
                  },
                  child: const Text("box1"),
                )),
            AntdBox(
              style: AntdBoxStyle(margin: 10.left),
              child: const Text("box2"),
            )
          ],
        )),
  ));
}

Libraries

components/avatar/index
components/badge/index
components/bar/index/controller
components/bar/index/float
components/bar/index/index
components/bar/notice
components/bar/slider
components/bar/tab
components/block/error
components/box/handler
components/box/index
components/box/painter
components/box/style
components/button/index
components/card/index
components/cascader/index
components/cascader/view
components/check/box
components/check/list
components/collapse/index
components/define
components/dialog/index
components/divider/index
components/dropdown/index
components/ellipsis/index
components/empty/index
components/flex/index
components/floating/index
components/footer/index
components/form/controller
components/form/index
components/form/item
components/form/rule
components/icon/icon
components/icon/index
components/image/index
components/indicator/index
components/input/index
components/layer
components/list/index
components/loading/index
components/mask/animation
components/mask/clip
components/mask/hole
components/mask/index
components/mask/painter
components/modal/index
components/picker/view
components/popover/index
components/popup/animation
components/popup/index
components/progress/bar
components/progress/circle
components/provider
components/radio/index
components/refresh/index
components/result/index
components/segmented/index
components/selector/index
components/sheet/index
components/skeleton/index
components/slider/index
components/steps/index
components/style
components/swiper/action
components/swiper/index
components/swiper/item
components/switch/index
components/tabs/capsule
components/tabs/index
components/tabs/indicator
components/tabs/jumbo
components/tabs/panel
components/tag/index
components/textarea/index
components/toast/index
components/tour/index
components/tour/step
components/widgets/arrow
components/widgets/controller
components/widgets/list/controller
components/widgets/list/index
components/widgets/list/item
components/widgets/scrollable
components/widgets/slivers
extensions/border
extensions/color
extensions/dynamic
extensions/edge_inset
extensions/int
extensions/radius
extensions/style
index
theme/algorithm
theme/color
theme/font
theme/opacity
theme/radius
theme/shadow
theme/size
theme/theme
theme/token