figma_string_extension 0.5.0 copy "figma_string_extension: ^0.5.0" to clipboard
figma_string_extension: ^0.5.0 copied to clipboard

Convert Figma String to Flutter Widget

Features #

  • asColor
  • asTextStyle
  • asBoxShadow

Getting started #

see more at /example folder.

import 'package:figma_string_extension/figma_string_extension.dart';

main() {
  FigmaStringConfig.insertResolver(
    // if you have custom color
    colorResolvers: [
      ColorResolverPart((p) {
        switch (p) {
          case 'Card Color':
            return const Color(0xffFFF0FE);
          default:
            throw 'unknown color [$p]';
        }
      })
    ],
  );

  runApp(MaterialApp(
    home: Scaffold(
      body: Center(
        child: Container(

          /// figma hex color
          color: '#D8F0FEF1'.asColor,
          child: Text(
            "hello",

            /// custom text style
            style: 'Card Text'.asTextStyle,
          ),
        ),
      ),
    ),
  ));
}

Additional information #

0
likes
110
points
172
downloads

Publisher

verified publisherwyattcoder.top

Weekly Downloads

Convert Figma String to Flutter Widget

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

collection, flutter, get_it

More

Packages that depend on figma_string_extension