Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-01-15 18:19:51 +08:00
parent 25148509d2
commit d2f8aff421
21 changed files with 217 additions and 142 deletions

View File

@@ -0,0 +1,63 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
Future<TimeOfDay?> showTimePicker({
required BuildContext context,
required TimeOfDay initialTime,
TransitionBuilder? builder,
bool barrierDismissible = true,
Color? barrierColor,
String? barrierLabel,
bool useRootNavigator = true,
TimePickerEntryMode initialEntryMode = TimePickerEntryMode.dial,
String? cancelText,
String? confirmText,
String? helpText,
String? errorInvalidText,
String? hourLabelText,
String? minuteLabelText,
RouteSettings? routeSettings,
EntryModeChangeCallback? onEntryModeChanged,
Offset? anchorPoint,
Orientation? orientation,
Icon? switchToInputEntryModeIcon,
Icon? switchToTimerEntryModeIcon,
bool emptyInitialInput = false,
BoxConstraints? constraints,
}) {
assert(debugCheckHasMaterialLocalizations(context));
final Widget dialog = DialogTheme(
data: const DialogThemeData(constraints: BoxConstraints(minWidth: 280.0)),
child: TimePickerDialog(
initialTime: initialTime,
initialEntryMode: initialEntryMode,
cancelText: cancelText,
confirmText: confirmText,
helpText: helpText,
errorInvalidText: errorInvalidText,
hourLabelText: hourLabelText,
minuteLabelText: minuteLabelText,
orientation: orientation,
onEntryModeChanged: onEntryModeChanged,
switchToInputEntryModeIcon: switchToInputEntryModeIcon,
switchToTimerEntryModeIcon: switchToTimerEntryModeIcon,
emptyInitialInput: emptyInitialInput,
),
);
return showDialog<TimeOfDay>(
context: context,
barrierDismissible: barrierDismissible,
barrierColor: barrierColor,
barrierLabel: barrierLabel,
useRootNavigator: useRootNavigator,
builder: (BuildContext context) {
return builder == null ? dialog : builder(context, dialog);
},
routeSettings: routeSettings,
anchorPoint: anchorPoint,
);
}

View File

@@ -327,7 +327,12 @@ class _CustomGridViewDelegate extends MultiChildLayoutDelegate {
@override
void performLayout(Size size) {
final constraints = BoxConstraints.expand(width: width, height: height);
final constraints = BoxConstraints(
minWidth: width,
maxWidth: width,
minHeight: height,
maxHeight: height,
);
for (int i = 0; i < itemCount; i++) {
layoutChild(i, constraints);
positionChild(

View File

@@ -124,9 +124,11 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
..removeListener(listener)
..dispose();
_transformationController.dispose();
for (final item in widget.sources) {
if (item.sourceType == SourceType.networkImage) {
CachedNetworkImageProvider(_getActualUrl(item.url)).evict();
if (widget.quality != _quality) {
for (final item in widget.sources) {
if (item.sourceType == SourceType.networkImage) {
CachedNetworkImageProvider(_getActualUrl(item.url)).evict();
}
}
}
super.dispose();