Skip to content

Latest commit

 

History

History
67 lines (54 loc) · 1.73 KB

README.md

File metadata and controls

67 lines (54 loc) · 1.73 KB

TDesign Logo

License Version

TDesign 适配桌面端的组件库,适合在 Flutter 3.x 技术栈项目中使用。

🎉 特性

  • 适配桌面端交互
  • 基于 Flutter 3.x
  • 支持暗黑模式及其他主题定制

安装

dependencies:
  flutter_tdesign_desktop_ui: ^0.1.0

基础使用

void main() {
  // 初始化之前如果访问二进制文件,需要先初始化
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const ProviderScope(
    child: MyApp(),
  ));
}

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {

    return TTheme(
      child: MaterialApp(
        title: 'TDesign Desktop UI Demo',
        locale: Locale('zh_CN'),
        supportedLocales: GlobalTDesignLocalizations.delegate.supportedLocales,
        localizationsDelegates: const [
          GlobalTDesignLocalizations.delegate,
          ...GlobalMaterialLocalizations.delegates,
        ],
        home: const MyHomePage(title: 'TDesign Desktop UI Demo Home Page'),
      ),
    );
  }
}

开源协议

TDesign 遵循 MIT 协议