update flutter to 3.27.0 & update packages

This commit is contained in:
2024-12-12 16:41:42 +08:00
parent c2cfd066f6
commit e4e2d264f5
31 changed files with 172 additions and 266 deletions

View File

@@ -592,12 +592,16 @@ class _ReorderComicsPageState extends State<_ReorderComicsPage> {
late var comics = LocalFavoritesManager().getAllComics(widget.name);
bool changed = false;
Color lightenColor(Color color, double lightenValue) {
int red = (color.red + ((255 - color.red) * lightenValue)).round();
int green = (color.green + ((255 - color.green) * lightenValue)).round();
int blue = (color.blue + ((255 - color.blue) * lightenValue)).round();
static int _floatToInt8(double x) {
return (x * 255.0).round() & 0xff;
}
return Color.fromARGB(color.alpha, red, green, blue);
Color lightenColor(Color color, double lightenValue) {
int red = (_floatToInt8(color.r) + ((255 - color.r) * lightenValue)).round();
int green = (_floatToInt8(color.g) * 255 + ((255 - color.g) * lightenValue)).round();
int blue = (_floatToInt8(color.b) * 255 + ((255 - color.b) * lightenValue)).round();
return Color.fromARGB(_floatToInt8(color.a), red, green, blue);
}
@override
@@ -650,7 +654,7 @@ class _ReorderComicsPageState extends State<_ReorderComicsPage> {
),
],
),
body: ReorderableBuilder(
body: ReorderableBuilder<FavoriteItem>(
key: reorderWidgetKey,
scrollController: _scrollController,
longPressDelay: App.isDesktop
@@ -659,14 +663,14 @@ class _ReorderComicsPageState extends State<_ReorderComicsPage> {
onReorder: (reorderFunc) {
changed = true;
setState(() {
comics = reorderFunc(comics) as List<FavoriteItem>;
comics = reorderFunc(comics);
});
widget.onReorder(comics);
},
dragChildBoxDecoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
color: lightenColor(
Theme.of(context).splashColor.withOpacity(1),
Theme.of(context).splashColor.withAlpha(255),
0.2,
),
),