๐ Surface
WORK IN PROGRESS
Overhaul ongoing. Documentation & Readme may be out of date.
A shapeable, layered, intrinsincally animated container widget offering convenient
access to blurring ImageFilter
s, Material
InkResponse
, and HapticFeedback
.
+ ๐ BouncyBall
A delightfully bouncy and position-mirroring reaction to user input on a piece of Material
.
Details in the screenshot above are from an outdated version.
๐ SurfaceLayer
Container Division
Offers robust customization for a set app-wide style or on-the-fly changes.
- Support for
Color
s andGradient
s in both ๐SurfaceLayer
sBASE
andMATERIAL
layers. - Support for three different filters and their strengths.
- The top-most of which will affect any
InkResponse
that occurs on the middle ๐SurfaceLayer
- The top-most of which will affect any
- Insets may be divided amongst different ๐
Layer
s by ๐Shape.padLayer
.
๐ฐ Shape
Customized SurfaceShape
s
- ๐ Manual
Shape
ing is here! Work in progress. - Defined by ๐
CornerSpec
and generates aSurfaceShape
. - Optionally, provide a โ
border
or ๐scaling
.
๐ฒ Peek
๐ MATERIAL
inset or "border", the size of which is set by parameter ๐ฒ Peek.peek
.
- Give special treatment, generally a thicker appearance, to selected
side(s) by passing
Peek.alignment
and tuning withPeek.ratio
.
๐ TapSpec
If the ๐ Surface
is TapSpec.tappable
then:
- ๐
TapSpec.onTap
callback becomes available. - Colors may be provided for
InkResponse
customization--thoughThemeData
defaults are accessed otherwise. - Consider a
HapticFeedback
shortcut ๐TapSpec.providesFeedback
. - Enjoy the ๐
BouncyBall
splashFactory
, pick your own, or have ๐Surface
default to yourTheme
's.
๐ฌ Filter
defines ๐คนโโ๏ธ SurfaceFX
ImageFilter
s
- In configured ๐
Filter.filteredLayers
Set
- Whose radii (strength) are mapped with ๐
Filter.radiusMap
- Whose radii (strength) are mapped with ๐
- A ๐
SurfaceLayer.BASE
filter may be extended through theSurface.margin
withFilter.extendBaseFilter
. - ๐คนโโ๏ธ
SurfaceFX typedef
for passing along your ownFilterSpec.effect
s based on ๐SurfaceLayer
and the currentLayer
'sradius
.- Default effect is a nice gaussian blur (though a
new ๐ Surface
has no active effects).
- Default effect is a nice gaussian blur (though a
๐คนโโ๏ธ FX
Open to Grow
Currently only responsible for ๐ง FX.blurry
, the default ImageFilter
for ๐ฌ Filter
.
๐ Reference
๐ Surface
- A shapeable, layered, animated container Widget
- Defined by ๐
CornerSpec
and generates aSurfaceShape
๐ฒ Peek
- An Object with optional parameters to customize a ๐ Surface
's "peek"
๐ TapSpec
- An Object with optional parameters to customize a ๐ Surface
's tap behavior
๐ฌ Filter
- An Object with optional parameters to customize a ๐ Surface
's ๐คนโโ๏ธ filters/effects
๐คนโโ๏ธ SurfaceFX typedef
for customFilterSpec.effect
s!
๐ BouncyBall
A delightfully bouncy and position-mirroring reaction to user input on a piece of Material
.
Turn ink splashes for an InkWell
, InkResponse
or material Theme
into ๐ BouncyBall
s or ๐ฎ "glass" BouncyBall
s with the built-in InteractiveInkFeatureFactory
s, or design your own with custom rubber Paint
using ๐ช BouncyBall.mold
.
๐ Just a few extra goodies for fun.
- ๐ฆ
`WithShading`
Color
extension- โฌ
`withBlack`
.withBlack(int subtract)
- โฌ
`withWhite`
.withWhite(int add)
- โฌ
- ๐ค
`DragNub`
A small, round "handle" indicator used to visualize impression of draggable material
๐ Roadmap
This is my first public package and I expect things may still be altered greatly.
- Speaking of which, an overhaul is currently ongoing as of
0.4.0
. I am still new to Dart and improving my programming. Feel absolutely free to suggest improvements or make PRs. - Since releasing
Surface
, I have found many more advanced and powerful packages. StillSurface
progress marches onward as I plan to continue development as I learn. - For example, I have already earned experience in deprecating features and "bad pushes"!
๐ณ Animations of ๐ Surface.shape
change.
โ
Differed radius on ๐ SurfaceLayer.MATERIAL
vs ๐ SurfaceLayer.BASE
Smaller inner radius gives a better aesthetic for nested shapes.๐ Manual setting ofSurface.radius
orSurface.baseRadius
available now.- ๐ Manual
Shape
ing is here! Work in progress.
โ
Proposed SurfaceCornerSpec
for Surface.corners
parameter or expansion of ๐ฐ SurfaceShape class that allows customization of all four corners independently.
- ๐ Manual
Shape
ing is here! Work in progress.
๐ Surface Example
See example usage of the ๐ Surface
package for Flutter:
- Surface Example Android source:
/example/lib/main.dart
- Animated GIF preview of Surface Example app
- Surface Example APK
๐ SOURCE FOR BACKGROUND
Libraries
- surface
- ๐ Surface Library