intermediate

This commit is contained in:
Fabian Freund
2025-01-07 00:06:31 +01:00
parent ea0880b97a
commit 4a2191b01d
84 changed files with 2655 additions and 1383 deletions
@@ -12,16 +12,14 @@ import 'package:lensai/features/geckoview/domain/entities/security_state.dart';
part 'tab_state.g.dart';
@CopyWith()
class TabState with FastEquatable implements WebPageInfo {
class TabState extends WebPageInfo with FastEquatable {
@CopyWithField(immutable: true)
final String id;
final String? contextId;
@override
final Uri url;
@override
final String title;
String get title => super.title!;
final EquatableImage? icon;
@@ -50,8 +48,8 @@ class TabState with FastEquatable implements WebPageInfo {
TabState({
required this.id,
required this.contextId,
required this.url,
required this.title,
required super.url,
required String title,
required this.icon,
required this.thumbnail,
required this.progress,
@@ -62,7 +60,7 @@ class TabState with FastEquatable implements WebPageInfo {
required this.historyState,
required this.readerableState,
required this.findResultState,
});
}) : super(title: title);
factory TabState.$default(String tabId) => TabState(
id: tabId,
@@ -36,8 +36,8 @@ class TabStates extends _$TabStates {
);
}
Future<void> _onIconChange(IconEvent event) async {
final IconEvent(:tabId, :bytes) = event;
Future<void> _onIconChange(IconChangeEvent event) async {
final IconChangeEvent(:tabId, :bytes) = event;
final image = (bytes != null)
? (await tryDecodeImage(bytes)
@@ -131,7 +131,7 @@ class TabStates extends _$TabStates {
await _lock.synchronized(() => _onTabContentStateChange(event));
},
),
eventService.iconEvents.listen(
eventService.iconChangeEvents.listen(
(event) async {
await _lock.synchronized(() => _onIconChange(event));
},
@@ -173,7 +173,7 @@ final selectedTabStateProvider = AutoDisposeProvider<TabState?>.internal(
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
typedef SelectedTabStateRef = AutoDisposeProviderRef<TabState?>;
String _$tabStatesHash() => r'dcd293279a901eeaab7728979e39e5ca3bee8c66';
String _$tabStatesHash() => r'77f07f330dfac8dc8d28d18737203c7c122f3b74';
/// See also [TabStates].
@ProviderFor(TabStates)