weather_widget 1.0.3 weather_widget: ^1.0.3 copied to clipboard
Simple weather related controls can be freely combined to form a variety of weather dynamic effects background, or can be used as the background effect of app
weather_widget #
Simple weather related widget, which can be freely combined to form a variety of weather backgrounds
chinese 中文README
Getting Started #
depend
Add this to your package's pubspec.yaml file:
dependencies:
weather_widget: ^1.0.3
Weatherwidget is easy to use, just add weatherwidget to start using
WeatherWidget(
size:Size.infinite,
weather:'Sunny',
sunConfig:SunConfig()
),
This will add a sunny day using the default settings
or other weather type
(Note: Raindrops and snowflakes need to specify the default number, and they will move randomly within the range)
WeatherWidget(
size:Size.infinite,
weather:'Cloudy',
cloudConfig:CloudConfig()
),
WeatherWidget(
size:Size.infinite,
weather:'Rainy',
rainConfig:RainConfig(
rainNum:'the num of raindrops you want'
)
),
WeatherWidget(
size:Size.infinite,
weather:'Snowy',
snowConfig:SnowConfig(
snowNum:'the num of snowflakes you want'
)
),
WeatherWidget(
size:Size.infinite,
weather:'Thunder',
thunderConfig:ThunderConfig()
),
Of course, each config contains other settings, such as the range, size, length, falling speed and color of random raindrops. You can use them to create hailstones and other weather features
If the default weather is not enough, you can use individual widgets and stack() widget to piece together the desired weather
Like this sunset breeze, etc
These are include in this widget
background
BackgroundWidget(List<Color>,size)
cloud
CloudWidget (Color)
A single random raindrop
RainWidget (
@required rainRangeXStart, #X-axis starting point of raindrop random occurrence
@required rainRangeXEnd,
@required rainRangeYStart,
@required rainRangeYEnd,
@required durationRangeStartMill, #Minimum time to fall
@required durationRangeEndMill,
rainLength,
rainWidth,
rainColor,
rainCurve #Curve of falling animation
)
A single random snowflake
SnowWidget (
this.snowAreaXStart, #X-axis starting point of snowflake random occurrence
this.snowAreaXEnd,
this.snowWaveRangeMin, #The minimum floating distance of snowflakes
this.snowWaveRangeMax,
this.snowFallSecMin, #Minimum time of snowflake falling
this.snowFallSecMax,
this.snowWaveSecMin, #Minimum time for snowflake to float
this.snowWaveSecMax,
this.snowSize,
this.snowColor,
this.snowAreaYStart, #Y-axis point of snowflake occurrence
this.snowAreaYEnd,
this.waveCurve, #Floating animation curve
this.fadeCurve #Vanish animation curve
)
A single flash
ThunderWidget (
this.flashMillStart, #Minimum flashing time
this.flashMillEnd,
this.pauseMillStart, #Minimum interval time
this.pauseMillEnd,
this.blurStyle, #blur model
this.blurSigma,
this.points,
this.color,
this.width
)
a single wind
WindWidget (
this.pauseMillStart, #Minimum interval time
this.pauseMillEnd,
this.windPositionY, #Y-axis point of wind occurrence
this.windSlideMill, #Passing time
this.windColor,
this.windWidth,
this.windSlideXEnd,
this.windSlideXStart,
this.windGap, #line spacing in a wind
this.blurStyle,
this.blurSigma
)
Using sunny weather by set the WeatherWidget background config in a sunConfig()