glitters 0.1.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 60

Glitters #

Pub Version

A glittering widget for Flutter.

Screencast

What it does #

This package provides two types of widgets:

  • Glitters
    • The main widget of this package that fades in and out glitter-like shapes one by one inside itself. This will be useful when you want some part of your app to look shiny.
  • SingleGlitter
    • Just an extra widget to draw a single static glitter-like shape.

Code examples #

Simplest

const ColoredBox(
  color: Colors.black,
  body: Glitters(),
)

Multiple glitters

SizedBox(
  width: 200.0,
  height: 200.0,
  child: Stack(
    children: const <Widget>[
      SizedBox.expand(
        child: ColoredBox(color: Colors.black),
      ),
      Glitters(
        interval: Duration(milliseconds: 300),
        maxOpacity: 0.7,
        color: Colors.orange,
      ),
      Glitters(
        duration: Duration(milliseconds: 200),
        outDuration: Duration(milliseconds: 500),
        interval: Duration.zero,
        color: Colors.white,
        maxOpacity: 0.5,
      ),
    ],
  ),
)

A single static glitter

const ColoredBox(
  color: Colors.black,
  child: SingleGlitter(size: 100.0),
)

Note #

Glitters uses LayoutBuilder for obtaining the constraints to decide on drawing positions. Make sure that it is not unconstrained to avoid related errors.

0.1.3 - 2 July 2020 #

  • Update documentation.
  • Tweak circle size.

0.1.2 - 1 July 2020 #

  • Tweak minimum cross width.
  • Improve gradient/opacity of inner whitish circle.
  • Enable durations to be updated by Hot Reload.

0.1.1 - 10 June 2020 #

  • Improve handling of default sizes.
  • Update README.

0.1.0 - 7 June 2020 #

  • Release as a public package.

0.0.2 - 6 June 2020 #

  • More real look with better shape and gradient.

0.0.1 - 5 June 2020 #

  • Initial release

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:glitters/glitters.dart';

void main() => runApp(const App());

class App extends StatelessWidget {
  const App();

  @override
  Widget build(BuildContext context) {
    const appTitle = 'Glitters';

    return MaterialApp(
      title: appTitle,
      home: Scaffold(
        appBar: AppBar(
          title: const Text(appTitle),
          backgroundColor: Colors.grey.shade700,
        ),
        body: SafeArea(
          child: Center(
            child: FractionallySizedBox(
              widthFactor: 0.6,
              heightFactor: 0.6,
              child: ColoredBox(
                color: Colors.blueGrey.shade700,
                child: Stack(
                  children: const <Widget>[
                    Glitters(
                      minSize: 8.0,
                      maxSize: 20.0,
                      interval: Duration.zero,
                      maxOpacity: 0.7,
                    ),
                    Glitters(
                      minSize: 10.0,
                      maxSize: 25.0,
                      interval: Duration(milliseconds: 20),
                      color: Colors.lime,
                    ),
                    Glitters(
                      minSize: 10.0,
                      maxSize: 25.0,
                      duration: Duration(milliseconds: 200),
                      inDuration: Duration(milliseconds: 500),
                      outDuration: Duration(milliseconds: 500),
                      interval: Duration(milliseconds: 30),
                      color: Colors.white,
                      maxOpacity: 0.7,
                    ),
                    Glitters(
                      minSize: 14.0,
                      maxSize: 30.0,
                      interval: Duration(milliseconds: 40),
                      color: Colors.orange,
                    ),
                  ],
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  glitters: ^0.1.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:glitters/glitters.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
19
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
60
Learn more about scoring.

We analyzed this package on Jul 9, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

Because:

  • glitters that is a package requiring null.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
meta ^1.1.8 1.1.8 1.2.2
Transitive dependencies
collection 1.14.12 1.14.13
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety