ai_color 1.0.1 copy "ai_color: ^1.0.1" to clipboard
ai_color: ^1.0.1 copied to clipboard

This is a package that will help users quickly find the necessary colors for their projects using only a text description

Name #

AIColor #

Description #

This is a package that will help users quickly find the necessary colors for their projects using only a text description

Demo #

Demo video that shows the work of our package

Getting started #

Create an instance of variable for further convenient use

AIColor aiColor = AIColor("apiKey");//instead of "apikey" use your own API key

Usage #

Using an instance of AIColor and FutureBuilder, you can create various Widgets and set them the desired color with our library

Widget newWidget(String text){
  return FutureBuilder(
    future: aiColor.getColor(text),
    builder: (BuildContext context, AsyncSnapshot<Color?> snapshot) {
      if(snapshot.connectionState == ConnectionState.active ||
          snapshot.connectionState == ConnectionState.waiting){
        return const Center(child: CircularProgressIndicator(),);
      }
      if(snapshot.connectionState == ConnectionState.done){
        if(snapshot.hasError){
          return const Center(child: Text("ERROR"));
        }
        else {
          return Center(
            child: Container(
              width: 100,
              height: 100,
              color: snapshot.data,
            ),
          );
        }
      }
      return const Center(child: Text("wait"),);
    },

  );
}

Instead of the getColor function, you can use updateColor, which does not use the database, but sends a new request to ChatGPT each time

Contributors #

  1. Ilnaz Magizov (@mazik_il)
  2. Daniil Zimin (@daniilzimin4)
3
likes
120
pub points
0%
popularity

Publisher

unverified uploader

This is a package that will help users quickly find the necessary colors for their projects using only a text description

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

dart_openai, flutter, flutter_lints, image_picker, palette_generator, path, shared_preferences

More

Packages that depend on ai_color