Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

flutter_shine.dart

flutter shine is a library for pretty shadows, dynamic light positions, extremely customizable shadows, no library dependencies, text or box shadows based on content.

flutter widget inspired by shine

installation

add the package

dependencies:
  flutter_shine: ^0.0.5

❔ usage

import this class

import 'package:flutter_shine/flutter_shine.dart';

flutter shine for pretty shadows

see how easy it is to create a shadow on text and on a container.

pretty shadows

fluttershine(
    builder: (buildcontext context, shineshadow shineshadow) {
        return column(
            crossaxisalignment: crossaxisalignment.center,
            mainaxisalignment: mainaxisalignment.spaceevenly,
            mainaxissize: mainaxissize.max,
            children: <widget>[
                text(
                    "shine",
                    style: textstyle(
                        fontsize: 100,
                        color: colors.white,
                        shadows: shineshadow.shadows),
                ),
                divider(),
                container(
                    width: 300,
                    height: 300,
                    decoration: boxdecoration(
                        color: colors.white, boxshadow: shineshadow.boxshadows),
                )
            ],
        );
    },
),

extremely customizable shadow with a dynamic light positions.

you can customize follows values :

  • number of steps : the density of the shadow
  • opacity : the opacity of the shadow
  • opacity power : the opacity power
  • offset : the offset of the shadow
  • offset power : the offset power
  • blur : the blur of the shadow
  • blur power : the blur power
  • shadow color : the color of the shadow

exemple

fluttershine(
    [config: config(shadowcolor: colors.red[300]),]
    [light: light(intensity: 1, position: point(x, y)),]
    builder: (buildcontext context, shineshadow shineshadow) {
        return column(
            crossaxisalignment: crossaxisalignment.center,
            mainaxisalignment: mainaxisalignment.spaceevenly,
            mainaxissize: mainaxissize.max,
            children: <widget>[
                text(
                    "shine",
                    style: textstyle(
                        fontsize: 100,
                        color: colors.white,
                        shadows: shineshadow.shadows),
                ),
                divider(),
                container(
                    width: 300,
                    height: 300,
                    decoration: boxdecoration(
                        color: colors.white, boxshadow: shineshadow.boxshadows),
                )
            ],
        );
    },
),

examples

web and command-line examples can be found in the example folder.

web examples

in order to run the web examples, please follow these steps:

  1. download this repo and enter the directory
  2. run pub get
  3. run pub run build_runner serve example
  4. navigate to http://localhost:8080/web/ in your browser

command line examples

in order to run the command line example, please follow these steps:

  1. download this repo and enter the directory
  2. run pub get
  3. run dart example/lib/main.dart

flutter example

install flutter

in order to run the flutter example, you must have flutter installed. for installation instructions, view the online
documentation.

run the app

  1. open up an android emulator, the ios simulator, or connect an appropriate mobile device for debugging.
  2. open up a terminal
  3. cd into the example/lib/ directory
  4. run flutter doctor to ensure you have all flutter dependencies working.
  5. run flutter packages get
  6. run flutter run

Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

Comments are closed.