From 27d3c472ab8f2fd52aa7eec69f7b6043879020f7 Mon Sep 17 00:00:00 2001 From: Marcin Stepnowski Date: Thu, 2 Jan 2025 10:09:32 +0100 Subject: [PATCH 1/5] Remove generated files from repository --- lib/analytics/analytics_parameters.g.dart | 59 --- lib/data/pola_api_service.chopper.dart | 38 -- lib/i18n/strings.g.dart | 251 ------------- lib/models/brand.g.dart | 17 - lib/models/company.g.dart | 47 --- lib/models/donate.g.dart | 19 - lib/models/report.g.dart | 19 - lib/models/search_result.g.dart | 40 -- lib/pages/menu/version_bloc.freezed.dart | 283 -------------- lib/pages/scan/scan_event.freezed.dart | 437 ---------------------- lib/pages/scan/scan_state.freezed.dart | 207 ---------- lib/theme/assets.gen.dart | 297 --------------- lib/theme/fonts.gen.dart | 18 - 13 files changed, 1732 deletions(-) delete mode 100644 lib/analytics/analytics_parameters.g.dart delete mode 100644 lib/data/pola_api_service.chopper.dart delete mode 100644 lib/i18n/strings.g.dart delete mode 100644 lib/models/brand.g.dart delete mode 100644 lib/models/company.g.dart delete mode 100644 lib/models/donate.g.dart delete mode 100644 lib/models/report.g.dart delete mode 100644 lib/models/search_result.g.dart delete mode 100644 lib/pages/menu/version_bloc.freezed.dart delete mode 100644 lib/pages/scan/scan_event.freezed.dart delete mode 100644 lib/pages/scan/scan_state.freezed.dart delete mode 100644 lib/theme/assets.gen.dart delete mode 100644 lib/theme/fonts.gen.dart diff --git a/lib/analytics/analytics_parameters.g.dart b/lib/analytics/analytics_parameters.g.dart deleted file mode 100644 index 1b55108..0000000 --- a/lib/analytics/analytics_parameters.g.dart +++ /dev/null @@ -1,59 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'analytics_parameters.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -Map _$AnalyticsScanCodeParametersToJson( - AnalyticsScanCodeParameters instance) => - { - 'code': instance.code, - 'source': instance.source, - }; - -Map _$AnalyticsAboutParametersToJson( - AnalyticsAboutParameters instance) => - { - 'item': instance.item, - }; - -Map _$AnalyticsProductResultParametersToJson( - AnalyticsProductResultParameters instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('code', instance.code); - writeNotNull('company', instance.company); - writeNotNull('product_id', instance.productId); - return val; -} - -Map _$AnalyticsReadMoreParametersToJson( - AnalyticsReadMoreParameters instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('code', instance.code); - writeNotNull('company', instance.company); - writeNotNull('product_id', instance.productId); - val['url'] = instance.url; - return val; -} - -Map _$AnalyticsMainTabParametersToJson( - AnalyticsMainTabParameters instance) => - { - 'tab': instance.tab, - }; diff --git a/lib/data/pola_api_service.chopper.dart b/lib/data/pola_api_service.chopper.dart deleted file mode 100644 index 85fc93c..0000000 --- a/lib/data/pola_api_service.chopper.dart +++ /dev/null @@ -1,38 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'pola_api_service.dart'; - -// ************************************************************************** -// ChopperGenerator -// ************************************************************************** - -// coverage:ignore-file -// ignore_for_file: type=lint -final class _$PolaApiService extends PolaApiService { - _$PolaApiService([ChopperClient? client]) { - if (client == null) return; - this.client = client; - } - - @override - final Type definitionType = PolaApiService; - - @override - Future> getCompany( - String code, - String deviceId, - ) { - final Uri $url = Uri.parse('a/v4/get_by_code'); - final Map $params = { - 'code': code, - 'device_id': deviceId, - }; - final Request $request = Request( - 'GET', - $url, - client.baseUrl, - parameters: $params, - ); - return client.send($request); - } -} diff --git a/lib/i18n/strings.g.dart b/lib/i18n/strings.g.dart deleted file mode 100644 index 229f9cb..0000000 --- a/lib/i18n/strings.g.dart +++ /dev/null @@ -1,251 +0,0 @@ -/// Generated file. Do not edit. -/// -/// Original: lib/i18n -/// To regenerate, run: `dart run slang` -/// -/// Locales: 1 -/// Strings: 30 -/// -/// Built on 2024-11-10 at 12:26 UTC - -// coverage:ignore-file -// ignore_for_file: type=lint - -import 'package:flutter/widgets.dart'; -import 'package:slang/builder/model/node.dart'; -import 'package:slang_flutter/slang_flutter.dart'; -export 'package:slang_flutter/slang_flutter.dart'; - -const AppLocale _baseLocale = AppLocale.en; - -/// Supported locales, see extension methods below. -/// -/// Usage: -/// - LocaleSettings.setLocale(AppLocale.en) // set locale -/// - Locale locale = AppLocale.en.flutterLocale // get flutter locale from enum -/// - if (LocaleSettings.currentLocale == AppLocale.en) // locale check -enum AppLocale with BaseAppLocale { - en(languageCode: 'en', build: Translations.build); - - const AppLocale({required this.languageCode, this.scriptCode, this.countryCode, required this.build}); // ignore: unused_element - - @override final String languageCode; - @override final String? scriptCode; - @override final String? countryCode; - @override final TranslationBuilder build; - - /// Gets current instance managed by [LocaleSettings]. - Translations get translations => LocaleSettings.instance.translationMap[this]!; -} - -/// Method A: Simple -/// -/// No rebuild after locale change. -/// Translation happens during initialization of the widget (call of t). -/// Configurable via 'translate_var'. -/// -/// Usage: -/// String a = t.someKey.anotherKey; -/// String b = t['someKey.anotherKey']; // Only for edge cases! -Translations get t => LocaleSettings.instance.currentTranslations; - -/// Method B: Advanced -/// -/// All widgets using this method will trigger a rebuild when locale changes. -/// Use this if you have e.g. a settings page where the user can select the locale during runtime. -/// -/// Step 1: -/// wrap your App with -/// TranslationProvider( -/// child: MyApp() -/// ); -/// -/// Step 2: -/// final t = Translations.of(context); // Get t variable. -/// String a = t.someKey.anotherKey; // Use t variable. -/// String b = t['someKey.anotherKey']; // Only for edge cases! -class TranslationProvider extends BaseTranslationProvider { - TranslationProvider({required super.child}) : super(settings: LocaleSettings.instance); - - static InheritedLocaleData of(BuildContext context) => InheritedLocaleData.of(context); -} - -/// Method B shorthand via [BuildContext] extension method. -/// Configurable via 'translate_var'. -/// -/// Usage (e.g. in a widget's build method): -/// context.t.someKey.anotherKey -extension BuildContextTranslationsExtension on BuildContext { - Translations get t => TranslationProvider.of(this).translations; -} - -/// Manages all translation instances and the current locale -class LocaleSettings extends BaseFlutterLocaleSettings { - LocaleSettings._() : super(utils: AppLocaleUtils.instance); - - static final instance = LocaleSettings._(); - - // static aliases (checkout base methods for documentation) - static AppLocale get currentLocale => instance.currentLocale; - static Stream getLocaleStream() => instance.getLocaleStream(); - static AppLocale setLocale(AppLocale locale, {bool? listenToDeviceLocale = false}) => instance.setLocale(locale, listenToDeviceLocale: listenToDeviceLocale); - static AppLocale setLocaleRaw(String rawLocale, {bool? listenToDeviceLocale = false}) => instance.setLocaleRaw(rawLocale, listenToDeviceLocale: listenToDeviceLocale); - static AppLocale useDeviceLocale() => instance.useDeviceLocale(); - @Deprecated('Use [AppLocaleUtils.supportedLocales]') static List get supportedLocales => instance.supportedLocales; - @Deprecated('Use [AppLocaleUtils.supportedLocalesRaw]') static List get supportedLocalesRaw => instance.supportedLocalesRaw; - static void setPluralResolver({String? language, AppLocale? locale, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver}) => instance.setPluralResolver( - language: language, - locale: locale, - cardinalResolver: cardinalResolver, - ordinalResolver: ordinalResolver, - ); -} - -/// Provides utility functions without any side effects. -class AppLocaleUtils extends BaseAppLocaleUtils { - AppLocaleUtils._() : super(baseLocale: _baseLocale, locales: AppLocale.values); - - static final instance = AppLocaleUtils._(); - - // static aliases (checkout base methods for documentation) - static AppLocale parse(String rawLocale) => instance.parse(rawLocale); - static AppLocale parseLocaleParts({required String languageCode, String? scriptCode, String? countryCode}) => instance.parseLocaleParts(languageCode: languageCode, scriptCode: scriptCode, countryCode: countryCode); - static AppLocale findDeviceLocale() => instance.findDeviceLocale(); - static List get supportedLocales => instance.supportedLocales; - static List get supportedLocalesRaw => instance.supportedLocalesRaw; -} - -// translations - -// Path: -class Translations implements BaseTranslations { - /// Returns the current translations of the given [context]. - /// - /// Usage: - /// final t = Translations.of(context); - static Translations of(BuildContext context) => InheritedLocaleData.of(context).translations; - - /// You can call this constructor and build your own translation instance of this locale. - /// Constructing via the enum [AppLocale.build] is preferred. - Translations.build({Map? overrides, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver}) - : assert(overrides == null, 'Set "translation_overrides: true" in order to enable this feature.'), - $meta = TranslationMetadata( - locale: AppLocale.en, - overrides: overrides ?? {}, - cardinalResolver: cardinalResolver, - ordinalResolver: ordinalResolver, - ) { - $meta.setFlatMapFunction(_flatMapFunction); - } - - /// Metadata for the translations of . - @override final TranslationMetadata $meta; - - /// Access flat map - dynamic operator[](String key) => $meta.getTranslation(key); - - late final Translations _root = this; // ignore: unused_field - - // Translations - late final _StringsMenuEn menu = _StringsMenuEn._(_root); - late final _StringsCompanyScreenEn companyScreen = _StringsCompanyScreenEn._(_root); - late final _StringsScanEn scan = _StringsScanEn._(_root); -} - -// Path: menu -class _StringsMenuEn { - _StringsMenuEn._(this._root); - - final Translations _root; // ignore: unused_field - - // Translations - String get aboutPola => 'O aplikacji Pola'; - String get aboutClub => ' O Klubie Jagielońskim'; - String get instruction => 'Jak oceniamy Firmy'; - String get partners => 'Partnerzy'; - String get polasFriends => 'Przyjaciele Poli'; - String get rateUS => 'Oceń Polę'; - String get team => 'Zespół'; - String get findUs => 'Znajdź nas tutaj'; - String get footer => 'Aplikacja Pola \n© Klub Jagielloński'; -} - -// Path: companyScreen -class _StringsCompanyScreenEn { - _StringsCompanyScreenEn._(this._root); - - final Translations _root; // ignore: unused_field - - // Translations - String get ourRating => 'Nasza ocena:'; - String get gradingCriteria => 'Kryteria oceniania:'; - String get polishCapital => 'Polski kapitał'; - String get producedInPoland => 'Produkuje w Polsce'; - String get researchInPoland => 'Prowadzi badania w Polsce'; - String get registeredInPoland => 'Zarejestrowana w Polsce'; - String get notConcernPart => 'Nie jest częścią zagranicznego koncernu'; - String get seeMore => ' zobacz więcej'; - String get seeLess => ' zobacz mniej'; - String points({required Object score}) => '${score} pkt'; - String get companyFriend => ' Ta firma jest przyjacielem Poli'; - String get polaFriends => 'Przyjaciele Poli'; - String get companyUnverified => 'Niestety, ta firma nie została jeszcze zweryfikowana, więc nie możemy wyświetlić jej oceny. Stale rozszerzamy naszą bazę, aby uwzględnić więcej firm.'; - String get thankYou => 'Dziękujemy za cierpliwość!'; -} - -// Path: scan -class _StringsScanEn { - _StringsScanEn._(this._root); - - final Translations _root; // ignore: unused_field - - // Translations - String get scanning => 'Skanowanie'; - String get tryAgain => 'Niestety nie udało się pobrać danych. Spróbuj ponownie.'; - String get pkt => ' pkt'; - String get wait => 'Proszę czekać, trwa Ładowanie...'; - String get lastScans => 'Ostatnie skany:'; - String get error => 'Wystąpił błąd'; - String get closeError => 'Zamknij.'; -} - -/// Flat map(s) containing all translations. -/// Only for edge cases! For simple maps, use the map function of this library. - -extension on Translations { - dynamic _flatMapFunction(String path) { - switch (path) { - case 'menu.aboutPola': return 'O aplikacji Pola'; - case 'menu.aboutClub': return ' O Klubie Jagielońskim'; - case 'menu.instruction': return 'Jak oceniamy Firmy'; - case 'menu.partners': return 'Partnerzy'; - case 'menu.polasFriends': return 'Przyjaciele Poli'; - case 'menu.rateUS': return 'Oceń Polę'; - case 'menu.team': return 'Zespół'; - case 'menu.findUs': return 'Znajdź nas tutaj'; - case 'menu.footer': return 'Aplikacja Pola \n© Klub Jagielloński'; - case 'companyScreen.ourRating': return 'Nasza ocena:'; - case 'companyScreen.gradingCriteria': return 'Kryteria oceniania:'; - case 'companyScreen.polishCapital': return 'Polski kapitał'; - case 'companyScreen.producedInPoland': return 'Produkuje w Polsce'; - case 'companyScreen.researchInPoland': return 'Prowadzi badania w Polsce'; - case 'companyScreen.registeredInPoland': return 'Zarejestrowana w Polsce'; - case 'companyScreen.notConcernPart': return 'Nie jest częścią zagranicznego koncernu'; - case 'companyScreen.seeMore': return ' zobacz więcej'; - case 'companyScreen.seeLess': return ' zobacz mniej'; - case 'companyScreen.points': return ({required Object score}) => '${score} pkt'; - case 'companyScreen.companyFriend': return ' Ta firma jest przyjacielem Poli'; - case 'companyScreen.polaFriends': return 'Przyjaciele Poli'; - case 'companyScreen.companyUnverified': return 'Niestety, ta firma nie została jeszcze zweryfikowana, więc nie możemy wyświetlić jej oceny. Stale rozszerzamy naszą bazę, aby uwzględnić więcej firm.'; - case 'companyScreen.thankYou': return 'Dziękujemy za cierpliwość!'; - case 'scan.scanning': return 'Skanowanie'; - case 'scan.tryAgain': return 'Niestety nie udało się pobrać danych. Spróbuj ponownie.'; - case 'scan.pkt': return ' pkt'; - case 'scan.wait': return 'Proszę czekać, trwa Ładowanie...'; - case 'scan.lastScans': return 'Ostatnie skany:'; - case 'scan.error': return 'Wystąpił błąd'; - case 'scan.closeError': return 'Zamknij.'; - default: return null; - } - } -} diff --git a/lib/models/brand.g.dart b/lib/models/brand.g.dart deleted file mode 100644 index 7a0531c..0000000 --- a/lib/models/brand.g.dart +++ /dev/null @@ -1,17 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'brand.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -Brand _$BrandFromJson(Map json) => Brand( - name: json['name'] as String?, - logotypeUrl: json['logotype_url'] as String?, - ); - -Map _$BrandToJson(Brand instance) => { - 'name': instance.name, - 'logotype_url': instance.logotypeUrl, - }; diff --git a/lib/models/company.g.dart b/lib/models/company.g.dart deleted file mode 100644 index 2aafeed..0000000 --- a/lib/models/company.g.dart +++ /dev/null @@ -1,47 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'company.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -Company _$CompanyFromJson(Map json) => Company( - name: json['name'] as String?, - plCapital: (json['plCapital'] as num?)?.toInt(), - plCapitalNotes: json['plCapitalNotes'] as String?, - plWorkers: (json['plWorkers'] as num?)?.toInt(), - plWorkersNotes: json['plWorkersNotes'] as String?, - plRnD: (json['plRnD'] as num?)?.toInt(), - plRnDNotes: json['plRnDNotes'] as String?, - plRegistered: (json['plRegistered'] as num?)?.toInt(), - plRegisteredNotes: json['plRegisteredNotes'] as String?, - plNotGlobEnt: (json['plNotGlobEnt'] as num?)?.toInt(), - plNotGlobEntNotes: json['plNotGlobEntNotes'] as String?, - plScore: (json['plScore'] as num?)?.toInt(), - isFriend: json['is_friend'] as bool?, - friendText: json['friend_text'] as String?, - description: json['description'] as String?, - logotypeUrl: json['logotype_url'] as String?, - officialUrl: json['official_url'] as String?, - ); - -Map _$CompanyToJson(Company instance) => { - 'name': instance.name, - 'plCapital': instance.plCapital, - 'plCapitalNotes': instance.plCapitalNotes, - 'plWorkers': instance.plWorkers, - 'plWorkersNotes': instance.plWorkersNotes, - 'plRnD': instance.plRnD, - 'plRnDNotes': instance.plRnDNotes, - 'plRegistered': instance.plRegistered, - 'plRegisteredNotes': instance.plRegisteredNotes, - 'plNotGlobEnt': instance.plNotGlobEnt, - 'plNotGlobEntNotes': instance.plNotGlobEntNotes, - 'plScore': instance.plScore, - 'is_friend': instance.isFriend, - 'friend_text': instance.friendText, - 'description': instance.description, - 'logotype_url': instance.logotypeUrl, - 'official_url': instance.officialUrl, - }; diff --git a/lib/models/donate.g.dart b/lib/models/donate.g.dart deleted file mode 100644 index 5b9e093..0000000 --- a/lib/models/donate.g.dart +++ /dev/null @@ -1,19 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'donate.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -Donate _$DonateFromJson(Map json) => Donate( - showButton: json['show_button'] as bool, - url: json['url'] as String, - title: json['title'] as String, - ); - -Map _$DonateToJson(Donate instance) => { - 'show_button': instance.showButton, - 'url': instance.url, - 'title': instance.title, - }; diff --git a/lib/models/report.g.dart b/lib/models/report.g.dart deleted file mode 100644 index 296cd65..0000000 --- a/lib/models/report.g.dart +++ /dev/null @@ -1,19 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'report.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -Report _$ReportFromJson(Map json) => Report( - text: json['text'] as String?, - buttonText: json['button_text'] as String?, - buttonType: json['button_type'] as String?, - ); - -Map _$ReportToJson(Report instance) => { - 'text': instance.text, - 'button_text': instance.buttonText, - 'button_type': instance.buttonType, - }; diff --git a/lib/models/search_result.g.dart b/lib/models/search_result.g.dart deleted file mode 100644 index 92df926..0000000 --- a/lib/models/search_result.g.dart +++ /dev/null @@ -1,40 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'search_result.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -SearchResult _$SearchResultFromJson(Map json) => SearchResult( - productId: (json['product_id'] as num?)?.toInt(), - code: json['code'] as String?, - name: json['name'] as String?, - cardType: json['card_type'] as String?, - altText: json['altText'] as String?, - companies: (json['companies'] as List?) - ?.map((e) => Company.fromJson(e as Map)) - .toList(), - report: json['report'] == null - ? null - : Report.fromJson(json['report'] as Map), - donate: json['donate'] == null - ? null - : Donate.fromJson(json['donate'] as Map), - allCompanyBrands: (json['all_company_brands'] as List?) - ?.map((e) => Brand.fromJson(e as Map)) - .toList(), - ); - -Map _$SearchResultToJson(SearchResult instance) => - { - 'product_id': instance.productId, - 'code': instance.code, - 'name': instance.name, - 'card_type': instance.cardType, - 'altText': instance.altText, - 'companies': instance.companies, - 'report': instance.report, - 'donate': instance.donate, - 'all_company_brands': instance.allCompanyBrands, - }; diff --git a/lib/pages/menu/version_bloc.freezed.dart b/lib/pages/menu/version_bloc.freezed.dart deleted file mode 100644 index f545ba2..0000000 --- a/lib/pages/menu/version_bloc.freezed.dart +++ /dev/null @@ -1,283 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'version_bloc.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -/// @nodoc -mixin _$VersionState { - String? get version => throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $VersionStateCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $VersionStateCopyWith<$Res> { - factory $VersionStateCopyWith( - VersionState value, $Res Function(VersionState) then) = - _$VersionStateCopyWithImpl<$Res, VersionState>; - @useResult - $Res call({String? version}); -} - -/// @nodoc -class _$VersionStateCopyWithImpl<$Res, $Val extends VersionState> - implements $VersionStateCopyWith<$Res> { - _$VersionStateCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? version = freezed, - }) { - return _then(_value.copyWith( - version: freezed == version - ? _value.version - : version // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$InitialImplCopyWith<$Res> - implements $VersionStateCopyWith<$Res> { - factory _$$InitialImplCopyWith( - _$InitialImpl value, $Res Function(_$InitialImpl) then) = - __$$InitialImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? version}); -} - -/// @nodoc -class __$$InitialImplCopyWithImpl<$Res> - extends _$VersionStateCopyWithImpl<$Res, _$InitialImpl> - implements _$$InitialImplCopyWith<$Res> { - __$$InitialImplCopyWithImpl( - _$InitialImpl _value, $Res Function(_$InitialImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? version = freezed, - }) { - return _then(_$InitialImpl( - version: freezed == version - ? _value.version - : version // ignore: cast_nullable_to_non_nullable - as String?, - )); - } -} - -/// @nodoc - -class _$InitialImpl implements Initial { - const _$InitialImpl({this.version = null}); - - @override - @JsonKey() - final String? version; - - @override - String toString() { - return 'VersionState(version: $version)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$InitialImpl && - (identical(other.version, version) || other.version == version)); - } - - @override - int get hashCode => Object.hash(runtimeType, version); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$InitialImplCopyWith<_$InitialImpl> get copyWith => - __$$InitialImplCopyWithImpl<_$InitialImpl>(this, _$identity); -} - -abstract class Initial implements VersionState { - const factory Initial({final String? version}) = _$InitialImpl; - - @override - String? get version; - @override - @JsonKey(ignore: true) - _$$InitialImplCopyWith<_$InitialImpl> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -mixin _$VersionEvent { - @optionalTypeArgs - TResult when({ - required TResult Function() onApear, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? onApear, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? onApear, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(onApear value) onApear, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(onApear value)? onApear, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(onApear value)? onApear, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $VersionEventCopyWith<$Res> { - factory $VersionEventCopyWith( - VersionEvent value, $Res Function(VersionEvent) then) = - _$VersionEventCopyWithImpl<$Res, VersionEvent>; -} - -/// @nodoc -class _$VersionEventCopyWithImpl<$Res, $Val extends VersionEvent> - implements $VersionEventCopyWith<$Res> { - _$VersionEventCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; -} - -/// @nodoc -abstract class _$$onApearImplCopyWith<$Res> { - factory _$$onApearImplCopyWith( - _$onApearImpl value, $Res Function(_$onApearImpl) then) = - __$$onApearImplCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$onApearImplCopyWithImpl<$Res> - extends _$VersionEventCopyWithImpl<$Res, _$onApearImpl> - implements _$$onApearImplCopyWith<$Res> { - __$$onApearImplCopyWithImpl( - _$onApearImpl _value, $Res Function(_$onApearImpl) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$onApearImpl implements onApear { - const _$onApearImpl(); - - @override - String toString() { - return 'VersionEvent.onApear()'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$onApearImpl); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() onApear, - }) { - return onApear(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? onApear, - }) { - return onApear?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? onApear, - required TResult orElse(), - }) { - if (onApear != null) { - return onApear(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(onApear value) onApear, - }) { - return onApear(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(onApear value)? onApear, - }) { - return onApear?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(onApear value)? onApear, - required TResult orElse(), - }) { - if (onApear != null) { - return onApear(this); - } - return orElse(); - } -} - -abstract class onApear implements VersionEvent { - const factory onApear() = _$onApearImpl; -} diff --git a/lib/pages/scan/scan_event.freezed.dart b/lib/pages/scan/scan_event.freezed.dart deleted file mode 100644 index 1481e63..0000000 --- a/lib/pages/scan/scan_event.freezed.dart +++ /dev/null @@ -1,437 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'scan_event.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -/// @nodoc -mixin _$ScanEvent { - @optionalTypeArgs - TResult when({ - required TResult Function(String barcode) barcodeScanned, - required TResult Function() alertDialogDismissed, - required TResult Function() torchSwitched, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String barcode)? barcodeScanned, - TResult? Function()? alertDialogDismissed, - TResult? Function()? torchSwitched, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String barcode)? barcodeScanned, - TResult Function()? alertDialogDismissed, - TResult Function()? torchSwitched, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(BarcodeScanned value) barcodeScanned, - required TResult Function(AlertDialogDismissed value) alertDialogDismissed, - required TResult Function(TorchSwitched value) torchSwitched, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(BarcodeScanned value)? barcodeScanned, - TResult? Function(AlertDialogDismissed value)? alertDialogDismissed, - TResult? Function(TorchSwitched value)? torchSwitched, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(BarcodeScanned value)? barcodeScanned, - TResult Function(AlertDialogDismissed value)? alertDialogDismissed, - TResult Function(TorchSwitched value)? torchSwitched, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $ScanEventCopyWith<$Res> { - factory $ScanEventCopyWith(ScanEvent value, $Res Function(ScanEvent) then) = - _$ScanEventCopyWithImpl<$Res, ScanEvent>; -} - -/// @nodoc -class _$ScanEventCopyWithImpl<$Res, $Val extends ScanEvent> - implements $ScanEventCopyWith<$Res> { - _$ScanEventCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; -} - -/// @nodoc -abstract class _$$BarcodeScannedImplCopyWith<$Res> { - factory _$$BarcodeScannedImplCopyWith(_$BarcodeScannedImpl value, - $Res Function(_$BarcodeScannedImpl) then) = - __$$BarcodeScannedImplCopyWithImpl<$Res>; - @useResult - $Res call({String barcode}); -} - -/// @nodoc -class __$$BarcodeScannedImplCopyWithImpl<$Res> - extends _$ScanEventCopyWithImpl<$Res, _$BarcodeScannedImpl> - implements _$$BarcodeScannedImplCopyWith<$Res> { - __$$BarcodeScannedImplCopyWithImpl( - _$BarcodeScannedImpl _value, $Res Function(_$BarcodeScannedImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? barcode = null, - }) { - return _then(_$BarcodeScannedImpl( - null == barcode - ? _value.barcode - : barcode // ignore: cast_nullable_to_non_nullable - as String, - )); - } -} - -/// @nodoc - -class _$BarcodeScannedImpl implements BarcodeScanned { - const _$BarcodeScannedImpl(this.barcode); - - @override - final String barcode; - - @override - String toString() { - return 'ScanEvent.barcodeScanned(barcode: $barcode)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$BarcodeScannedImpl && - (identical(other.barcode, barcode) || other.barcode == barcode)); - } - - @override - int get hashCode => Object.hash(runtimeType, barcode); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$BarcodeScannedImplCopyWith<_$BarcodeScannedImpl> get copyWith => - __$$BarcodeScannedImplCopyWithImpl<_$BarcodeScannedImpl>( - this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String barcode) barcodeScanned, - required TResult Function() alertDialogDismissed, - required TResult Function() torchSwitched, - }) { - return barcodeScanned(barcode); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String barcode)? barcodeScanned, - TResult? Function()? alertDialogDismissed, - TResult? Function()? torchSwitched, - }) { - return barcodeScanned?.call(barcode); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String barcode)? barcodeScanned, - TResult Function()? alertDialogDismissed, - TResult Function()? torchSwitched, - required TResult orElse(), - }) { - if (barcodeScanned != null) { - return barcodeScanned(barcode); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(BarcodeScanned value) barcodeScanned, - required TResult Function(AlertDialogDismissed value) alertDialogDismissed, - required TResult Function(TorchSwitched value) torchSwitched, - }) { - return barcodeScanned(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(BarcodeScanned value)? barcodeScanned, - TResult? Function(AlertDialogDismissed value)? alertDialogDismissed, - TResult? Function(TorchSwitched value)? torchSwitched, - }) { - return barcodeScanned?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(BarcodeScanned value)? barcodeScanned, - TResult Function(AlertDialogDismissed value)? alertDialogDismissed, - TResult Function(TorchSwitched value)? torchSwitched, - required TResult orElse(), - }) { - if (barcodeScanned != null) { - return barcodeScanned(this); - } - return orElse(); - } -} - -abstract class BarcodeScanned implements ScanEvent { - const factory BarcodeScanned(final String barcode) = _$BarcodeScannedImpl; - - String get barcode; - @JsonKey(ignore: true) - _$$BarcodeScannedImplCopyWith<_$BarcodeScannedImpl> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$AlertDialogDismissedImplCopyWith<$Res> { - factory _$$AlertDialogDismissedImplCopyWith(_$AlertDialogDismissedImpl value, - $Res Function(_$AlertDialogDismissedImpl) then) = - __$$AlertDialogDismissedImplCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$AlertDialogDismissedImplCopyWithImpl<$Res> - extends _$ScanEventCopyWithImpl<$Res, _$AlertDialogDismissedImpl> - implements _$$AlertDialogDismissedImplCopyWith<$Res> { - __$$AlertDialogDismissedImplCopyWithImpl(_$AlertDialogDismissedImpl _value, - $Res Function(_$AlertDialogDismissedImpl) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$AlertDialogDismissedImpl implements AlertDialogDismissed { - const _$AlertDialogDismissedImpl(); - - @override - String toString() { - return 'ScanEvent.alertDialogDismissed()'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$AlertDialogDismissedImpl); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String barcode) barcodeScanned, - required TResult Function() alertDialogDismissed, - required TResult Function() torchSwitched, - }) { - return alertDialogDismissed(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String barcode)? barcodeScanned, - TResult? Function()? alertDialogDismissed, - TResult? Function()? torchSwitched, - }) { - return alertDialogDismissed?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String barcode)? barcodeScanned, - TResult Function()? alertDialogDismissed, - TResult Function()? torchSwitched, - required TResult orElse(), - }) { - if (alertDialogDismissed != null) { - return alertDialogDismissed(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(BarcodeScanned value) barcodeScanned, - required TResult Function(AlertDialogDismissed value) alertDialogDismissed, - required TResult Function(TorchSwitched value) torchSwitched, - }) { - return alertDialogDismissed(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(BarcodeScanned value)? barcodeScanned, - TResult? Function(AlertDialogDismissed value)? alertDialogDismissed, - TResult? Function(TorchSwitched value)? torchSwitched, - }) { - return alertDialogDismissed?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(BarcodeScanned value)? barcodeScanned, - TResult Function(AlertDialogDismissed value)? alertDialogDismissed, - TResult Function(TorchSwitched value)? torchSwitched, - required TResult orElse(), - }) { - if (alertDialogDismissed != null) { - return alertDialogDismissed(this); - } - return orElse(); - } -} - -abstract class AlertDialogDismissed implements ScanEvent { - const factory AlertDialogDismissed() = _$AlertDialogDismissedImpl; -} - -/// @nodoc -abstract class _$$TorchSwitchedImplCopyWith<$Res> { - factory _$$TorchSwitchedImplCopyWith( - _$TorchSwitchedImpl value, $Res Function(_$TorchSwitchedImpl) then) = - __$$TorchSwitchedImplCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$TorchSwitchedImplCopyWithImpl<$Res> - extends _$ScanEventCopyWithImpl<$Res, _$TorchSwitchedImpl> - implements _$$TorchSwitchedImplCopyWith<$Res> { - __$$TorchSwitchedImplCopyWithImpl( - _$TorchSwitchedImpl _value, $Res Function(_$TorchSwitchedImpl) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$TorchSwitchedImpl implements TorchSwitched { - const _$TorchSwitchedImpl(); - - @override - String toString() { - return 'ScanEvent.torchSwitched()'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$TorchSwitchedImpl); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String barcode) barcodeScanned, - required TResult Function() alertDialogDismissed, - required TResult Function() torchSwitched, - }) { - return torchSwitched(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String barcode)? barcodeScanned, - TResult? Function()? alertDialogDismissed, - TResult? Function()? torchSwitched, - }) { - return torchSwitched?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String barcode)? barcodeScanned, - TResult Function()? alertDialogDismissed, - TResult Function()? torchSwitched, - required TResult orElse(), - }) { - if (torchSwitched != null) { - return torchSwitched(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(BarcodeScanned value) barcodeScanned, - required TResult Function(AlertDialogDismissed value) alertDialogDismissed, - required TResult Function(TorchSwitched value) torchSwitched, - }) { - return torchSwitched(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(BarcodeScanned value)? barcodeScanned, - TResult? Function(AlertDialogDismissed value)? alertDialogDismissed, - TResult? Function(TorchSwitched value)? torchSwitched, - }) { - return torchSwitched?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(BarcodeScanned value)? barcodeScanned, - TResult Function(AlertDialogDismissed value)? alertDialogDismissed, - TResult Function(TorchSwitched value)? torchSwitched, - required TResult orElse(), - }) { - if (torchSwitched != null) { - return torchSwitched(this); - } - return orElse(); - } -} - -abstract class TorchSwitched implements ScanEvent { - const factory TorchSwitched() = _$TorchSwitchedImpl; -} diff --git a/lib/pages/scan/scan_state.freezed.dart b/lib/pages/scan/scan_state.freezed.dart deleted file mode 100644 index 8e212be..0000000 --- a/lib/pages/scan/scan_state.freezed.dart +++ /dev/null @@ -1,207 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'scan_state.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -/// @nodoc -mixin _$ScanState { - List get list => throw _privateConstructorUsedError; - bool get isLoading => throw _privateConstructorUsedError; - bool get isError => throw _privateConstructorUsedError; - bool get isTorchOn => throw _privateConstructorUsedError; - - @JsonKey(ignore: true) - $ScanStateCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $ScanStateCopyWith<$Res> { - factory $ScanStateCopyWith(ScanState value, $Res Function(ScanState) then) = - _$ScanStateCopyWithImpl<$Res, ScanState>; - @useResult - $Res call( - {List list, bool isLoading, bool isError, bool isTorchOn}); -} - -/// @nodoc -class _$ScanStateCopyWithImpl<$Res, $Val extends ScanState> - implements $ScanStateCopyWith<$Res> { - _$ScanStateCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? list = null, - Object? isLoading = null, - Object? isError = null, - Object? isTorchOn = null, - }) { - return _then(_value.copyWith( - list: null == list - ? _value.list - : list // ignore: cast_nullable_to_non_nullable - as List, - isLoading: null == isLoading - ? _value.isLoading - : isLoading // ignore: cast_nullable_to_non_nullable - as bool, - isError: null == isError - ? _value.isError - : isError // ignore: cast_nullable_to_non_nullable - as bool, - isTorchOn: null == isTorchOn - ? _value.isTorchOn - : isTorchOn // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$InitialImplCopyWith<$Res> - implements $ScanStateCopyWith<$Res> { - factory _$$InitialImplCopyWith( - _$InitialImpl value, $Res Function(_$InitialImpl) then) = - __$$InitialImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {List list, bool isLoading, bool isError, bool isTorchOn}); -} - -/// @nodoc -class __$$InitialImplCopyWithImpl<$Res> - extends _$ScanStateCopyWithImpl<$Res, _$InitialImpl> - implements _$$InitialImplCopyWith<$Res> { - __$$InitialImplCopyWithImpl( - _$InitialImpl _value, $Res Function(_$InitialImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? list = null, - Object? isLoading = null, - Object? isError = null, - Object? isTorchOn = null, - }) { - return _then(_$InitialImpl( - list: null == list - ? _value._list - : list // ignore: cast_nullable_to_non_nullable - as List, - isLoading: null == isLoading - ? _value.isLoading - : isLoading // ignore: cast_nullable_to_non_nullable - as bool, - isError: null == isError - ? _value.isError - : isError // ignore: cast_nullable_to_non_nullable - as bool, - isTorchOn: null == isTorchOn - ? _value.isTorchOn - : isTorchOn // ignore: cast_nullable_to_non_nullable - as bool, - )); - } -} - -/// @nodoc - -class _$InitialImpl implements Initial { - const _$InitialImpl( - {final List list = const [], - this.isLoading = false, - this.isError = false, - this.isTorchOn = false}) - : _list = list; - - final List _list; - @override - @JsonKey() - List get list { - if (_list is EqualUnmodifiableListView) return _list; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_list); - } - - @override - @JsonKey() - final bool isLoading; - @override - @JsonKey() - final bool isError; - @override - @JsonKey() - final bool isTorchOn; - - @override - String toString() { - return 'ScanState(list: $list, isLoading: $isLoading, isError: $isError, isTorchOn: $isTorchOn)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$InitialImpl && - const DeepCollectionEquality().equals(other._list, _list) && - (identical(other.isLoading, isLoading) || - other.isLoading == isLoading) && - (identical(other.isError, isError) || other.isError == isError) && - (identical(other.isTorchOn, isTorchOn) || - other.isTorchOn == isTorchOn)); - } - - @override - int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(_list), - isLoading, - isError, - isTorchOn); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$InitialImplCopyWith<_$InitialImpl> get copyWith => - __$$InitialImplCopyWithImpl<_$InitialImpl>(this, _$identity); -} - -abstract class Initial implements ScanState { - const factory Initial( - {final List list, - final bool isLoading, - final bool isError, - final bool isTorchOn}) = _$InitialImpl; - - @override - List get list; - @override - bool get isLoading; - @override - bool get isError; - @override - bool get isTorchOn; - @override - @JsonKey(ignore: true) - _$$InitialImplCopyWith<_$InitialImpl> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/lib/theme/assets.gen.dart b/lib/theme/assets.gen.dart deleted file mode 100644 index 2034895..0000000 --- a/lib/theme/assets.gen.dart +++ /dev/null @@ -1,297 +0,0 @@ -/// GENERATED CODE - DO NOT MODIFY BY HAND -/// ***************************************************** -/// FlutterGen -/// ***************************************************** - -// coverage:ignore-file -// ignore_for_file: type=lint -// ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use - -import 'package:flutter/widgets.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:vector_graphics/vector_graphics.dart'; - -class $AssetsCompanyGen { - const $AssetsCompanyGen(); - - /// File path: assets/company/heart.svg - SvgGenImage get heart => const SvgGenImage('assets/company/heart.svg'); - - /// File path: assets/company/info.svg - SvgGenImage get info => const SvgGenImage('assets/company/info.svg'); - - /// File path: assets/company/radio_button_unchecked.svg - SvgGenImage get radioButtonUnchecked => const SvgGenImage('assets/company/radio_button_unchecked.svg'); - - /// File path: assets/company/task_alt.svg - SvgGenImage get taskAlt => const SvgGenImage('assets/company/task_alt.svg'); - - /// File path: assets/company/unpublished.svg - SvgGenImage get unpublished => const SvgGenImage('assets/company/unpublished.svg'); - - /// List of all assets - List get values => [heart, info, radioButtonUnchecked, taskAlt, unpublished]; -} - -class $AssetsMenuPageGen { - const $AssetsMenuPageGen(); - - /// File path: assets/menuPage/diversity.svg - SvgGenImage get diversity => const SvgGenImage('assets/menuPage/diversity.svg'); - - /// File path: assets/menuPage/github.svg - SvgGenImage get github => const SvgGenImage('assets/menuPage/github.svg'); - - /// File path: assets/menuPage/groups.svg - SvgGenImage get groups => const SvgGenImage('assets/menuPage/groups.svg'); - - /// File path: assets/menuPage/handshake.svg - SvgGenImage get handshake => const SvgGenImage('assets/menuPage/handshake.svg'); - - /// File path: assets/menuPage/info.svg - SvgGenImage get info => const SvgGenImage('assets/menuPage/info.svg'); - - /// File path: assets/menuPage/leftbottomcorner.svg - SvgGenImage get leftbottomcorner => const SvgGenImage('assets/menuPage/leftbottomcorner.svg'); - - /// File path: assets/menuPage/menu.svg - SvgGenImage get menu => const SvgGenImage('assets/menuPage/menu.svg'); - - /// File path: assets/menuPage/rectangle.svg - SvgGenImage get rectangle => const SvgGenImage('assets/menuPage/rectangle.svg'); - - /// File path: assets/menuPage/rightbottomcorner.svg - SvgGenImage get rightbottomcorner => const SvgGenImage('assets/menuPage/rightbottomcorner.svg'); - - /// File path: assets/menuPage/star.svg - SvgGenImage get star => const SvgGenImage('assets/menuPage/star.svg'); - - /// File path: assets/menuPage/thumbs.svg - SvgGenImage get thumbs => const SvgGenImage('assets/menuPage/thumbs.svg'); - - /// File path: assets/menuPage/topleftcorner.svg - SvgGenImage get topleftcorner => const SvgGenImage('assets/menuPage/topleftcorner.svg'); - - /// File path: assets/menuPage/toprightcorner.svg - SvgGenImage get toprightcorner => const SvgGenImage('assets/menuPage/toprightcorner.svg'); - - /// List of all assets - List get values => [ - diversity, - github, - groups, - handshake, - info, - leftbottomcorner, - menu, - rectangle, - rightbottomcorner, - star, - thumbs, - topleftcorner, - toprightcorner - ]; -} - -class $AssetsNavigationGen { - const $AssetsNavigationGen(); - - /// File path: assets/navigation/close.svg - SvgGenImage get close => const SvgGenImage('assets/navigation/close.svg'); - - /// List of all assets - List get values => [close]; -} - -class $AssetsScanGen { - const $AssetsScanGen(); - - /// File path: assets/scan/flashlightOff.svg - SvgGenImage get flashlightOff => const SvgGenImage('assets/scan/flashlightOff.svg'); - - /// File path: assets/scan/flashlightOn.svg - SvgGenImage get flashlightOn => const SvgGenImage('assets/scan/flashlightOn.svg'); - - /// File path: assets/scan/showMore.svg - SvgGenImage get showMore => const SvgGenImage('assets/scan/showMore.svg'); - - /// List of all assets - List get values => [flashlightOff, flashlightOn, showMore]; -} - -class Assets { - Assets._(); - - static const $AssetsCompanyGen company = $AssetsCompanyGen(); - static const AssetGenImage icAddBlack24dp = AssetGenImage('assets/ic_add_black_24dp.png'); - static const AssetGenImage icBackspaceWhite36dp = AssetGenImage('assets/ic_backspace_white_36dp.png'); - static const AssetGenImage icDialpadWhite36dp = AssetGenImage('assets/ic_dialpad_white_36dp.png'); - static const AssetGenImage icDoneWhite36dp = AssetGenImage('assets/ic_done_white_36dp.png'); - static const AssetGenImage icLauncher = AssetGenImage('assets/ic_launcher.png'); - static const AssetGenImage menu = AssetGenImage('assets/menu.png'); - static const $AssetsMenuPageGen menuPage = $AssetsMenuPageGen(); - static const $AssetsNavigationGen navigation = $AssetsNavigationGen(); - static const $AssetsScanGen scan = $AssetsScanGen(); - - /// List of all assets - static List get values => - [icAddBlack24dp, icBackspaceWhite36dp, icDialpadWhite36dp, icDoneWhite36dp, icLauncher, menu]; -} - -class AssetGenImage { - const AssetGenImage( - this._assetName, { - this.size, - this.flavors = const {}, - }); - - final String _assetName; - - final Size? size; - final Set flavors; - - Image image({ - Key? key, - AssetBundle? bundle, - ImageFrameBuilder? frameBuilder, - ImageErrorWidgetBuilder? errorBuilder, - String? semanticLabel, - bool excludeFromSemantics = false, - double? scale, - double? width, - double? height, - Color? color, - Animation? opacity, - BlendMode? colorBlendMode, - BoxFit? fit, - AlignmentGeometry alignment = Alignment.center, - ImageRepeat repeat = ImageRepeat.noRepeat, - Rect? centerSlice, - bool matchTextDirection = false, - bool gaplessPlayback = false, - bool isAntiAlias = false, - String? package, - FilterQuality filterQuality = FilterQuality.low, - int? cacheWidth, - int? cacheHeight, - }) { - return Image.asset( - _assetName, - key: key, - bundle: bundle, - frameBuilder: frameBuilder, - errorBuilder: errorBuilder, - semanticLabel: semanticLabel, - excludeFromSemantics: excludeFromSemantics, - scale: scale, - width: width, - height: height, - color: color, - opacity: opacity, - colorBlendMode: colorBlendMode, - fit: fit, - alignment: alignment, - repeat: repeat, - centerSlice: centerSlice, - matchTextDirection: matchTextDirection, - gaplessPlayback: gaplessPlayback, - isAntiAlias: isAntiAlias, - package: package, - filterQuality: filterQuality, - cacheWidth: cacheWidth, - cacheHeight: cacheHeight, - ); - } - - ImageProvider provider({ - AssetBundle? bundle, - String? package, - }) { - return AssetImage( - _assetName, - bundle: bundle, - package: package, - ); - } - - String get path => _assetName; - - String get keyName => _assetName; -} - -class SvgGenImage { - const SvgGenImage( - this._assetName, { - this.size, - this.flavors = const {}, - }) : _isVecFormat = false; - - const SvgGenImage.vec( - this._assetName, { - this.size, - this.flavors = const {}, - }) : _isVecFormat = true; - - final String _assetName; - final Size? size; - final Set flavors; - final bool _isVecFormat; - - SvgPicture svg({ - Key? key, - bool matchTextDirection = false, - AssetBundle? bundle, - String? package, - double? width, - double? height, - BoxFit fit = BoxFit.contain, - AlignmentGeometry alignment = Alignment.center, - bool allowDrawingOutsideViewBox = false, - WidgetBuilder? placeholderBuilder, - String? semanticsLabel, - bool excludeFromSemantics = false, - SvgTheme? theme, - ColorFilter? colorFilter, - Clip clipBehavior = Clip.hardEdge, - @deprecated Color? color, - @deprecated BlendMode colorBlendMode = BlendMode.srcIn, - @deprecated bool cacheColorFilter = false, - }) { - final BytesLoader loader; - if (_isVecFormat) { - loader = AssetBytesLoader( - _assetName, - assetBundle: bundle, - packageName: package, - ); - } else { - loader = SvgAssetLoader( - _assetName, - assetBundle: bundle, - packageName: package, - theme: theme, - ); - } - return SvgPicture( - loader, - key: key, - matchTextDirection: matchTextDirection, - width: width, - height: height, - fit: fit, - alignment: alignment, - allowDrawingOutsideViewBox: allowDrawingOutsideViewBox, - placeholderBuilder: placeholderBuilder, - semanticsLabel: semanticsLabel, - excludeFromSemantics: excludeFromSemantics, - colorFilter: colorFilter ?? (color == null ? null : ColorFilter.mode(color, colorBlendMode)), - clipBehavior: clipBehavior, - cacheColorFilter: cacheColorFilter, - ); - } - - String get path => _assetName; - - String get keyName => _assetName; -} diff --git a/lib/theme/fonts.gen.dart b/lib/theme/fonts.gen.dart deleted file mode 100644 index 305560d..0000000 --- a/lib/theme/fonts.gen.dart +++ /dev/null @@ -1,18 +0,0 @@ -/// GENERATED CODE - DO NOT MODIFY BY HAND -/// ***************************************************** -/// FlutterGen -/// ***************************************************** - -// coverage:ignore-file -// ignore_for_file: type=lint -// ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use - -class FontFamily { - FontFamily._(); - - /// Font family: Lato - static const String lato = 'Lato'; - - /// Font family: Roboto - static const String roboto = 'Roboto'; -} From ca47990887870bb6736469a8fe7e9f133d6b2c17 Mon Sep 17 00:00:00 2001 From: Marcin Stepnowski Date: Thu, 2 Jan 2025 10:17:18 +0100 Subject: [PATCH 2/5] Add generated files to git ignore --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index 2fdbb91..56f760f 100644 --- a/.gitignore +++ b/.gitignore @@ -874,3 +874,9 @@ FodyWeavers.xsd *.properties # End of https://www.toptal.com/developers/gitignore/api/dart,flutter,android,xcode,androidstudio,intellij,visualstudio + +# Generated files with `dart run build_runner build` +*.g.dart +*.chopper.dart +*.freezed.dart +*.gen.dart From 9b1177500521a8b829b874e1f3bd42e15d02eeef Mon Sep 17 00:00:00 2001 From: Marcin Stepnowski Date: Thu, 2 Jan 2025 10:17:31 +0100 Subject: [PATCH 3/5] Add info about generated files to README --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7fb8105..0945b5d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,17 @@ Currently available on Play store and [pola-app.pl](https://www.pola-app.pl/) # Uruchomienie -TODO +Część plików jest generowana, dlatego przed pierwszym uruchomieniem aplikacji czy też po zmianie brancha warto uruchomić build_runnera: + +```bash +dart run build_runner build +``` + +W trakcie prac nad plikami, które powodują konieczność ponownego uruchomienia build_runnera warto użyc: + +```bash +dart run build_runner watch +``` # Screenshoty From c76fe13969806639dcc1849f1bd0d54ebc39f29f Mon Sep 17 00:00:00 2001 From: Marcin Stepnowski Date: Thu, 2 Jan 2025 10:19:03 +0100 Subject: [PATCH 4/5] Generate files in CI --- .github/workflows/build_android.yml | 1 + .github/workflows/build_ios.yml | 1 + .github/workflows/tests.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/build_android.yml b/.github/workflows/build_android.yml index e6f77b1..491db52 100644 --- a/.github/workflows/build_android.yml +++ b/.github/workflows/build_android.yml @@ -21,6 +21,7 @@ jobs: cache: true # Speed up the process - name: Get dependencies run: flutter pub get + - run: dart run build_runner build - name: Create googleservices file run: cat /home/runner/work/pola-flutter/pola-flutter/android/app/google-services.json | base64 - name: Putting secret data diff --git a/.github/workflows/build_ios.yml b/.github/workflows/build_ios.yml index 7a7a5bf..eabb048 100644 --- a/.github/workflows/build_ios.yml +++ b/.github/workflows/build_ios.yml @@ -30,4 +30,5 @@ jobs: path: ios/Pods key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }} restore-keys: ${{ runner.os }}-pods- + - run: dart run build_runner build - run: bundle exec flutter build ios --no-codesign diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d512525..683aed0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,5 +16,6 @@ jobs: with: channel: 'stable' - run: flutter pub get + - run: dart run build_runner build - run: flutter analyze - run: flutter test From 56d2c947d70d74761769e97bc269f9002cdeffd9 Mon Sep 17 00:00:00 2001 From: Marcin Stepnowski Date: Thu, 2 Jan 2025 10:25:13 +0100 Subject: [PATCH 5/5] Add slang generation --- .github/workflows/build_android.yml | 1 + .github/workflows/build_ios.yml | 1 + .github/workflows/tests.yml | 1 + README.md | 3 ++- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_android.yml b/.github/workflows/build_android.yml index 491db52..d0fb530 100644 --- a/.github/workflows/build_android.yml +++ b/.github/workflows/build_android.yml @@ -22,6 +22,7 @@ jobs: - name: Get dependencies run: flutter pub get - run: dart run build_runner build + - run: dart run slang - name: Create googleservices file run: cat /home/runner/work/pola-flutter/pola-flutter/android/app/google-services.json | base64 - name: Putting secret data diff --git a/.github/workflows/build_ios.yml b/.github/workflows/build_ios.yml index eabb048..3277756 100644 --- a/.github/workflows/build_ios.yml +++ b/.github/workflows/build_ios.yml @@ -31,4 +31,5 @@ jobs: key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }} restore-keys: ${{ runner.os }}-pods- - run: dart run build_runner build + - run: dart run slang - run: bundle exec flutter build ios --no-codesign diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 683aed0..1e9b1a0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,5 +17,6 @@ jobs: channel: 'stable' - run: flutter pub get - run: dart run build_runner build + - run: dart run slang - run: flutter analyze - run: flutter test diff --git a/README.md b/README.md index 0945b5d..b54319d 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,11 @@ Currently available on Play store and [pola-app.pl](https://www.pola-app.pl/) # Uruchomienie -Część plików jest generowana, dlatego przed pierwszym uruchomieniem aplikacji czy też po zmianie brancha warto uruchomić build_runnera: +Część plików jest generowana, dlatego przed pierwszym uruchomieniem aplikacji czy też po zmianie brancha warto uruchomić build_runnera i [slanga](https://github.com/slang-i18n/slang): ```bash dart run build_runner build +dart run slang ``` W trakcie prac nad plikami, które powodują konieczność ponownego uruchomienia build_runnera warto użyc: