
Catppuccin for Dart
Get started with example/main.dart
Tips for flutter projects
Use the below code snipet to convert the value field of the map to Color of the flutter library.
import 'package:catppuccin/catppuccin.dart';
import 'package:flutter/material.dart';
Map<FlavourColorKeys, Color> convertColorInfoMapToColorMap(
Map<FlavourColorKeys, ColorInfo> colorInfoMap) {
return colorInfoMap.map((key, colorInfo) => MapEntry(key,
Color.fromRGBO(colorInfo.rgb[0], colorInfo.rgb[1], colorInfo.rgb[2], 1)));
}
Map<FlavourColorKeys, Color> mocha =
convertColorInfoMapToColorMap(variants[FlavourNames.mocha]!);
Color pink = mocha[FlavourColorKeys.pink]!;
Frequently Asked Questions
1) How do I use Catppuccin in a Dart / Flutter project?
To use Catppuccin in a Dart / Flutter project, you can follow these steps:
- Add Catppuccin to Your
pubspec.yamlFile: Open yourpubspec.yamlfile and add the following line under thedependenciessection:
dependencies:
# ...
catppuccin: ^0.1.0
# ...
- After adding catppuccin to your
pubspec.yamlfile, run the following command in your terminal to fetch the packages:
flutter pub get
If you are not building a flutter app, you can use:
dart pub get
Libraries
- catppuccin
- Support for doing something awesome.