Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: flutter support #320

Merged
merged 12 commits into from
Apr 24, 2020
Merged

Conversation

MDemetrio
Copy link
Contributor

@MDemetrio MDemetrio commented Sep 2, 2019

*Issue #, if available: #288

Description of changes:
Based on swift implementation ( #255 ), it adds ability to use flutter and flutter-separate transform groups. Examples:
flutter:

//
// StyleDictionary.dart
//
// Do not edit directly
// Generated on Mon, 02 Sep 2019 20:12:07 GMT
//

import 'package:flutter/material.dart';

class StyleDictionary {
  StyleDictionary._();
  
    static const colorBaseGrayDark = Color(0xFF111111);
    static const colorBaseGrayLight = Color(0xFFCCCCCC);
    static const colorBaseGrayMedium = Color(0xFF999999);
    static const colorBaseGreen = Color(0xFF00FF00);
    static const colorBaseRed = Color(0xFFFF0000);
    static const colorFontBase = Color(0xFFFF0000);
    static const colorFontSecondary = Color(0xFF00FF00);
    static const colorFontTertiary = Color(0xFFCCCCCC);
    static const sizeFontBase = 16.00;
    static const sizeFontLarge = 32.00;
    static const sizeFontMedium = 16.00;
    static const sizeFontSmall = 12.00;
}

flutter-separate:

//
// StyleDictionaryColor.dart
//
// Do not edit directly
// Generated on Mon, 02 Sep 2019 20:12:07 GMT
//


import 'package:flutter/material.dart';

class StyleDictionaryColor {
  StyleDictionaryColor._();
  
    static const baseGrayDark = Color(0xFF111111);
    static const baseGrayLight = Color(0xFFCCCCCC);
    static const baseGrayMedium = Color(0xFF999999);
    static const baseGreen = Color(0xFF00FF00);
    static const baseRed = Color(0xFFFF0000);
    static const fontBase = Color(0xFFFF0000);
    static const fontSecondary = Color(0xFF00FF00);
    static const fontTertiary = Color(0xFFCCCCCC);
}
//
// StyleDictionarySize.dart
//
// Do not edit directly
// Generated on Mon, 02 Sep 2019 20:12:07 GMT
//


import 'package:flutter/material.dart';

class StyleDictionarySize {
  StyleDictionarySize._();
  
    static const fontBase = 16.00;
    static const fontLarge = 32.00;
    static const fontMedium = 16.00;
    static const fontSmall = 12.00;
}

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@MDemetrio MDemetrio changed the title Feat/flutter support feat: flutter support Sep 2, 2019
Copy link
Collaborator

@chazzmoney chazzmoney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR! 👍

It look pretty good to me - just one requested change!

package-lock.json Outdated Show resolved Hide resolved
examples/basic/config.json Outdated Show resolved Hide resolved
@MDemetrio
Copy link
Contributor Author

@chazzmoney @dbanksdesign can you guys help me finish this?

Copy link
Member

@dbanksdesign dbanksdesign left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for taking a while to review this. I left some comments, overall it looks great! Thank you for adding unit tests and adding everything to make a good developer experience. I think the main thing would be moving the example code to its own example in the 'advanced' directory. If that is too much for now, we can add this in without an example and create the example later.

lib/common/templates/flutter/class.dart.template Outdated Show resolved Hide resolved
lib/common/transformGroups.js Show resolved Hide resolved
lib/common/transforms.js Show resolved Hide resolved
@MDemetrio MDemetrio force-pushed the feat/flutter-support branch from d9372d7 to 7c33e86 Compare November 8, 2019 20:21
@MDemetrio MDemetrio marked this pull request as ready for review November 8, 2019 20:23
@MDemetrio MDemetrio requested a review from chazzmoney November 8, 2019 20:29
Copy link
Member

@dbanksdesign dbanksdesign left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I just have 2 comments/questions. Thank you for your work on this!

Copy link
Collaborator

@chazzmoney chazzmoney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great! Just a couple minor changes to making sure the files are all in good spots and we are good to go!

examples/advanced/flutter/style_dictionary/.metadata Outdated Show resolved Hide resolved
examples/advanced/flutter/style_dictionary/README.md Outdated Show resolved Hide resolved
@MDemetrio MDemetrio requested a review from chazzmoney November 28, 2019 14:43
@MDemetrio MDemetrio force-pushed the feat/flutter-support branch from 4a76362 to ecaa58b Compare January 29, 2020 14:06
Copy link
Collaborator

@chazzmoney chazzmoney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really good! We are very close - no code changes at all.

The reason for the not approved is I'm 100% sure about all files included - some have references to your local machine for example. Can you double check that they should be committed?

Thank you!

examples/advanced/flutter/CHANGELOG.md Outdated Show resolved Hide resolved
examples/advanced/flutter/LICENSE Outdated Show resolved Hide resolved
examples/advanced/flutter/.dart_tool/package_config.json Outdated Show resolved Hide resolved
examples/advanced/flutter/.packages Outdated Show resolved Hide resolved
examples/advanced/flutter/pubspec.lock Outdated Show resolved Hide resolved
@MDemetrio
Copy link
Contributor Author

@chazzmoney I deleted the files you suggested and tested referencing the package in a application after generating the style-dictionary and flutter files locally, and it all worked fine.

@MDemetrio MDemetrio force-pushed the feat/flutter-support branch from ef652bb to 16dcdfb Compare January 31, 2020 17:33
@rodrigosol
Copy link

Hi There,

I am looking for flutter support.

How can I help you to finish this PR?

Thanks

@chazzmoney
Copy link
Collaborator

LGTM! :shipit:

@dbanksdesign dbanksdesign merged commit 8a5f645 into amzn:master Apr 24, 2020
@MDemetrio MDemetrio deleted the feat/flutter-support branch April 28, 2020 13:00
dbanksdesign added a commit that referenced this pull request Oct 5, 2020
Based on swift implementation ( #255 ), it adds swift transforms, transformGroups, formats, and example: 

* flutter/class.dart format
* flutter and flutter-separate transformGroups
* color/hex8flutter, content/flutter/literal, asset/flutter/literal, font/flutter/literal, and size/flutter/remToDouble transforms
* advanced/flutter example

fixes #288 

Co-authored-by: MDemetrio <[email protected]>
Co-authored-by: Danny Banks <[email protected]>
@pedropuzzl
Copy link

Hello, I'm having problems with color conversion to flutter.

Can you help me? Color tokens are not changing their value after conversion. They are not setting up to Hex8

@umutarpat
Copy link

Hello, I want to learn your Roadmap for updating Flutter support with perhaps less bugs or more enchantments.

And do you think right now Flutter support is production ready ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants