switch to new bang structure

This commit is contained in:
Fabian Freund
2025-09-29 14:41:07 +02:00
parent 26c7191aa9
commit d441620580
7 changed files with 29 additions and 6 deletions
@@ -25,7 +25,7 @@ import 'package:weblibre/features/geckoview/domain/entities/browser_icon.dart';
part 'bang_data.g.dart';
@CopyWith()
@CopyWith(constructor: '_copyWith')
class BangData extends Bang {
final int frequency;
final DateTime? lastUsed;
@@ -36,6 +36,21 @@ class BangData extends Bang {
BangGroup get group => super.group!;
BangData({
required super.websiteName,
required super.domain,
required super.trigger,
required super.urlTemplate,
required super.group,
super.category,
super.subCategory,
super.format,
int? frequency,
this.lastUsed,
this.icon,
}) : frequency = frequency ?? 0;
//For some reasons including super.group breaks generation of copywith, so we have this one for now
BangData._copyWith({
required super.websiteName,
required super.domain,
required super.trigger,
@@ -105,7 +105,7 @@ class _$BangDataCWProxyImpl implements _$BangDataCWProxy {
Object? lastUsed = const $CopyWithPlaceholder(),
Object? icon = const $CopyWithPlaceholder(),
}) {
return BangData(
return BangData._copyWith(
websiteName:
websiteName == const $CopyWithPlaceholder() || websiteName == null
? _value.websiteName