tdesign_flutter 0.0.6 copy "tdesign_flutter: ^0.0.6" to clipboard
tdesign_flutter: ^0.0.6 copied to clipboard

outdated

Tencent TDesign UI component library of Flutter, suitable for use in mobile projects.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';

void main() {
  runApp(MaterialApp(
    title: 'TDesign Flutter Example',
    theme: ThemeData(extensions: [
      TDThemeData.defaultData().copyWith(colorMap: {'brandNormalColor': Colors.blue})
    ]),
    home: Scaffold(
      body: Scaffold(
        body: Center(
          child: Builder(
            builder: (context) {
              return Column(
                mainAxisSize: MainAxisSize.min,
                children: [
                  TDText(
                    '测试文本',
                    textColor: TDTheme.of(context).brandNormalColor,
                    font: TDTheme.of(context).fontBodyMedium,
                  ),
                  const TDButton(
                    text: '演示按钮',
                    theme: TDButtonTheme.primary,
                  ),
                  Icon(TDIcons.add,color: TDTheme.of(context).brandNormalColor,)
                ],
              );
            },
          ),
        ),
      ),
    ),
  ));
}


// 测试页面
class TestPage extends StatelessWidget {
  const TestPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            TDText(
              '测试文本',
              textColor: TDTheme.of(context).brandNormalColor,
              font: TDTheme.of(context).fontBodyMedium,
            ),
            const TDButton(
              text: '演示按钮',
              theme: TDButtonTheme.primary,
            )
          ],
        ),
      ),
    );
  }
}

String testThemeConfig = '''
  {
    "test": {
        "color": {
            "brandNormalColor": "#F6685D"
        },
        "font": {
            "fontBodyMedium": {
                "size": 40,
                "lineHeight": 55
            }
        }
    }
}
  ''';
92
likes
0
points
3.41k
downloads

Publisher

verified publishertdesign.tencent.com

Weekly Downloads

Tencent TDesign UI component library of Flutter, suitable for use in mobile projects.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_easyrefresh, flutter_swiper_null_safety

More

Packages that depend on tdesign_flutter