upgrade to flutter 3.29.2
Some checks are pending
Flutter Test / test (push) Waiting to run

This commit is contained in:
Dr.Blank 2025-04-03 23:07:00 +05:30
parent 2fd4650bb8
commit edf7b2790f
No known key found for this signature in database
GPG key ID: BA5F87FF0560C57B
9 changed files with 141 additions and 189 deletions

View file

@ -1,6 +1,7 @@
import 'dart:io';
import 'package:archive/archive_io.dart';
import 'package:flutter/foundation.dart';
import 'package:logging/logging.dart';
import 'package:path_provider/path_provider.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
@ -28,11 +29,23 @@ class Logs extends _$Logs {
}
Future<String> getZipFilePath() async {
final String targetZipPath = await generateZipFilePath();
var encoder = ZipFileEncoder();
encoder.create(await generateZipFilePath());
encoder.addFile(File(await getLoggingFilePath()));
encoder.close();
return encoder.zipPath;
encoder.create(targetZipPath);
final logFilePath = await getLoggingFilePath();
final logFile = File(logFilePath);
if (await logFile.exists()) {
// Check if log file exists before adding
await encoder.addFile(logFile);
} else {
// Handle case where log file doesn't exist? Maybe log a warning?
// Or create an empty file inside the zip? For now, just don't add.
debugPrint(
'Warning: Log file not found at $logFilePath, creating potentially empty zip.',
);
}
await encoder.close();
return targetZipPath;
}
}

View file

@ -6,7 +6,7 @@ part of 'logs_provider.dart';
// RiverpodGenerator
// **************************************************************************
String _$logsHash() => r'901376741d17ddbb889d1b7b96bc2882289720a0';
String _$logsHash() => r'aa9d3d56586cba6ddf69615320ea605d071ea5e2';
/// See also [Logs].
@ProviderFor(Logs)

View file

@ -28,64 +28,3 @@ void useTimer(VoidCallback callback, Duration delay) {
[delay],
);
}
/// Creates [FixedExtentScrollController] that will be disposed automatically.
///
/// See also:
/// - [FixedExtentScrollController]
FixedExtentScrollController useFixedExtentScrollController({
String? debugLabel,
List<Object?>? keys,
int initialItem = 0,
void Function(ScrollPosition)? onAttach,
void Function(ScrollPosition)? onDetach,
}) {
return use(
_FixedExtentScrollControllerHook(
debugLabel: debugLabel,
keys: keys,
initialItem: initialItem,
onAttach: onAttach,
onDetach: onDetach,
),
);
}
class _FixedExtentScrollControllerHook
extends Hook<FixedExtentScrollController> {
const _FixedExtentScrollControllerHook({
this.debugLabel,
super.keys,
required this.initialItem,
this.onAttach,
this.onDetach,
});
final int initialItem;
final void Function(ScrollPosition)? onAttach;
final void Function(ScrollPosition)? onDetach;
final String? debugLabel;
@override
HookState<FixedExtentScrollController, Hook<FixedExtentScrollController>>
createState() => _FixedExtentScrollControllerHookState();
}
class _FixedExtentScrollControllerHookState extends HookState<
FixedExtentScrollController, _FixedExtentScrollControllerHook> {
late final controller = FixedExtentScrollController(
initialItem: hook.initialItem,
onAttach: hook.onAttach,
onDetach: hook.onDetach,
);
@override
FixedExtentScrollController build(BuildContext context) => controller;
@override
void dispose() => controller.dispose();
@override
String get debugLabel => 'useFixedExtentScrollController';
}