DEV Community

Akash Pattnaik
Akash Pattnaik

Posted on

3 2

Colors.js in dart.

Ever used colors.js? How about the same in dart?

Here, we will be using the colorx.dart package.

So, Let's Get Started!

Installing

  • pubspec.yaml
dependencies:
  colorx: ^1.0.0
Enter fullscreen mode Exit fullscreen mode
  • Then run dart pub get or flutter pub get.

Usage

  • main.dart
import 'package:colorx/colorx.dart';

void main(List<String> args) {
    print(Colors('Red, Bold and with Blue background').red.bold.bgBlue);
    print('Red, Bold and with Blue background'.red.bold.bgBlue);
    print('This is a raindow text'.rainbow());
    print('This is the INDIAN Flag'.indianFlag());
}
Enter fullscreen mode Exit fullscreen mode

Made with Extensions on the String class, this can be very productive and helpful...

Example.dart

Example Image 1Example Image 2

All Available Methods

  • You may look here for all available methods...

SurveyJS custom survey software

JavaScript UI Libraries for Surveys and Forms

SurveyJS lets you build a JSON-based form management system that integrates with any backend, giving you full control over your data and no user limits. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs