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.
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
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:
- download this repo and enter the directory
- run
pub get
- run
pub run build_runner serve example
- navigate to http://localhost:8080/web/ in your browser
command line examples
in order to run the command line example, please follow these steps:
- download this repo and enter the directory
- run
pub get
- 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
- open up an android emulator, the ios simulator, or connect an appropriate mobile device for debugging.
- open up a terminal
cd
into theexample/lib/
directory- run
flutter doctor
to ensure you have all flutter dependencies working. - run
flutter packages get
- run
flutter run
Comments are closed.