GithubHelp home page GithubHelp logo

drawcall / c2f Goto Github PK

View Code? Open in Web Editor NEW
262.0 262.0 31.0 7.87 MB

C2F can convert css style to Flutter code online.

Home Page: https://drawcall.github.io/c2f/

License: MIT License

HTML 2.20% CSS 2.45% JavaScript 95.35%
css css2flutter flutter flutter-css

c2f's People

Contributors

drawcall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

c2f's Issues

can't convert

it is gold metaric css.

background: linear-gradient(120.07deg, #FFE5C5 17.61%, #D2B38B 50.22%, #F1DDC3 83.52%);

result is below

new Container( 
  decoration: BoxDecoration(
    image: new DecorationImage(
      image: new ExactAssetImage('linear-gradient(120.07deg, rgb(255, 229, 197) 17.61%, rgb(210, 179, 139) 50.22%, rgb(241, 221, 195) 83.52%'),
      fit: BoxFit.auto,
      repeat: ImageRepeat.repeat,
    ),
  )
),

but, strange

and BoxFit.auto, is a mistake.
BoxFit.fill, is better.

Not working with percentage property

I am using this site to get Gradient colors in CSS. The code puts in a percentage in every color and Flutter throws an error while using the conversion. Can you fix it or tell me the way around it.

Color from Website -
image

CSS Code

background-image: linear-gradient(45deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%);

Flutter Code generated -

Container(
  decoration: BoxDecoration(
    gradient: LinearGradient(
      begin: Alignment(0.0, 0.0),
      end: Alignment(0.707, -0.707),
      colors: [Color(0xff9a9e 0%00),Color(0xfad0c4 99%00),Color(0xfad0c4 100%00)],
    ),
  )
),

Error -
image

Error Message -

Expected to find ','.
Too many positional arguments: 1 expected, but 2 found.
Try removing the extra arguments.

Can you publish to NPM?

Thanks for your code, this is helpful for my project with NodeJS.

I hope to install this from NPM.

Like npm install c2f.

HSL colors

Hi,

The HSL colors in the context of a linear gradient don't work.

image

The hsl colors should be converted to RGBA first. :)

Color css property don't convert correctly

css input:

background-color: #e0e0e0;
color:#e0e0e0;

Flutter

Container(
  child: Text(
    "Hello World",
    style: TextStyle(
      color: Color(0xE0E0E000),
    ),
  ),
  decoration: BoxDecoration(
    color: Color(0xE0E0E000),
  )
),

error:
#e0e0e0 should be 0xFFE0E0E0 not 0xE0E0E000

FF 0xFFE0E0E0

text-decoration css property don't convert correctly

css input:
text-decoration: underline;

Flutter output:

Container(
child: Text(
"Hello World",
style: TextStyle(
textDecorationLine: TextDecoration.underline,
textDecorationStyle: TextDecorationStyle.solid,
textDecorationColor: Color(0x00000000),
),
),
),

error:

The named parameter 'textDecorationLine' isn't defined.
Try correcting the name to an existing named parameter's name, or defining a named parameter with the name 'textDecorationLine'.dartundefined_named_parameter

flutter version sdk

sdk: ">=2.16.1 <3.0.0"

This works for me

Text(
"Hello World",
style: TextStyle(
decoration: TextDecoration.underline
)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.