figma2flutter 0.3.0-alpha figma2flutter: ^0.3.0-alpha copied to clipboard
This package converts Tokens Studio for Figma json exports into Flutter code.
Use this package as an executable
Install it
You can install the package from the command line:
dart pub global activate figma2flutter
Use it
The package has the following executables:
$ figma2flutter
Use this package as a library
Depend on it
Run this command:
With Dart:
$ dart pub add figma2flutter
With Flutter:
$ flutter pub add figma2flutter
This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get
):
dependencies:
figma2flutter: ^0.3.0-alpha
Alternatively, your editor might support dart pub get
or flutter pub get
. Check the docs for your editor to learn more.
Import it
Now in your Dart code, you can use:
import 'package:figma2flutter/config/args_parser.dart';
import 'package:figma2flutter/config/options.dart';
import 'package:figma2flutter/config/parser.dart';
import 'package:figma2flutter/exceptions/process_token_exception.dart';
import 'package:figma2flutter/exceptions/resolve_token_exception.dart';
import 'package:figma2flutter/extensions/string.dart';
import 'package:figma2flutter/generator.dart';
import 'package:figma2flutter/models/border_value.dart';
import 'package:figma2flutter/models/box_shadow_value.dart';
import 'package:figma2flutter/models/color_value.dart';
import 'package:figma2flutter/models/dimension_value.dart';
import 'package:figma2flutter/models/font_family_value.dart';
import 'package:figma2flutter/models/font_weight_value.dart';
import 'package:figma2flutter/models/letter_spacing_value.dart';
import 'package:figma2flutter/models/linear_gradient_value.dart';
import 'package:figma2flutter/models/multi_dimension_value.dart';
import 'package:figma2flutter/models/sizing_value.dart';
import 'package:figma2flutter/models/text_style_value.dart';
import 'package:figma2flutter/models/token.dart';
import 'package:figma2flutter/models/token_theme.dart';
import 'package:figma2flutter/processor.dart';
import 'package:figma2flutter/token_parser.dart';
import 'package:figma2flutter/transformers/border_radius_transformer.dart';
import 'package:figma2flutter/transformers/border_transformer.dart';
import 'package:figma2flutter/transformers/box_shadow_transformer.dart';
import 'package:figma2flutter/transformers/color_transformer.dart';
import 'package:figma2flutter/transformers/composition_transformer.dart';
import 'package:figma2flutter/transformers/linear_gradient_transformer.dart';
import 'package:figma2flutter/transformers/material_color_transformer.dart';
import 'package:figma2flutter/transformers/size_transformer.dart';
import 'package:figma2flutter/transformers/spacing_transformer.dart';
import 'package:figma2flutter/transformers/transformer.dart';
import 'package:figma2flutter/transformers/typography_transformer.dart';
import 'package:figma2flutter/utils/sets_and_themes.dart';