Git Product home page Git Product logo

undraw's Introduction

UnDraw Illustrations Flutter Plugin

This is a Flutter plugin for integrating UnDraw illustrations into your Flutter applications. It provides a simple and efficient way to use UnDraw's open-source illustrations in your projects.

Features

  • Easy integration with Flutter applications.
  • Supports all UnDraw illustrations.
  • Allows customization of illustrations with primary color of your theme.
  • Efficient fetching and caching of illustrations.

Installation

To use this plugin, add undraw as a dependency in your pubspec.yaml file.

dependencies:
  undraw:
    git:
      url: https://github.com/pzierahn/undraw.git

Usage

Here is a simple example of how to use the plugin:

import 'package:flutter/material.dart';
import 'package:undraw/undraw.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'UnDraw Illustrations',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(
          seedColor: Colors.blue,
        ),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    final colorScheme = Theme
        .of(context)
        .colorScheme;

    return Scaffold(
      appBar: AppBar(
        title: const Text('UnDraw Illustrations'),
      ),
      body: ListView.builder(
        itemCount: UnDrawIllustration.values.length,
        itemBuilder: (context, inx) {
          final illustration = UnDrawIllustration.values[inx];

          return Container(
            margin: const EdgeInsets.all(16),
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(16),
              border: Border.all(color: colorScheme.outlineVariant),
            ),
            child: Column(
              children: [
                ListTile(
                  title: SelectableText(
                    illustration.name,
                    style: Theme
                        .of(context)
                        .textTheme
                        .titleMedium,
                  ),
                ),
                UnDraw(
                  height: 200,
                  padding: const EdgeInsets.all(16),
                  illustration: illustration,
                  color: colorScheme.primary,
                ),
              ],
            ),
          );
        },
      ),
    );
  }
}

undraw's People

Contributors

pzierahn avatar

Watchers

 avatar

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.