mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
update flutter to 3.27.0 & update packages
This commit is contained in:
@@ -76,7 +76,7 @@ class _AppbarState extends State<Appbar> {
|
||||
var content = Container(
|
||||
decoration: BoxDecoration(
|
||||
color: widget.backgroundColor ??
|
||||
context.colorScheme.surface.withOpacity(0.72),
|
||||
context.colorScheme.surface.toOpacity(0.72),
|
||||
),
|
||||
height: _kAppBarHeight + context.padding.top,
|
||||
child: Row(
|
||||
@@ -219,7 +219,7 @@ class _MySliverAppBarDelegate extends SliverPersistentHeaderDelegate {
|
||||
child: BlurEffect(
|
||||
blur: 15,
|
||||
child: Material(
|
||||
color: context.colorScheme.surface.withOpacity(0.72),
|
||||
color: context.colorScheme.surface.toOpacity(0.72),
|
||||
elevation: 0,
|
||||
borderRadius: BorderRadius.circular(radius),
|
||||
child: body,
|
||||
@@ -734,6 +734,7 @@ class _SliverSearchBarDelegate extends SliverPersistentHeaderDelegate {
|
||||
icon: const Icon(Icons.clear),
|
||||
onPressed: () {
|
||||
editingController.clear();
|
||||
onChanged?.call("");
|
||||
},
|
||||
);
|
||||
},
|
||||
|
@@ -214,7 +214,7 @@ class _ButtonState extends State<Button> {
|
||||
boxShadow: (isHover && !isLoading && (widget.type == ButtonType.filled || widget.type == ButtonType.normal))
|
||||
? [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.1),
|
||||
color: Colors.black.toOpacity(0.1),
|
||||
blurRadius: 2,
|
||||
offset: const Offset(0, 1),
|
||||
)
|
||||
@@ -248,7 +248,7 @@ class _ButtonState extends State<Button> {
|
||||
if (widget.type == ButtonType.filled) {
|
||||
var color = widget.color ?? context.colorScheme.primary;
|
||||
if (isHover) {
|
||||
return color.withOpacity(0.9);
|
||||
return color.toOpacity(0.9);
|
||||
} else {
|
||||
return color;
|
||||
}
|
||||
@@ -256,13 +256,13 @@ class _ButtonState extends State<Button> {
|
||||
if (widget.type == ButtonType.normal) {
|
||||
var color = widget.color ?? context.colorScheme.surfaceContainer;
|
||||
if (isHover) {
|
||||
return color.withOpacity(0.9);
|
||||
return color.toOpacity(0.9);
|
||||
} else {
|
||||
return color;
|
||||
}
|
||||
}
|
||||
if (isHover) {
|
||||
return context.colorScheme.outline.withOpacity(0.2);
|
||||
return context.colorScheme.outline.toOpacity(0.2);
|
||||
}
|
||||
return Colors.transparent;
|
||||
}
|
||||
@@ -345,7 +345,7 @@ class _IconButtonState extends State<_IconButton> {
|
||||
? Theme.of(context)
|
||||
.colorScheme
|
||||
.outlineVariant
|
||||
.withOpacity(0.4)
|
||||
.toOpacity(0.4)
|
||||
: null,
|
||||
borderRadius: BorderRadius.circular((iconSize + 12) / 2),
|
||||
),
|
||||
|
@@ -144,7 +144,7 @@ class ComicTile extends StatelessWidget {
|
||||
if (history != null)
|
||||
Container(
|
||||
height: 24,
|
||||
color: Colors.blue.withOpacity(0.9),
|
||||
color: Colors.blue.toOpacity(0.9),
|
||||
constraints: const BoxConstraints(minWidth: 24),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: CustomPaint(
|
||||
@@ -293,7 +293,7 @@ class ComicTile extends StatelessWidget {
|
||||
Radius.circular(10.0),
|
||||
),
|
||||
child: Container(
|
||||
color: Colors.black.withOpacity(0.5),
|
||||
color: Colors.black.toOpacity(0.5),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.fromLTRB(8, 6, 8, 6),
|
||||
@@ -475,7 +475,7 @@ class _ComicDescription extends StatelessWidget {
|
||||
subtitle,
|
||||
style: TextStyle(
|
||||
fontSize: 10.0,
|
||||
color: context.colorScheme.onSurface.withOpacity(0.7)),
|
||||
color: context.colorScheme.onSurface.toOpacity(0.7)),
|
||||
maxLines: 1,
|
||||
softWrap: true,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@@ -780,7 +780,7 @@ class _SliverGridComics extends StatelessWidget {
|
||||
duration: const Duration(milliseconds: 150),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected
|
||||
? Theme.of(context).colorScheme.secondaryContainer.withOpacity(0.72)
|
||||
? Theme.of(context).colorScheme.secondaryContainer.toOpacity(0.72)
|
||||
: null,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
|
@@ -1,5 +1,3 @@
|
||||
library components;
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:collection';
|
||||
import 'dart:math' as math;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:venera/foundation/app.dart';
|
||||
|
||||
/// patched slider.dart with RtL support
|
||||
class _SliderDefaultsM3 extends SliderThemeData {
|
||||
@@ -15,45 +16,45 @@ class _SliderDefaultsM3 extends SliderThemeData {
|
||||
Color? get inactiveTrackColor => _colors.surfaceContainerHighest;
|
||||
|
||||
@override
|
||||
Color? get secondaryActiveTrackColor => _colors.primary.withOpacity(0.54);
|
||||
Color? get secondaryActiveTrackColor => _colors.primary.toOpacity(0.54);
|
||||
|
||||
@override
|
||||
Color? get disabledActiveTrackColor => _colors.onSurface.withOpacity(0.38);
|
||||
Color? get disabledActiveTrackColor => _colors.onSurface.toOpacity(0.38);
|
||||
|
||||
@override
|
||||
Color? get disabledInactiveTrackColor => _colors.onSurface.withOpacity(0.12);
|
||||
Color? get disabledInactiveTrackColor => _colors.onSurface.toOpacity(0.12);
|
||||
|
||||
@override
|
||||
Color? get disabledSecondaryActiveTrackColor => _colors.onSurface.withOpacity(0.12);
|
||||
Color? get disabledSecondaryActiveTrackColor => _colors.onSurface.toOpacity(0.12);
|
||||
|
||||
@override
|
||||
Color? get activeTickMarkColor => _colors.onPrimary.withOpacity(0.38);
|
||||
Color? get activeTickMarkColor => _colors.onPrimary.toOpacity(0.38);
|
||||
|
||||
@override
|
||||
Color? get inactiveTickMarkColor => _colors.onSurfaceVariant.withOpacity(0.38);
|
||||
Color? get inactiveTickMarkColor => _colors.onSurfaceVariant.toOpacity(0.38);
|
||||
|
||||
@override
|
||||
Color? get disabledActiveTickMarkColor => _colors.onSurface.withOpacity(0.38);
|
||||
Color? get disabledActiveTickMarkColor => _colors.onSurface.toOpacity(0.38);
|
||||
|
||||
@override
|
||||
Color? get disabledInactiveTickMarkColor => _colors.onSurface.withOpacity(0.38);
|
||||
Color? get disabledInactiveTickMarkColor => _colors.onSurface.toOpacity(0.38);
|
||||
|
||||
@override
|
||||
Color? get thumbColor => _colors.primary;
|
||||
|
||||
@override
|
||||
Color? get disabledThumbColor => Color.alphaBlend(_colors.onSurface.withOpacity(0.38), _colors.surface);
|
||||
Color? get disabledThumbColor => Color.alphaBlend(_colors.onSurface.toOpacity(0.38), _colors.surface);
|
||||
|
||||
@override
|
||||
Color? get overlayColor => WidgetStateColor.resolveWith((Set<WidgetState> states) {
|
||||
if (states.contains(WidgetState.dragged)) {
|
||||
return _colors.primary.withOpacity(0.1);
|
||||
return _colors.primary.toOpacity(0.1);
|
||||
}
|
||||
if (states.contains(WidgetState.hovered)) {
|
||||
return _colors.primary.withOpacity(0.08);
|
||||
return _colors.primary.toOpacity(0.08);
|
||||
}
|
||||
if (states.contains(WidgetState.focused)) {
|
||||
return _colors.primary.withOpacity(0.1);
|
||||
return _colors.primary.toOpacity(0.1);
|
||||
}
|
||||
|
||||
return Colors.transparent;
|
||||
|
@@ -141,7 +141,7 @@ class FlyoutState extends State<Flyout> {
|
||||
animation: animation,
|
||||
builder: (context, builder) {
|
||||
return ColoredBox(
|
||||
color: Colors.black.withOpacity(0.3 * animation.value),
|
||||
color: Colors.black.toOpacity(0.3 * animation.value),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -185,12 +185,18 @@ class FlyoutContent extends StatelessWidget {
|
||||
child: Material(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
type: MaterialType.card,
|
||||
color: context.colorScheme.surface.withOpacity(0.82),
|
||||
color: context.colorScheme.surface.toOpacity(0.82),
|
||||
child: Container(
|
||||
constraints: const BoxConstraints(
|
||||
minWidth: minFlyoutWidth,
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: context.brightness == ui.Brightness.dark
|
||||
? Border.all(color: context.colorScheme.outlineVariant)
|
||||
: null,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -215,108 +221,3 @@ class FlyoutContent extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class FlyoutTextButton extends StatefulWidget {
|
||||
const FlyoutTextButton(
|
||||
{super.key,
|
||||
required this.child,
|
||||
required this.flyoutBuilder,
|
||||
this.navigator});
|
||||
|
||||
final Widget child;
|
||||
|
||||
final WidgetBuilder flyoutBuilder;
|
||||
|
||||
final NavigatorState? navigator;
|
||||
|
||||
@override
|
||||
State<FlyoutTextButton> createState() => _FlyoutTextButtonState();
|
||||
}
|
||||
|
||||
class _FlyoutTextButtonState extends State<FlyoutTextButton> {
|
||||
final FlyoutController _controller = FlyoutController();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Flyout(
|
||||
controller: _controller,
|
||||
flyoutBuilder: widget.flyoutBuilder,
|
||||
navigator: widget.navigator,
|
||||
child: TextButton(
|
||||
onPressed: () {
|
||||
_controller.show();
|
||||
},
|
||||
child: widget.child,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
class FlyoutIconButton extends StatefulWidget {
|
||||
const FlyoutIconButton(
|
||||
{super.key,
|
||||
required this.icon,
|
||||
required this.flyoutBuilder,
|
||||
this.navigator});
|
||||
|
||||
final Widget icon;
|
||||
|
||||
final WidgetBuilder flyoutBuilder;
|
||||
|
||||
final NavigatorState? navigator;
|
||||
|
||||
@override
|
||||
State<FlyoutIconButton> createState() => _FlyoutIconButtonState();
|
||||
}
|
||||
|
||||
class _FlyoutIconButtonState extends State<FlyoutIconButton> {
|
||||
final FlyoutController _controller = FlyoutController();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Flyout(
|
||||
controller: _controller,
|
||||
flyoutBuilder: widget.flyoutBuilder,
|
||||
navigator: widget.navigator,
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
_controller.show();
|
||||
},
|
||||
icon: widget.icon,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
class FlyoutFilledButton extends StatefulWidget {
|
||||
const FlyoutFilledButton(
|
||||
{super.key,
|
||||
required this.child,
|
||||
required this.flyoutBuilder,
|
||||
this.navigator});
|
||||
|
||||
final Widget child;
|
||||
|
||||
final WidgetBuilder flyoutBuilder;
|
||||
|
||||
final NavigatorState? navigator;
|
||||
|
||||
@override
|
||||
State<FlyoutFilledButton> createState() => _FlyoutFilledButtonState();
|
||||
}
|
||||
|
||||
class _FlyoutFilledButtonState extends State<FlyoutFilledButton> {
|
||||
final FlyoutController _controller = FlyoutController();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Flyout(
|
||||
controller: _controller,
|
||||
flyoutBuilder: widget.flyoutBuilder,
|
||||
navigator: widget.navigator,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
_controller.show();
|
||||
},
|
||||
child: widget.child,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@@ -20,6 +20,8 @@ class _MenuRoute<T> extends PopupRoute<T> {
|
||||
@override
|
||||
String? get barrierLabel => "menu";
|
||||
|
||||
double get entryHeight => App.isMobile ? 42 : 36;
|
||||
|
||||
@override
|
||||
Widget buildPage(BuildContext context, Animation<double> animation,
|
||||
Animation<double> secondaryAnimation) {
|
||||
@@ -30,7 +32,7 @@ class _MenuRoute<T> extends PopupRoute<T> {
|
||||
left = size.width - width - 10;
|
||||
}
|
||||
var top = location.dy;
|
||||
var height = 16 + 32 * entries.length;
|
||||
var height = 16 + entryHeight * entries.length;
|
||||
if (top + height > size.height - 15) {
|
||||
top = size.height - height - 15;
|
||||
}
|
||||
@@ -47,7 +49,7 @@ class _MenuRoute<T> extends PopupRoute<T> {
|
||||
: null,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: context.colorScheme.shadow.withOpacity(0.2),
|
||||
color: context.colorScheme.shadow.toOpacity(0.2),
|
||||
blurRadius: 8,
|
||||
blurStyle: BlurStyle.outer,
|
||||
),
|
||||
@@ -56,7 +58,7 @@ class _MenuRoute<T> extends PopupRoute<T> {
|
||||
child: BlurEffect(
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
child: Material(
|
||||
color: context.colorScheme.surface.withOpacity(0.78),
|
||||
color: context.colorScheme.surface.toOpacity(0.78),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
child: Container(
|
||||
width: width,
|
||||
@@ -84,7 +86,7 @@ class _MenuRoute<T> extends PopupRoute<T> {
|
||||
entry.onClick();
|
||||
},
|
||||
child: SizedBox(
|
||||
height: App.isMobile ? 42 : 36,
|
||||
height: entryHeight,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
child: Row(
|
||||
|
@@ -563,7 +563,7 @@ class _VirtualWindowFrameState extends State<VirtualWindowFrame>
|
||||
boxShadow: <BoxShadow>[
|
||||
if (!_isMaximized && !_isFullScreen)
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.1),
|
||||
color: Colors.black.toOpacity(0.1),
|
||||
offset: Offset(0.0, _isFocused ? 4 : 2),
|
||||
blurRadius: 6,
|
||||
)
|
||||
|
Reference in New Issue
Block a user