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

The class 'GeneratedThemeData' can't be used as a mixin because it's neither a mixin class nor a mixin. #6

Open
Kahoulam opened this issue Nov 25, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Kahoulam
Copy link

Steps to reproduce

  1. Create a new project
  2. Add tokens.json file
  3. Execute the command dart run build_runner build

Expected results

The generated tokens.dart has no errors

Actual results

An error occurred:

The class 'GeneratedThemeData' can't be used as a mixin because it's neither a mixin class nor a mixin.

Version

design_tokens_builder: ^0.2.0+1

Code sample

tokens.json
{
  "global": {
    "white": {
      "value": "#ffffff",
      "type": "color"
    },
    "black": {
      "value": "#293133",
      "type": "color"
    },
    "fontFamilies": {
      "primary": {
        "value": "System Roboto",
        "type": "fontFamilies"
      }
    },
    "fontWeights": {
      "w400": {
        "value": "400",
        "type": "fontWeights"
      },
      "w600": {
        "value": "600",
        "type": "fontWeights"
      },
      "w700": {
        "value": "700",
        "type": "fontWeights"
      },
      "w800": {
        "value": "800",
        "type": "fontWeights"
      },
      "w900": {
        "value": "900",
        "type": "fontWeights"
      }
    },
    "fontSize": {
      "base": {
        "value": "10",
        "type": "fontSizes"
      },
      "scale": {
        "value": "3",
        "type": "fontSizes"
      },
      "xs": {
        "value": "roundTo({fontSize.base})",
        "type": "fontSizes"
      },
      "sm": {
        "value": "{fontSize.base}+{fontSize.scale}",
        "type": "fontSizes"
      },
      "md": {
        "value": "{fontSize.sm}+{fontSize.scale}",
        "type": "fontSizes"
      },
      "lg": {
        "value": "{fontSize.md}+{fontSize.scale}",
        "type": "fontSizes"
      },
      "xl": {
        "value": "{fontSize.lg}+{fontSize.scale}",
        "type": "fontSizes"
      }
    },
    "letterSpacing": {
      "none": {
        "value": "0",
        "type": "letterSpacing"
      },
      "sm": {
        "value": "0.1",
        "type": "letterSpacing"
      },
      "md": {
        "value": "0.25",
        "type": "letterSpacing"
      },
      "lg": {
        "value": "0.5",
        "type": "letterSpacing"
      }
    },
    "paragraphSpacing": {
      "none": {
        "value": "0",
        "type": "paragraphSpacing"
      }
    },
    "sys": {
      "display": {
        "small": {
          "value": {
            "fontFamily": "{fontFamilies.primary}",
            "fontWeight": "{fontWeights.w900}",
            "lineHeight": "{lineHeights.xs}",
            "fontSize": "{fontSize.xl}",
            "letterSpacing": "{letterSpacing.none}",
            "paragraphSpacing": "{paragraphSpacing.none}",
            "paragraphIndent": "{paragraphIndent.none}",
            "textCase": "{textCase.none}",
            "textDecoration": "{textDecoration.none}"
          },
          "type": "typography"
        },
        "medium": {
          "value": {
            "fontFamily": "{fontFamilies.primary}",
            "fontWeight": "{fontWeights.w900}",
            "lineHeight": "{lineHeights.xs}",
            "fontSize": "{fontSize.xl}",
            "letterSpacing": "{letterSpacing.none}",
            "paragraphSpacing": "{paragraphSpacing.none}",
            "paragraphIndent": "{paragraphIndent.none}",
            "textCase": "{textCase.none}",
            "textDecoration": "{textDecoration.none}"
          },
          "type": "typography"
        },
        "large": {
          "value": {
            "fontFamily": "{fontFamilies.primary}",
            "fontWeight": "{fontWeights.w900}",
            "lineHeight": "{lineHeights.xs}",
            "fontSize": "{fontSize.xl}",
            "letterSpacing": "{letterSpacing.none}",
            "paragraphSpacing": "{paragraphSpacing.none}",
            "paragraphIndent": "{paragraphIndent.none}",
            "textCase": "{textCase.none}",
            "textDecoration": "{textDecoration.none}"
          },
          "type": "typography"
        }
      },
      "headline": {
        "small": {
          "value": {
            "fontFamily": "{fontFamilies.primary}",
            "fontWeight": "{fontWeights.w900}",
            "lineHeight": "{lineHeights.md}",
            "fontSize": "{fontSize.xl}",
            "letterSpacing": "{letterSpacing.none}",
            "paragraphSpacing": "{paragraphSpacing.none}",
            "paragraphIndent": "{paragraphIndent.none}",
            "textCase": "{textCase.none}",
            "textDecoration": "{textDecoration.none}"
          },
          "type": "typography"
        },
        "medium": {
          "value": {
            "fontFamily": "{fontFamilies.primary}",
            "fontWeight": "{fontWeights.w900}",
            "lineHeight": "{lineHeights.md}",
            "fontSize": "{fontSize.xl}",
            "letterSpacing": "{letterSpacing.none}",
            "paragraphSpacing": "{paragraphSpacing.none}",
            "paragraphIndent": "{paragraphIndent.none}",
            "textCase": "{textCase.none}",
            "textDecoration": "{textDecoration.none}"
          },
          "type": "typography"
        },
        "large": {
          "value": {
            "fontFamily": "{fontFamilies.primary}",
            "fontWeight": "{fontWeights.w900}",
            "lineHeight": "{lineHeights.md}",
            "fontSize": "{fontSize.xl}",
            "letterSpacing": "{letterSpacing.none}",
            "paragraphSpacing": "{paragraphSpacing.none}",
            "paragraphIndent": "{paragraphIndent.none}",
            "textCase": "{textCase.none}",
            "textDecoration": "{textDecoration.none}"
          },
          "type": "typography"
        }
      },
      "title": {
        "small": {
          "value": {
            "fontFamily": "{fontFamilies.primary}",
            "fontWeight": "{fontWeights.w800}",
            "lineHeight": "{lineHeights.md}",
            "fontSize": "{fontSize.sm}",
            "letterSpacing": "{letterSpacing.sm}",
            "paragraphSpacing": "{paragraphSpacing.none}",
            "paragraphIndent": "{paragraphIndent.none}",
            "textCase": "{textCase.none}",
            "textDecoration": "{textDecoration.none}"
          },
          "type": "typography"
        },
        "medium": {
          "value": {
            "fontFamily": "{fontFamilies.primary}",
            "fontWeight": "{fontWeights.w800}",
            "lineHeight": "{lineHeights.md}",
            "fontSize": "{fontSize.md}",
            "letterSpacing": "{letterSpacing.sm}",
            "paragraphSpacing": "{paragraphSpacing.none}",
            "paragraphIndent": "{paragraphIndent.none}",
            "textCase": "{textCase.none}",
            "textDecoration": "{textDecoration.none}"
          },
          "type": "typography"
        },
        "large": {
          "value": {
            "fontFamily": "{fontFamilies.primary}",
            "fontWeight": "{fontWeights.w800}",
            "lineHeight": "{lineHeights.md}",
            "fontSize": "{fontSize.xl}",
            "letterSpacing": "{letterSpacing.none}",
            "paragraphSpacing": "{paragraphSpacing.none}",
            "paragraphIndent": "{paragraphIndent.none}",
            "textCase": "{textCase.none}",
            "textDecoration": "{textDecoration.none}"
          },
          "type": "typography"
        }
      },
      "label": {
        "small": {
          "value": {
            "fontFamily": "{fontFamilies.primary}",
            "fontWeight": "{fontWeights.w800}",
            "lineHeight": "{lineHeights.md}",
            "fontSize": "{fontSize.xs}",
            "letterSpacing": "{letterSpacing.lg}",
            "paragraphSpacing": "{paragraphSpacing.none}",
            "paragraphIndent": "{paragraphIndent.none}",
            "textCase": "{textCase.none}",
            "textDecoration": "{textDecoration.none}"
          },
          "type": "typography"
        },
        "medium": {
          "value": {
            "fontFamily": "{fontFamilies.primary}",
            "fontWeight": "{fontWeights.w800}",
            "lineHeight": "{lineHeights.md}",
            "fontSize": "{fontSize.sm}",
            "letterSpacing": "{letterSpacing.lg}",
            "paragraphSpacing": "{paragraphSpacing.none}",
            "paragraphIndent": "{paragraphIndent.none}",
            "textCase": "{textCase.none}",
            "textDecoration": "{textDecoration.none}"
          },
          "type": "typography"
        },
        "large": {
          "value": {
            "fontFamily": "{fontFamilies.primary}",
            "fontWeight": "{fontWeights.w800}",
            "lineHeight": "{lineHeights.md}",
            "fontSize": "{fontSize.md}",
            "letterSpacing": "{letterSpacing.sm}",
            "paragraphSpacing": "{paragraphSpacing.none}",
            "paragraphIndent": "{paragraphIndent.none}",
            "textCase": "{textCase.none}",
            "textDecoration": "{textDecoration.none}"
          },
          "type": "typography"
        }
      },
      "body": {
        "small": {
          "value": {
            "fontFamily": "{fontFamilies.primary}",
            "fontWeight": "{fontWeights.w400}",
            "lineHeight": "{lineHeights.md}",
            "fontSize": "{fontSize.xs}",
            "letterSpacing": "{letterSpacing.lg}",
            "paragraphSpacing": "{paragraphSpacing.none}",
            "paragraphIndent": "{paragraphIndent.none}",
            "textCase": "{textCase.none}",
            "textDecoration": "{textDecoration.none}"
          },
          "type": "typography"
        },
        "medium": {
          "value": {
            "fontFamily": "{fontFamilies.primary}",
            "fontWeight": "{fontWeights.w400}",
            "lineHeight": "{lineHeights.md}",
            "fontSize": "{fontSize.sm}",
            "letterSpacing": "{letterSpacing.md}",
            "paragraphSpacing": "{paragraphSpacing.none}",
            "paragraphIndent": "{paragraphIndent.none}",
            "textCase": "{textCase.none}",
            "textDecoration": "{textDecoration.none}"
          },
          "type": "typography"
        },
        "large": {
          "value": {
            "fontFamily": "{fontFamilies.primary}",
            "fontWeight": "{fontWeights.w400}",
            "lineHeight": "{lineHeights.md}",
            "fontSize": "{fontSize.md}",
            "letterSpacing": "{letterSpacing.sm}",
            "paragraphSpacing": "{paragraphSpacing.none}",
            "paragraphIndent": "{paragraphIndent.none}",
            "textCase": "{textCase.none}",
            "textDecoration": "{textDecoration.none}"
          },
          "type": "typography"
        }
      }
    },
    "textCase": {
      "none": {
        "value": "none",
        "type": "textCase"
      }
    },
    "textDecoration": {
      "none": {
        "value": "none",
        "type": "textDecoration"
      }
    },
    "paragraphIndent": {
      "none": {
        "value": "0px",
        "type": "dimension"
      }
    },
    "lineHeights": {
      "xs": {
        "value": "110%",
        "type": "lineHeights"
      },
      "sm": {
        "value": "125%",
        "type": "lineHeights"
      },
      "md": {
        "value": "150%",
        "type": "lineHeights"
      }
    },
    "elevatedButton": {
      "height": {
        "value": "38",
        "type": "sizing"
      },
      "color": {
        "value": "#3A9BDC",
        "type": "color"
      },
      "padding": {
        "value": "1px 0 3px 4px",
        "type": "spacing"
      },
      "borderRadius": {
        "value": "16",
        "type": "borderRadius"
      },
      "shadow": {
        "value": [
          {
            "x": "0",
            "y": "3",
            "blur": "5",
            "spread": "0",
            "color": "#000000",
            "type": "dropShadow"
          },
          {
            "x": "0",
            "y": "0",
            "blur": "0",
            "spread": "0",
            "color": "#000000",
            "type": "innerShadow"
          }
        ],
        "type": "boxShadow"
      },
      "border": {
        "value": {
          "color": "{black}",
          "width": "3",
          "style": "solid"
        },
        "type": "border"
      }
    }
  },
  "dark": {
    "specialColors": {
      "color1": {
        "value": "#00FF00",
        "type": "color"
      },
      "color2": {
        "value": "#FF0000",
        "type": "color"
      }
    },
    "sys": {
      "background": {
        "value": "{black}",
        "type": "color"
      },
      "onBackground": {
        "value": "{white}",
        "type": "color"
      },
      "primary": {
        "value": "#0000FF",
        "type": "color"
      },
      "onPrimary": {
        "value": "{white}",
        "type": "color"
      }
    }
  },
  "light": {
    "specialColors": {
      "color1": {
        "value": "#00FF00",
        "type": "color"
      },
      "color2": {
        "value": "#FF0000",
        "type": "color"
      }
    },
    "sys": {
      "background": {
        "value": "{white}",
        "type": "color"
      },
      "onBackground": {
        "value": "{black}",
        "type": "color"
      },
      "primary": {
        "value": "#0000FF",
        "type": "color"
      },
      "onPrimary": {
        "value": "{white}",
        "type": "color"
      }
    }
  },
  "custom": {
    "specialColors": {
      "color1": {
        "value": "#00FF00",
        "type": "color"
      },
      "color2": {
        "value": "#FF0000",
        "type": "color"
      }
    },
    "sys": {
      "background": {
        "value": "#CBD0CC",
        "type": "color"
      },
      "onBackground": {
        "value": "{black}",
        "type": "color"
      },
      "primary": {
        "value": "#BDECB6",
        "type": "color"
      },
      "onPrimary": {
        "value": "{black}",
        "type": "color"
      }
    }
  },
  "partyLight": {
    "specialColors": {
      "color1": {
        "value": "#F44611",
        "type": "color"
      },
      "color2": {
        "value": "#FF0000",
        "type": "color"
      }
    },
    "sys": {
      "background": {
        "value": "{white}",
        "type": "color"
      },
      "onBackground": {
        "value": "{black}",
        "type": "color"
      },
      "primary": {
        "value": "#FE0000",
        "type": "color"
      },
      "onPrimary": {
        "value": "{white}",
        "type": "color"
      }
    }
  },
  "partyDark": {
    "specialColors": {
      "color1": {
        "value": "#00FF00",
        "type": "color"
      },
      "color2": {
        "value": "#FF0000",
        "type": "color"
      }
    },
    "sys": {
      "background": {
        "value": "{black}",
        "type": "color"
      },
      "onBackground": {
        "value": "{white}",
        "type": "color"
      },
      "primary": {
        "value": "#F8F32B",
        "type": "color"
      },
      "onPrimary": {
        "value": "{black}",
        "type": "color"
      }
    }
  },
  "$themes": [],
  "$metadata": {
    "tokenSetOrder": [
      "global",
      "dark",
      "light",
      "custom",
      "partyLight",
      "partyDark"
    ]
  }
}

Screenshots or Video

Screenshots image

Flutter Doctor output

Doctor output
  [✓] Flutter (Channel stable, 3.13.9, on macOS 14.0 23A344 darwin-arm64, locale en-TW)
  [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
  [✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
  [✓] Chrome - develop for the web
  [✓] Android Studio (version 2022.3)
  [✓] VS Code (version 1.84.0)
  [✓] Connected device (1 available)
  [✓] Network resources
@Kahoulam Kahoulam changed the title Error: The class 'GeneratedThemeData' can't be used as a mixin because it's neither a mixin class nor a mixin. Error: The class 'GeneratedThemeData' can't be used as a mixin because it's neither a mixin class nor a mixin. Nov 25, 2023
@Kahoulam Kahoulam changed the title Error: The class 'GeneratedThemeData' can't be used as a mixin because it's neither a mixin class nor a mixin. The class 'GeneratedThemeData' can't be used as a mixin because it's neither a mixin class nor a mixin. Nov 25, 2023
@Sese-Schneider Sese-Schneider added the bug Something isn't working label Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants