feature: Improved banners, made banner settings easier to understand. (#71)

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2024-10-24 23:02:10 +02:00 committed by GitHub
parent 11e0e106d3
commit 476bdc130e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 916 additions and 666 deletions

View file

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:fladder/util/num_extension.dart';
import 'package:fladder/widgets/gapped_container_shape.dart';
import 'package:flutter/material.dart';
double normalize(double min, double max, double value) {
return (value - min) / (max - min);
@ -12,6 +13,8 @@ class FladderSlider extends StatefulWidget {
final double max;
final int? divisions;
final double thumbWidth;
final Color? activeTrackColor;
final Color? inactiveTrackColor;
final bool showThumb;
final Duration animation;
final Function(double value)? onChanged;
@ -25,6 +28,8 @@ class FladderSlider extends StatefulWidget {
this.divisions,
this.onChanged,
this.thumbWidth = 6.5,
this.activeTrackColor,
this.inactiveTrackColor,
this.showThumb = true,
this.animation = const Duration(milliseconds: 100),
this.onChangeStart,
@ -146,6 +151,8 @@ class FladderSliderState extends State<FladderSlider> with SingleTickerProviderS
height: height,
width: constraints.maxWidth,
child: GappedContainerShape(
activeColor: widget.activeTrackColor,
inActiveColor: widget.inactiveTrackColor,
thumbPosition: relativeValue,
),
),