From 8b1ec3818ccb5bb336251877399f23676759d89a Mon Sep 17 00:00:00 2001 From: reinjens Date: Tue, 17 Dec 2024 13:13:01 +0100 Subject: [PATCH] Stammdaten --- i18n/de.json | 4 +- lib/main.dart | 6 +- lib/src/config/config.dart | 1 + lib/src/entity/business/business.dart | 6 + lib/src/entity/business/business.g.dart | 397 +++ lib/src/entity/login/login.dart | 62 + lib/src/entity/login/login.g.dart | 2729 +++++++++++++++++ lib/src/entity/login/login_repository.dart | 22 + .../months/measure_months_datasource.dart | 40 +- lib/src/packages/ambito_api/base_api.dart | 29 +- lib/src/packages/ambito_api/restclient.dart | 1 - lib/src/packages/ambito_db/base_db.dart | 2 + lib/src/pages/calendar/calendar_page.dart | 75 +- .../dashboard/areas/dashboard_areas_page.dart | 2 + .../layouts/normal_layout_dashboard_page.dart | 1 + .../master_data/master_data_page.dart | 613 ++++ .../buttons/cancel_button_with_action.dart | 23 + lib/src/widgets/buttons/edit_button.dart | 23 + ...save_buttons_group_with_cancel_action.dart | 30 + .../widgets/buttons/upload_image_button.dart | 23 + .../form_builder_fields/fbf_dropdown.dart | 37 + .../form_builder_fields/fbf_password.dart | 27 + .../form/form_builder_fields/fbf_text.dart | 26 + .../form_builder_fields/fbf_textfield.dart | 28 + lib/src/widgets/map/map_widget.dart | 34 +- pubspec.lock | 2 +- pubspec.yaml | 1 + 27 files changed, 4185 insertions(+), 59 deletions(-) create mode 100644 lib/src/entity/login/login.dart create mode 100644 lib/src/entity/login/login.g.dart create mode 100644 lib/src/entity/login/login_repository.dart create mode 100644 lib/src/pages/dashboard/master_data/master_data_page.dart create mode 100644 lib/src/widgets/buttons/cancel_button_with_action.dart create mode 100644 lib/src/widgets/buttons/edit_button.dart create mode 100644 lib/src/widgets/buttons/save_buttons_group_with_cancel_action.dart create mode 100644 lib/src/widgets/buttons/upload_image_button.dart create mode 100644 lib/src/widgets/form/form_builder_fields/fbf_dropdown.dart create mode 100644 lib/src/widgets/form/form_builder_fields/fbf_password.dart create mode 100644 lib/src/widgets/form/form_builder_fields/fbf_text.dart create mode 100644 lib/src/widgets/form/form_builder_fields/fbf_textfield.dart diff --git a/i18n/de.json b/i18n/de.json index 753cb33..9117e53 100644 --- a/i18n/de.json +++ b/i18n/de.json @@ -13,10 +13,12 @@ }, "buttons": { "delete": "Löschen", + "edit": "Bearbeiten", "cancel": "Abbrechen", "save": "Speichern", "print_all": "Alles drucken", - "print": "Drucken" + "print": "Drucken", + "upload_image": "Bild hochladen" }, "spacer": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." }, diff --git a/lib/main.dart b/lib/main.dart index 45c7505..c4cdb19 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -14,6 +14,7 @@ import 'package:ambito/src/pages/calendar/calendar_page_year.dart'; import 'package:ambito/src/pages/cart/cart_page.dart'; import 'package:ambito/src/pages/dashboard/areas/dashboard_areas_page.dart'; import 'package:ambito/src/pages/dashboard/dashboard_page.dart'; +import 'package:ambito/src/pages/dashboard/master_data/master_data_page.dart'; import 'package:ambito/src/pages/error/error_page.dart'; import 'package:ambito/src/pages/measure/categories/measure_categories_page.dart'; import 'package:ambito/src/pages/measure/create/measure_create_page.dart'; @@ -43,6 +44,7 @@ void main() async { BaseApi().getContent('funding_program'), BaseApi().getContent('business'), BaseApi().getContent('area'), + BaseApi().getContent('login'), ]); List myCartIds = []; @@ -202,9 +204,9 @@ class Ambito extends StatelessWidget { ), GetPage( name: '/dashboard/stammdaten', - page: () => DashboardPage( + page: () => MasterDataPage( businessId: prefs.getInt('currentUser') ?? 100, - userId: 0, + userId: 1, ), ), GetPage( diff --git a/lib/src/config/config.dart b/lib/src/config/config.dart index eb3ef4b..ed2b21d 100644 --- a/lib/src/config/config.dart +++ b/lib/src/config/config.dart @@ -70,4 +70,5 @@ const baserowIds = { "source": 334231, "cart": 406916, "cart_element": 407428, + "login": 410129, }; diff --git a/lib/src/entity/business/business.dart b/lib/src/entity/business/business.dart index 792a52e..e2c1d08 100644 --- a/lib/src/entity/business/business.dart +++ b/lib/src/entity/business/business.dart @@ -74,6 +74,12 @@ class Business extends BaseEntity with EntityWithId { @JsonKey(name: 'field_2428872') List? experienceReport; + @JsonKey(name: 'field_3137840') + String? notice; + + @JsonKey(name: 'field_3136789') + List? logins; + factory Business.fromJson(Map json) => _$BusinessFromJson(json); diff --git a/lib/src/entity/business/business.g.dart b/lib/src/entity/business/business.g.dart index 1eb9ddf..65956ab 100644 --- a/lib/src/entity/business/business.g.dart +++ b/lib/src/entity/business/business.g.dart @@ -128,6 +128,15 @@ const BusinessSchema = IsarGeneratedSchema( type: IsarType.objectList, target: 'IdValue', ), + IsarPropertySchema( + name: 'notice', + type: IsarType.string, + ), + IsarPropertySchema( + name: 'logins', + type: IsarType.objectList, + target: 'IdValue', + ), ], indexes: [ IsarIndexSchema( @@ -380,6 +389,31 @@ int serializeBusiness(IsarWriter writer, Business object) { IsarCore.endList(writer, listWriter); } } + { + final value = object.notice; + if (value == null) { + IsarCore.writeNull(writer, 27); + } else { + IsarCore.writeString(writer, 27, value); + } + } + { + final list = object.logins; + if (list == null) { + IsarCore.writeNull(writer, 28); + } else { + final listWriter = IsarCore.beginList(writer, 28, list.length); + for (var i = 0; i < list.length; i++) { + { + final value = list[i]; + final objectWriter = IsarCore.beginObject(listWriter, i); + serializeIdValue(objectWriter, value); + IsarCore.endObject(listWriter, objectWriter); + } + } + IsarCore.endList(writer, listWriter); + } + } return object.id; } @@ -478,6 +512,32 @@ Business deserializeBusiness(IsarReader reader) { } } } + object.notice = IsarCore.readString(reader, 27); + { + final length = IsarCore.readList(reader, 28, IsarCore.readerPtrPtr); + { + final reader = IsarCore.readerPtr; + if (reader.isNull) { + object.logins = null; + } else { + final list = List.filled(length, IdValue(), growable: true); + for (var i = 0; i < length; i++) { + { + final objectReader = IsarCore.readObject(reader, i); + if (objectReader.isNull) { + list[i] = IdValue(); + } else { + final embedded = deserializeIdValue(objectReader); + IsarCore.freeReader(objectReader); + list[i] = embedded; + } + } + } + IsarCore.freeReader(reader); + object.logins = list; + } + } + } object.id = IsarCore.readId(reader); return object; } @@ -605,6 +665,35 @@ dynamic deserializeBusinessProp(IsarReader reader, int property) { } } } + case 27: + return IsarCore.readString(reader, 27); + case 28: + { + final length = IsarCore.readList(reader, 28, IsarCore.readerPtrPtr); + { + final reader = IsarCore.readerPtr; + if (reader.isNull) { + return null; + } else { + final list = + List.filled(length, IdValue(), growable: true); + for (var i = 0; i < length; i++) { + { + final objectReader = IsarCore.readObject(reader, i); + if (objectReader.isNull) { + list[i] = IdValue(); + } else { + final embedded = deserializeIdValue(objectReader); + IsarCore.freeReader(objectReader); + list[i] = embedded; + } + } + } + IsarCore.freeReader(reader); + return list; + } + } + } case 0: return IsarCore.readId(reader); default: @@ -637,6 +726,7 @@ sealed class _BusinessUpdate { String? addressRegion, String? addressFederalState, String? businessBio, + String? notice, }); } @@ -670,6 +760,7 @@ class _BusinessUpdateImpl implements _BusinessUpdate { Object? addressRegion = ignore, Object? addressFederalState = ignore, Object? businessBio = ignore, + Object? notice = ignore, }) { return collection.updateProperties([ id @@ -696,6 +787,7 @@ class _BusinessUpdateImpl implements _BusinessUpdate { if (addressRegion != ignore) 23: addressRegion as String?, if (addressFederalState != ignore) 24: addressFederalState as String?, if (businessBio != ignore) 25: businessBio as String?, + if (notice != ignore) 27: notice as String?, }) > 0; } @@ -726,6 +818,7 @@ sealed class _BusinessUpdateAll { String? addressRegion, String? addressFederalState, String? businessBio, + String? notice, }); } @@ -759,6 +852,7 @@ class _BusinessUpdateAllImpl implements _BusinessUpdateAll { Object? addressRegion = ignore, Object? addressFederalState = ignore, Object? businessBio = ignore, + Object? notice = ignore, }) { return collection.updateProperties(id, { if (name != ignore) 1: name as String?, @@ -783,6 +877,7 @@ class _BusinessUpdateAllImpl implements _BusinessUpdateAll { if (addressRegion != ignore) 23: addressRegion as String?, if (addressFederalState != ignore) 24: addressFederalState as String?, if (businessBio != ignore) 25: businessBio as String?, + if (notice != ignore) 27: notice as String?, }); } } @@ -817,6 +912,7 @@ sealed class _BusinessQueryUpdate { String? addressRegion, String? addressFederalState, String? businessBio, + String? notice, }); } @@ -850,6 +946,7 @@ class _BusinessQueryUpdateImpl implements _BusinessQueryUpdate { Object? addressRegion = ignore, Object? addressFederalState = ignore, Object? businessBio = ignore, + Object? notice = ignore, }) { return query.updateProperties(limit: limit, { if (name != ignore) 1: name as String?, @@ -874,6 +971,7 @@ class _BusinessQueryUpdateImpl implements _BusinessQueryUpdate { if (addressRegion != ignore) 23: addressRegion as String?, if (addressFederalState != ignore) 24: addressFederalState as String?, if (businessBio != ignore) 25: businessBio as String?, + if (notice != ignore) 27: notice as String?, }); } } @@ -915,6 +1013,7 @@ class _BusinessQueryBuilderUpdateImpl implements _BusinessQueryUpdate { Object? addressRegion = ignore, Object? addressFederalState = ignore, Object? businessBio = ignore, + Object? notice = ignore, }) { final q = query.build(); try { @@ -941,6 +1040,7 @@ class _BusinessQueryBuilderUpdateImpl implements _BusinessQueryUpdate { if (addressRegion != ignore) 23: addressRegion as String?, if (addressFederalState != ignore) 24: addressFederalState as String?, if (businessBio != ignore) 25: businessBio as String?, + if (notice != ignore) 27: notice as String?, }); } finally { q.close(); @@ -5262,6 +5362,218 @@ extension BusinessQueryFilter }); } + QueryBuilder noticeIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const IsNullCondition(property: 27)); + }); + } + + QueryBuilder noticeIsNotNull() { + return QueryBuilder.apply(not(), (query) { + return query.addFilterCondition(const IsNullCondition(property: 27)); + }); + } + + QueryBuilder noticeEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + EqualCondition( + property: 27, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder noticeGreaterThan( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + GreaterCondition( + property: 27, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder + noticeGreaterThanOrEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + GreaterOrEqualCondition( + property: 27, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder noticeLessThan( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + LessCondition( + property: 27, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder + noticeLessThanOrEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + LessOrEqualCondition( + property: 27, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder noticeBetween( + String? lower, + String? upper, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + BetweenCondition( + property: 27, + lower: lower, + upper: upper, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder noticeStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + StartsWithCondition( + property: 27, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder noticeEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + EndsWithCondition( + property: 27, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder noticeContains( + String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + ContainsCondition( + property: 27, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder noticeMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + MatchesCondition( + property: 27, + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder noticeIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + const EqualCondition( + property: 27, + value: '', + ), + ); + }); + } + + QueryBuilder noticeIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + const GreaterCondition( + property: 27, + value: '', + ), + ); + }); + } + + QueryBuilder loginsIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const IsNullCondition(property: 28)); + }); + } + + QueryBuilder loginsIsNotNull() { + return QueryBuilder.apply(not(), (query) { + return query.addFilterCondition(const IsNullCondition(property: 28)); + }); + } + + QueryBuilder loginsIsEmpty() { + return not().group( + (q) => q.loginsIsNull().or().loginsIsNotEmpty(), + ); + } + + QueryBuilder loginsIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + const GreaterOrEqualCondition(property: 28, value: null), + ); + }); + } + QueryBuilder idEqualTo( int value, ) { @@ -5824,6 +6136,27 @@ extension BusinessQuerySortBy on QueryBuilder { }); } + QueryBuilder sortByNotice( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy( + 27, + caseSensitive: caseSensitive, + ); + }); + } + + QueryBuilder sortByNoticeDesc( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy( + 27, + sort: Sort.desc, + caseSensitive: caseSensitive, + ); + }); + } + QueryBuilder sortById() { return QueryBuilder.apply(this, (query) { return query.addSortBy(0); @@ -6147,6 +6480,20 @@ extension BusinessQuerySortThenBy }); } + QueryBuilder thenByNotice( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(27, caseSensitive: caseSensitive); + }); + } + + QueryBuilder thenByNoticeDesc( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(27, sort: Sort.desc, caseSensitive: caseSensitive); + }); + } + QueryBuilder thenById() { return QueryBuilder.apply(this, (query) { return query.addSortBy(0); @@ -6315,6 +6662,13 @@ extension BusinessQueryWhereDistinct return query.addDistinctBy(25, caseSensitive: caseSensitive); }); } + + QueryBuilder distinctByNotice( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(27, caseSensitive: caseSensitive); + }); + } } extension BusinessQueryProperty1 @@ -6479,6 +6833,18 @@ extension BusinessQueryProperty1 }); } + QueryBuilder noticeProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(27); + }); + } + + QueryBuilder?, QAfterProperty> loginsProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(28); + }); + } + QueryBuilder idProperty() { return QueryBuilder.apply(this, (query) { return query.addProperty(0); @@ -6654,6 +7020,18 @@ extension BusinessQueryProperty2 }); } + QueryBuilder noticeProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(27); + }); + } + + QueryBuilder?), QAfterProperty> loginsProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(28); + }); + } + QueryBuilder idProperty() { return QueryBuilder.apply(this, (query) { return query.addProperty(0); @@ -6841,6 +7219,19 @@ extension BusinessQueryProperty3 }); } + QueryBuilder noticeProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(27); + }); + } + + QueryBuilder?), QOperations> + loginsProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(28); + }); + } + QueryBuilder idProperty() { return QueryBuilder.apply(this, (query) { return query.addProperty(0); @@ -6886,6 +7277,10 @@ Business _$BusinessFromJson(Map json) => Business() ..addressFederalState = json['field_2404136'] as String? ..businessBio = json['field_2404138'] as String? ..experienceReport = (json['field_2428872'] as List?) + ?.map((e) => IdValue.fromJson(e as Map)) + .toList() + ..notice = json['field_3137840'] as String? + ..logins = (json['field_3136789'] as List?) ?.map((e) => IdValue.fromJson(e as Map)) .toList(); @@ -6919,4 +7314,6 @@ Map _$BusinessToJson(Business instance) => { 'field_2404138': instance.businessBio, 'field_2428872': instance.experienceReport?.map((e) => e.toJson()).toList(), + 'field_3137840': instance.notice, + 'field_3136789': instance.logins?.map((e) => e.toJson()).toList(), }; diff --git a/lib/src/entity/login/login.dart b/lib/src/entity/login/login.dart new file mode 100644 index 0000000..776c5d2 --- /dev/null +++ b/lib/src/entity/login/login.dart @@ -0,0 +1,62 @@ +import 'package:ambito/src/entity/_general/file/file_part.dart'; +import 'package:ambito/src/entity/_general/id_value/id_value.dart'; +import 'package:ambito/src/entity/base_entity.dart'; +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:isar/isar.dart'; +import 'package:json_annotation/json_annotation.dart'; + +import '../_general/file/thumbnail.dart'; +import '../_general/file/thumbnails.dart'; + +part 'login.g.dart'; + +@collection +@JsonSerializable(explicitToJson: true) +class Login extends BaseEntity with EntityWithId { + Login(); + + @JsonKey(name: 'field_3136271') + String? username; + @JsonKey(name: 'field_3136278') + String? password; + @JsonKey(name: 'field_3136279') + List? images; + @JsonKey(name: 'field_3136280') + String? salutation; + @JsonKey(name: 'field_3136281') + String? title; + @JsonKey(name: 'field_3136282') + String? firstName; + @JsonKey(name: 'field_3136283') + String? lastName; + @JsonKey(name: 'field_3136294') + String? phone; + @JsonKey(name: 'field_3136284') + String? email; + @JsonKey(name: 'field_3136285') + List? business; + + factory Login.fromJson(Map json) => _$LoginFromJson(json); + + Map toJson() => _$LoginToJson(this); +} + +extension LoginExtension on Login { + Widget? getImage() { + Widget? image; + if (images != null && images!.isNotEmpty) { + if (images![0].thumbnails?.cardCover?.url != null) { + image = CachedNetworkImage( + width: 100, + height: 100, + imageUrl: images![0].thumbnails!.cardCover!.url!, + placeholder: (context, url) => const CircularProgressIndicator(), + errorWidget: (context, url, error) => const Icon(Icons.error), + fit: BoxFit.cover, + ); + } + } + return image; + } +} diff --git a/lib/src/entity/login/login.g.dart b/lib/src/entity/login/login.g.dart new file mode 100644 index 0000000..1dbffe8 --- /dev/null +++ b/lib/src/entity/login/login.g.dart @@ -0,0 +1,2729 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'login.dart'; + +// ************************************************************************** +// _IsarCollectionGenerator +// ************************************************************************** + +// coverage:ignore-file +// ignore_for_file: duplicate_ignore, invalid_use_of_protected_member, lines_longer_than_80_chars, constant_identifier_names, avoid_js_rounded_ints, no_leading_underscores_for_local_identifiers, require_trailing_commas, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_in_if_null_operators, library_private_types_in_public_api, prefer_const_constructors +// ignore_for_file: type=lint + +extension GetLoginCollection on Isar { + IsarCollection get logins => this.collection(); +} + +const LoginSchema = IsarGeneratedSchema( + schema: IsarSchema( + name: 'Login', + idName: 'id', + embedded: false, + properties: [ + IsarPropertySchema( + name: 'username', + type: IsarType.string, + ), + IsarPropertySchema( + name: 'password', + type: IsarType.string, + ), + IsarPropertySchema( + name: 'images', + type: IsarType.objectList, + target: 'FilePart', + ), + IsarPropertySchema( + name: 'salutation', + type: IsarType.string, + ), + IsarPropertySchema( + name: 'title', + type: IsarType.string, + ), + IsarPropertySchema( + name: 'firstName', + type: IsarType.string, + ), + IsarPropertySchema( + name: 'lastName', + type: IsarType.string, + ), + IsarPropertySchema( + name: 'phone', + type: IsarType.string, + ), + IsarPropertySchema( + name: 'email', + type: IsarType.string, + ), + IsarPropertySchema( + name: 'business', + type: IsarType.objectList, + target: 'IdValue', + ), + ], + indexes: [], + ), + converter: IsarObjectConverter( + serialize: serializeLogin, + deserialize: deserializeLogin, + deserializeProperty: deserializeLoginProp, + ), + embeddedSchemas: [ + FilePartSchema, + ThumbnailsSchema, + ThumbnailSchema, + IdValueSchema + ], +); + +@isarProtected +int serializeLogin(IsarWriter writer, Login object) { + { + final value = object.username; + if (value == null) { + IsarCore.writeNull(writer, 1); + } else { + IsarCore.writeString(writer, 1, value); + } + } + { + final value = object.password; + if (value == null) { + IsarCore.writeNull(writer, 2); + } else { + IsarCore.writeString(writer, 2, value); + } + } + { + final list = object.images; + if (list == null) { + IsarCore.writeNull(writer, 3); + } else { + final listWriter = IsarCore.beginList(writer, 3, list.length); + for (var i = 0; i < list.length; i++) { + { + final value = list[i]; + final objectWriter = IsarCore.beginObject(listWriter, i); + serializeFilePart(objectWriter, value); + IsarCore.endObject(listWriter, objectWriter); + } + } + IsarCore.endList(writer, listWriter); + } + } + { + final value = object.salutation; + if (value == null) { + IsarCore.writeNull(writer, 4); + } else { + IsarCore.writeString(writer, 4, value); + } + } + { + final value = object.title; + if (value == null) { + IsarCore.writeNull(writer, 5); + } else { + IsarCore.writeString(writer, 5, value); + } + } + { + final value = object.firstName; + if (value == null) { + IsarCore.writeNull(writer, 6); + } else { + IsarCore.writeString(writer, 6, value); + } + } + { + final value = object.lastName; + if (value == null) { + IsarCore.writeNull(writer, 7); + } else { + IsarCore.writeString(writer, 7, value); + } + } + { + final value = object.phone; + if (value == null) { + IsarCore.writeNull(writer, 8); + } else { + IsarCore.writeString(writer, 8, value); + } + } + { + final value = object.email; + if (value == null) { + IsarCore.writeNull(writer, 9); + } else { + IsarCore.writeString(writer, 9, value); + } + } + { + final list = object.business; + if (list == null) { + IsarCore.writeNull(writer, 10); + } else { + final listWriter = IsarCore.beginList(writer, 10, list.length); + for (var i = 0; i < list.length; i++) { + { + final value = list[i]; + final objectWriter = IsarCore.beginObject(listWriter, i); + serializeIdValue(objectWriter, value); + IsarCore.endObject(listWriter, objectWriter); + } + } + IsarCore.endList(writer, listWriter); + } + } + return object.id; +} + +@isarProtected +Login deserializeLogin(IsarReader reader) { + final object = Login(); + object.username = IsarCore.readString(reader, 1); + object.password = IsarCore.readString(reader, 2); + { + final length = IsarCore.readList(reader, 3, IsarCore.readerPtrPtr); + { + final reader = IsarCore.readerPtr; + if (reader.isNull) { + object.images = null; + } else { + final list = List.filled(length, FilePart(), growable: true); + for (var i = 0; i < length; i++) { + { + final objectReader = IsarCore.readObject(reader, i); + if (objectReader.isNull) { + list[i] = FilePart(); + } else { + final embedded = deserializeFilePart(objectReader); + IsarCore.freeReader(objectReader); + list[i] = embedded; + } + } + } + IsarCore.freeReader(reader); + object.images = list; + } + } + } + object.salutation = IsarCore.readString(reader, 4); + object.title = IsarCore.readString(reader, 5); + object.firstName = IsarCore.readString(reader, 6); + object.lastName = IsarCore.readString(reader, 7); + object.phone = IsarCore.readString(reader, 8); + object.email = IsarCore.readString(reader, 9); + { + final length = IsarCore.readList(reader, 10, IsarCore.readerPtrPtr); + { + final reader = IsarCore.readerPtr; + if (reader.isNull) { + object.business = null; + } else { + final list = List.filled(length, IdValue(), growable: true); + for (var i = 0; i < length; i++) { + { + final objectReader = IsarCore.readObject(reader, i); + if (objectReader.isNull) { + list[i] = IdValue(); + } else { + final embedded = deserializeIdValue(objectReader); + IsarCore.freeReader(objectReader); + list[i] = embedded; + } + } + } + IsarCore.freeReader(reader); + object.business = list; + } + } + } + object.id = IsarCore.readId(reader); + return object; +} + +@isarProtected +dynamic deserializeLoginProp(IsarReader reader, int property) { + switch (property) { + case 1: + return IsarCore.readString(reader, 1); + case 2: + return IsarCore.readString(reader, 2); + case 3: + { + final length = IsarCore.readList(reader, 3, IsarCore.readerPtrPtr); + { + final reader = IsarCore.readerPtr; + if (reader.isNull) { + return null; + } else { + final list = + List.filled(length, FilePart(), growable: true); + for (var i = 0; i < length; i++) { + { + final objectReader = IsarCore.readObject(reader, i); + if (objectReader.isNull) { + list[i] = FilePart(); + } else { + final embedded = deserializeFilePart(objectReader); + IsarCore.freeReader(objectReader); + list[i] = embedded; + } + } + } + IsarCore.freeReader(reader); + return list; + } + } + } + case 4: + return IsarCore.readString(reader, 4); + case 5: + return IsarCore.readString(reader, 5); + case 6: + return IsarCore.readString(reader, 6); + case 7: + return IsarCore.readString(reader, 7); + case 8: + return IsarCore.readString(reader, 8); + case 9: + return IsarCore.readString(reader, 9); + case 10: + { + final length = IsarCore.readList(reader, 10, IsarCore.readerPtrPtr); + { + final reader = IsarCore.readerPtr; + if (reader.isNull) { + return null; + } else { + final list = + List.filled(length, IdValue(), growable: true); + for (var i = 0; i < length; i++) { + { + final objectReader = IsarCore.readObject(reader, i); + if (objectReader.isNull) { + list[i] = IdValue(); + } else { + final embedded = deserializeIdValue(objectReader); + IsarCore.freeReader(objectReader); + list[i] = embedded; + } + } + } + IsarCore.freeReader(reader); + return list; + } + } + } + case 0: + return IsarCore.readId(reader); + default: + throw ArgumentError('Unknown property: $property'); + } +} + +sealed class _LoginUpdate { + bool call({ + required int id, + String? username, + String? password, + String? salutation, + String? title, + String? firstName, + String? lastName, + String? phone, + String? email, + }); +} + +class _LoginUpdateImpl implements _LoginUpdate { + const _LoginUpdateImpl(this.collection); + + final IsarCollection collection; + + @override + bool call({ + required int id, + Object? username = ignore, + Object? password = ignore, + Object? salutation = ignore, + Object? title = ignore, + Object? firstName = ignore, + Object? lastName = ignore, + Object? phone = ignore, + Object? email = ignore, + }) { + return collection.updateProperties([ + id + ], { + if (username != ignore) 1: username as String?, + if (password != ignore) 2: password as String?, + if (salutation != ignore) 4: salutation as String?, + if (title != ignore) 5: title as String?, + if (firstName != ignore) 6: firstName as String?, + if (lastName != ignore) 7: lastName as String?, + if (phone != ignore) 8: phone as String?, + if (email != ignore) 9: email as String?, + }) > + 0; + } +} + +sealed class _LoginUpdateAll { + int call({ + required List id, + String? username, + String? password, + String? salutation, + String? title, + String? firstName, + String? lastName, + String? phone, + String? email, + }); +} + +class _LoginUpdateAllImpl implements _LoginUpdateAll { + const _LoginUpdateAllImpl(this.collection); + + final IsarCollection collection; + + @override + int call({ + required List id, + Object? username = ignore, + Object? password = ignore, + Object? salutation = ignore, + Object? title = ignore, + Object? firstName = ignore, + Object? lastName = ignore, + Object? phone = ignore, + Object? email = ignore, + }) { + return collection.updateProperties(id, { + if (username != ignore) 1: username as String?, + if (password != ignore) 2: password as String?, + if (salutation != ignore) 4: salutation as String?, + if (title != ignore) 5: title as String?, + if (firstName != ignore) 6: firstName as String?, + if (lastName != ignore) 7: lastName as String?, + if (phone != ignore) 8: phone as String?, + if (email != ignore) 9: email as String?, + }); + } +} + +extension LoginUpdate on IsarCollection { + _LoginUpdate get update => _LoginUpdateImpl(this); + + _LoginUpdateAll get updateAll => _LoginUpdateAllImpl(this); +} + +sealed class _LoginQueryUpdate { + int call({ + String? username, + String? password, + String? salutation, + String? title, + String? firstName, + String? lastName, + String? phone, + String? email, + }); +} + +class _LoginQueryUpdateImpl implements _LoginQueryUpdate { + const _LoginQueryUpdateImpl(this.query, {this.limit}); + + final IsarQuery query; + final int? limit; + + @override + int call({ + Object? username = ignore, + Object? password = ignore, + Object? salutation = ignore, + Object? title = ignore, + Object? firstName = ignore, + Object? lastName = ignore, + Object? phone = ignore, + Object? email = ignore, + }) { + return query.updateProperties(limit: limit, { + if (username != ignore) 1: username as String?, + if (password != ignore) 2: password as String?, + if (salutation != ignore) 4: salutation as String?, + if (title != ignore) 5: title as String?, + if (firstName != ignore) 6: firstName as String?, + if (lastName != ignore) 7: lastName as String?, + if (phone != ignore) 8: phone as String?, + if (email != ignore) 9: email as String?, + }); + } +} + +extension LoginQueryUpdate on IsarQuery { + _LoginQueryUpdate get updateFirst => _LoginQueryUpdateImpl(this, limit: 1); + + _LoginQueryUpdate get updateAll => _LoginQueryUpdateImpl(this); +} + +class _LoginQueryBuilderUpdateImpl implements _LoginQueryUpdate { + const _LoginQueryBuilderUpdateImpl(this.query, {this.limit}); + + final QueryBuilder query; + final int? limit; + + @override + int call({ + Object? username = ignore, + Object? password = ignore, + Object? salutation = ignore, + Object? title = ignore, + Object? firstName = ignore, + Object? lastName = ignore, + Object? phone = ignore, + Object? email = ignore, + }) { + final q = query.build(); + try { + return q.updateProperties(limit: limit, { + if (username != ignore) 1: username as String?, + if (password != ignore) 2: password as String?, + if (salutation != ignore) 4: salutation as String?, + if (title != ignore) 5: title as String?, + if (firstName != ignore) 6: firstName as String?, + if (lastName != ignore) 7: lastName as String?, + if (phone != ignore) 8: phone as String?, + if (email != ignore) 9: email as String?, + }); + } finally { + q.close(); + } + } +} + +extension LoginQueryBuilderUpdate on QueryBuilder { + _LoginQueryUpdate get updateFirst => + _LoginQueryBuilderUpdateImpl(this, limit: 1); + + _LoginQueryUpdate get updateAll => _LoginQueryBuilderUpdateImpl(this); +} + +extension LoginQueryFilter on QueryBuilder { + QueryBuilder usernameIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const IsNullCondition(property: 1)); + }); + } + + QueryBuilder usernameIsNotNull() { + return QueryBuilder.apply(not(), (query) { + return query.addFilterCondition(const IsNullCondition(property: 1)); + }); + } + + QueryBuilder usernameEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + EqualCondition( + property: 1, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder usernameGreaterThan( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + GreaterCondition( + property: 1, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder + usernameGreaterThanOrEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + GreaterOrEqualCondition( + property: 1, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder usernameLessThan( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + LessCondition( + property: 1, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder usernameLessThanOrEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + LessOrEqualCondition( + property: 1, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder usernameBetween( + String? lower, + String? upper, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + BetweenCondition( + property: 1, + lower: lower, + upper: upper, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder usernameStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + StartsWithCondition( + property: 1, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder usernameEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + EndsWithCondition( + property: 1, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder usernameContains( + String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + ContainsCondition( + property: 1, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder usernameMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + MatchesCondition( + property: 1, + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder usernameIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + const EqualCondition( + property: 1, + value: '', + ), + ); + }); + } + + QueryBuilder usernameIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + const GreaterCondition( + property: 1, + value: '', + ), + ); + }); + } + + QueryBuilder passwordIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const IsNullCondition(property: 2)); + }); + } + + QueryBuilder passwordIsNotNull() { + return QueryBuilder.apply(not(), (query) { + return query.addFilterCondition(const IsNullCondition(property: 2)); + }); + } + + QueryBuilder passwordEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + EqualCondition( + property: 2, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder passwordGreaterThan( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + GreaterCondition( + property: 2, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder + passwordGreaterThanOrEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + GreaterOrEqualCondition( + property: 2, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder passwordLessThan( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + LessCondition( + property: 2, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder passwordLessThanOrEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + LessOrEqualCondition( + property: 2, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder passwordBetween( + String? lower, + String? upper, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + BetweenCondition( + property: 2, + lower: lower, + upper: upper, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder passwordStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + StartsWithCondition( + property: 2, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder passwordEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + EndsWithCondition( + property: 2, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder passwordContains( + String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + ContainsCondition( + property: 2, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder passwordMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + MatchesCondition( + property: 2, + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder passwordIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + const EqualCondition( + property: 2, + value: '', + ), + ); + }); + } + + QueryBuilder passwordIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + const GreaterCondition( + property: 2, + value: '', + ), + ); + }); + } + + QueryBuilder imagesIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const IsNullCondition(property: 3)); + }); + } + + QueryBuilder imagesIsNotNull() { + return QueryBuilder.apply(not(), (query) { + return query.addFilterCondition(const IsNullCondition(property: 3)); + }); + } + + QueryBuilder imagesIsEmpty() { + return not().group( + (q) => q.imagesIsNull().or().imagesIsNotEmpty(), + ); + } + + QueryBuilder imagesIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + const GreaterOrEqualCondition(property: 3, value: null), + ); + }); + } + + QueryBuilder salutationIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const IsNullCondition(property: 4)); + }); + } + + QueryBuilder salutationIsNotNull() { + return QueryBuilder.apply(not(), (query) { + return query.addFilterCondition(const IsNullCondition(property: 4)); + }); + } + + QueryBuilder salutationEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + EqualCondition( + property: 4, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder salutationGreaterThan( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + GreaterCondition( + property: 4, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder + salutationGreaterThanOrEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + GreaterOrEqualCondition( + property: 4, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder salutationLessThan( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + LessCondition( + property: 4, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder salutationLessThanOrEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + LessOrEqualCondition( + property: 4, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder salutationBetween( + String? lower, + String? upper, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + BetweenCondition( + property: 4, + lower: lower, + upper: upper, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder salutationStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + StartsWithCondition( + property: 4, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder salutationEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + EndsWithCondition( + property: 4, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder salutationContains( + String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + ContainsCondition( + property: 4, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder salutationMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + MatchesCondition( + property: 4, + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder salutationIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + const EqualCondition( + property: 4, + value: '', + ), + ); + }); + } + + QueryBuilder salutationIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + const GreaterCondition( + property: 4, + value: '', + ), + ); + }); + } + + QueryBuilder titleIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const IsNullCondition(property: 5)); + }); + } + + QueryBuilder titleIsNotNull() { + return QueryBuilder.apply(not(), (query) { + return query.addFilterCondition(const IsNullCondition(property: 5)); + }); + } + + QueryBuilder titleEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + EqualCondition( + property: 5, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder titleGreaterThan( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + GreaterCondition( + property: 5, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder titleGreaterThanOrEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + GreaterOrEqualCondition( + property: 5, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder titleLessThan( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + LessCondition( + property: 5, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder titleLessThanOrEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + LessOrEqualCondition( + property: 5, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder titleBetween( + String? lower, + String? upper, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + BetweenCondition( + property: 5, + lower: lower, + upper: upper, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder titleStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + StartsWithCondition( + property: 5, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder titleEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + EndsWithCondition( + property: 5, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder titleContains(String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + ContainsCondition( + property: 5, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder titleMatches(String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + MatchesCondition( + property: 5, + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder titleIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + const EqualCondition( + property: 5, + value: '', + ), + ); + }); + } + + QueryBuilder titleIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + const GreaterCondition( + property: 5, + value: '', + ), + ); + }); + } + + QueryBuilder firstNameIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const IsNullCondition(property: 6)); + }); + } + + QueryBuilder firstNameIsNotNull() { + return QueryBuilder.apply(not(), (query) { + return query.addFilterCondition(const IsNullCondition(property: 6)); + }); + } + + QueryBuilder firstNameEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + EqualCondition( + property: 6, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder firstNameGreaterThan( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + GreaterCondition( + property: 6, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder + firstNameGreaterThanOrEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + GreaterOrEqualCondition( + property: 6, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder firstNameLessThan( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + LessCondition( + property: 6, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder firstNameLessThanOrEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + LessOrEqualCondition( + property: 6, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder firstNameBetween( + String? lower, + String? upper, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + BetweenCondition( + property: 6, + lower: lower, + upper: upper, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder firstNameStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + StartsWithCondition( + property: 6, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder firstNameEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + EndsWithCondition( + property: 6, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder firstNameContains( + String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + ContainsCondition( + property: 6, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder firstNameMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + MatchesCondition( + property: 6, + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder firstNameIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + const EqualCondition( + property: 6, + value: '', + ), + ); + }); + } + + QueryBuilder firstNameIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + const GreaterCondition( + property: 6, + value: '', + ), + ); + }); + } + + QueryBuilder lastNameIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const IsNullCondition(property: 7)); + }); + } + + QueryBuilder lastNameIsNotNull() { + return QueryBuilder.apply(not(), (query) { + return query.addFilterCondition(const IsNullCondition(property: 7)); + }); + } + + QueryBuilder lastNameEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + EqualCondition( + property: 7, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder lastNameGreaterThan( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + GreaterCondition( + property: 7, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder + lastNameGreaterThanOrEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + GreaterOrEqualCondition( + property: 7, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder lastNameLessThan( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + LessCondition( + property: 7, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder lastNameLessThanOrEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + LessOrEqualCondition( + property: 7, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder lastNameBetween( + String? lower, + String? upper, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + BetweenCondition( + property: 7, + lower: lower, + upper: upper, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder lastNameStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + StartsWithCondition( + property: 7, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder lastNameEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + EndsWithCondition( + property: 7, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder lastNameContains( + String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + ContainsCondition( + property: 7, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder lastNameMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + MatchesCondition( + property: 7, + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder lastNameIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + const EqualCondition( + property: 7, + value: '', + ), + ); + }); + } + + QueryBuilder lastNameIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + const GreaterCondition( + property: 7, + value: '', + ), + ); + }); + } + + QueryBuilder phoneIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const IsNullCondition(property: 8)); + }); + } + + QueryBuilder phoneIsNotNull() { + return QueryBuilder.apply(not(), (query) { + return query.addFilterCondition(const IsNullCondition(property: 8)); + }); + } + + QueryBuilder phoneEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + EqualCondition( + property: 8, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder phoneGreaterThan( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + GreaterCondition( + property: 8, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder phoneGreaterThanOrEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + GreaterOrEqualCondition( + property: 8, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder phoneLessThan( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + LessCondition( + property: 8, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder phoneLessThanOrEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + LessOrEqualCondition( + property: 8, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder phoneBetween( + String? lower, + String? upper, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + BetweenCondition( + property: 8, + lower: lower, + upper: upper, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder phoneStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + StartsWithCondition( + property: 8, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder phoneEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + EndsWithCondition( + property: 8, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder phoneContains(String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + ContainsCondition( + property: 8, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder phoneMatches(String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + MatchesCondition( + property: 8, + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder phoneIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + const EqualCondition( + property: 8, + value: '', + ), + ); + }); + } + + QueryBuilder phoneIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + const GreaterCondition( + property: 8, + value: '', + ), + ); + }); + } + + QueryBuilder emailIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const IsNullCondition(property: 9)); + }); + } + + QueryBuilder emailIsNotNull() { + return QueryBuilder.apply(not(), (query) { + return query.addFilterCondition(const IsNullCondition(property: 9)); + }); + } + + QueryBuilder emailEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + EqualCondition( + property: 9, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder emailGreaterThan( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + GreaterCondition( + property: 9, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder emailGreaterThanOrEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + GreaterOrEqualCondition( + property: 9, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder emailLessThan( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + LessCondition( + property: 9, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder emailLessThanOrEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + LessOrEqualCondition( + property: 9, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder emailBetween( + String? lower, + String? upper, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + BetweenCondition( + property: 9, + lower: lower, + upper: upper, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder emailStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + StartsWithCondition( + property: 9, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder emailEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + EndsWithCondition( + property: 9, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder emailContains(String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + ContainsCondition( + property: 9, + value: value, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder emailMatches(String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + MatchesCondition( + property: 9, + wildcard: pattern, + caseSensitive: caseSensitive, + ), + ); + }); + } + + QueryBuilder emailIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + const EqualCondition( + property: 9, + value: '', + ), + ); + }); + } + + QueryBuilder emailIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + const GreaterCondition( + property: 9, + value: '', + ), + ); + }); + } + + QueryBuilder businessIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const IsNullCondition(property: 10)); + }); + } + + QueryBuilder businessIsNotNull() { + return QueryBuilder.apply(not(), (query) { + return query.addFilterCondition(const IsNullCondition(property: 10)); + }); + } + + QueryBuilder businessIsEmpty() { + return not().group( + (q) => q.businessIsNull().or().businessIsNotEmpty(), + ); + } + + QueryBuilder businessIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + const GreaterOrEqualCondition(property: 10, value: null), + ); + }); + } + + QueryBuilder idEqualTo( + int value, + ) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + EqualCondition( + property: 0, + value: value, + ), + ); + }); + } + + QueryBuilder idGreaterThan( + int value, + ) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + GreaterCondition( + property: 0, + value: value, + ), + ); + }); + } + + QueryBuilder idGreaterThanOrEqualTo( + int value, + ) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + GreaterOrEqualCondition( + property: 0, + value: value, + ), + ); + }); + } + + QueryBuilder idLessThan( + int value, + ) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + LessCondition( + property: 0, + value: value, + ), + ); + }); + } + + QueryBuilder idLessThanOrEqualTo( + int value, + ) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + LessOrEqualCondition( + property: 0, + value: value, + ), + ); + }); + } + + QueryBuilder idBetween( + int lower, + int upper, + ) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition( + BetweenCondition( + property: 0, + lower: lower, + upper: upper, + ), + ); + }); + } +} + +extension LoginQueryObject on QueryBuilder {} + +extension LoginQuerySortBy on QueryBuilder { + QueryBuilder sortByUsername( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy( + 1, + caseSensitive: caseSensitive, + ); + }); + } + + QueryBuilder sortByUsernameDesc( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy( + 1, + sort: Sort.desc, + caseSensitive: caseSensitive, + ); + }); + } + + QueryBuilder sortByPassword( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy( + 2, + caseSensitive: caseSensitive, + ); + }); + } + + QueryBuilder sortByPasswordDesc( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy( + 2, + sort: Sort.desc, + caseSensitive: caseSensitive, + ); + }); + } + + QueryBuilder sortBySalutation( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy( + 4, + caseSensitive: caseSensitive, + ); + }); + } + + QueryBuilder sortBySalutationDesc( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy( + 4, + sort: Sort.desc, + caseSensitive: caseSensitive, + ); + }); + } + + QueryBuilder sortByTitle( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy( + 5, + caseSensitive: caseSensitive, + ); + }); + } + + QueryBuilder sortByTitleDesc( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy( + 5, + sort: Sort.desc, + caseSensitive: caseSensitive, + ); + }); + } + + QueryBuilder sortByFirstName( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy( + 6, + caseSensitive: caseSensitive, + ); + }); + } + + QueryBuilder sortByFirstNameDesc( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy( + 6, + sort: Sort.desc, + caseSensitive: caseSensitive, + ); + }); + } + + QueryBuilder sortByLastName( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy( + 7, + caseSensitive: caseSensitive, + ); + }); + } + + QueryBuilder sortByLastNameDesc( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy( + 7, + sort: Sort.desc, + caseSensitive: caseSensitive, + ); + }); + } + + QueryBuilder sortByPhone( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy( + 8, + caseSensitive: caseSensitive, + ); + }); + } + + QueryBuilder sortByPhoneDesc( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy( + 8, + sort: Sort.desc, + caseSensitive: caseSensitive, + ); + }); + } + + QueryBuilder sortByEmail( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy( + 9, + caseSensitive: caseSensitive, + ); + }); + } + + QueryBuilder sortByEmailDesc( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy( + 9, + sort: Sort.desc, + caseSensitive: caseSensitive, + ); + }); + } + + QueryBuilder sortById() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(0); + }); + } + + QueryBuilder sortByIdDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(0, sort: Sort.desc); + }); + } +} + +extension LoginQuerySortThenBy on QueryBuilder { + QueryBuilder thenByUsername( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(1, caseSensitive: caseSensitive); + }); + } + + QueryBuilder thenByUsernameDesc( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(1, sort: Sort.desc, caseSensitive: caseSensitive); + }); + } + + QueryBuilder thenByPassword( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(2, caseSensitive: caseSensitive); + }); + } + + QueryBuilder thenByPasswordDesc( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(2, sort: Sort.desc, caseSensitive: caseSensitive); + }); + } + + QueryBuilder thenBySalutation( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(4, caseSensitive: caseSensitive); + }); + } + + QueryBuilder thenBySalutationDesc( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(4, sort: Sort.desc, caseSensitive: caseSensitive); + }); + } + + QueryBuilder thenByTitle( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(5, caseSensitive: caseSensitive); + }); + } + + QueryBuilder thenByTitleDesc( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(5, sort: Sort.desc, caseSensitive: caseSensitive); + }); + } + + QueryBuilder thenByFirstName( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(6, caseSensitive: caseSensitive); + }); + } + + QueryBuilder thenByFirstNameDesc( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(6, sort: Sort.desc, caseSensitive: caseSensitive); + }); + } + + QueryBuilder thenByLastName( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(7, caseSensitive: caseSensitive); + }); + } + + QueryBuilder thenByLastNameDesc( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(7, sort: Sort.desc, caseSensitive: caseSensitive); + }); + } + + QueryBuilder thenByPhone( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(8, caseSensitive: caseSensitive); + }); + } + + QueryBuilder thenByPhoneDesc( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(8, sort: Sort.desc, caseSensitive: caseSensitive); + }); + } + + QueryBuilder thenByEmail( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(9, caseSensitive: caseSensitive); + }); + } + + QueryBuilder thenByEmailDesc( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(9, sort: Sort.desc, caseSensitive: caseSensitive); + }); + } + + QueryBuilder thenById() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(0); + }); + } + + QueryBuilder thenByIdDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(0, sort: Sort.desc); + }); + } +} + +extension LoginQueryWhereDistinct on QueryBuilder { + QueryBuilder distinctByUsername( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(1, caseSensitive: caseSensitive); + }); + } + + QueryBuilder distinctByPassword( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(2, caseSensitive: caseSensitive); + }); + } + + QueryBuilder distinctBySalutation( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(4, caseSensitive: caseSensitive); + }); + } + + QueryBuilder distinctByTitle( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(5, caseSensitive: caseSensitive); + }); + } + + QueryBuilder distinctByFirstName( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(6, caseSensitive: caseSensitive); + }); + } + + QueryBuilder distinctByLastName( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(7, caseSensitive: caseSensitive); + }); + } + + QueryBuilder distinctByPhone( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(8, caseSensitive: caseSensitive); + }); + } + + QueryBuilder distinctByEmail( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(9, caseSensitive: caseSensitive); + }); + } +} + +extension LoginQueryProperty1 on QueryBuilder { + QueryBuilder usernameProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(1); + }); + } + + QueryBuilder passwordProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(2); + }); + } + + QueryBuilder?, QAfterProperty> imagesProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(3); + }); + } + + QueryBuilder salutationProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(4); + }); + } + + QueryBuilder titleProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(5); + }); + } + + QueryBuilder firstNameProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(6); + }); + } + + QueryBuilder lastNameProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(7); + }); + } + + QueryBuilder phoneProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(8); + }); + } + + QueryBuilder emailProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(9); + }); + } + + QueryBuilder?, QAfterProperty> businessProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(10); + }); + } + + QueryBuilder idProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(0); + }); + } +} + +extension LoginQueryProperty2 on QueryBuilder { + QueryBuilder usernameProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(1); + }); + } + + QueryBuilder passwordProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(2); + }); + } + + QueryBuilder?), QAfterProperty> imagesProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(3); + }); + } + + QueryBuilder salutationProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(4); + }); + } + + QueryBuilder titleProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(5); + }); + } + + QueryBuilder firstNameProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(6); + }); + } + + QueryBuilder lastNameProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(7); + }); + } + + QueryBuilder phoneProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(8); + }); + } + + QueryBuilder emailProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(9); + }); + } + + QueryBuilder?), QAfterProperty> businessProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(10); + }); + } + + QueryBuilder idProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(0); + }); + } +} + +extension LoginQueryProperty3 + on QueryBuilder { + QueryBuilder usernameProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(1); + }); + } + + QueryBuilder passwordProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(2); + }); + } + + QueryBuilder?), QOperations> imagesProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(3); + }); + } + + QueryBuilder salutationProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(4); + }); + } + + QueryBuilder titleProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(5); + }); + } + + QueryBuilder firstNameProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(6); + }); + } + + QueryBuilder lastNameProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(7); + }); + } + + QueryBuilder phoneProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(8); + }); + } + + QueryBuilder emailProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(9); + }); + } + + QueryBuilder?), QOperations> + businessProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(10); + }); + } + + QueryBuilder idProperty() { + return QueryBuilder.apply(this, (query) { + return query.addProperty(0); + }); + } +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Login _$LoginFromJson(Map json) => Login() + ..id = (json['id'] as num).toInt() + ..username = json['field_3136271'] as String? + ..password = json['field_3136278'] as String? + ..images = (json['field_3136279'] as List?) + ?.map((e) => FilePart.fromJson(e as Map)) + .toList() + ..salutation = json['field_3136280'] as String? + ..title = json['field_3136281'] as String? + ..firstName = json['field_3136282'] as String? + ..lastName = json['field_3136283'] as String? + ..phone = json['field_3136294'] as String? + ..email = json['field_3136284'] as String? + ..business = (json['field_3136285'] as List?) + ?.map((e) => IdValue.fromJson(e as Map)) + .toList(); + +Map _$LoginToJson(Login instance) => { + 'id': instance.id, + 'field_3136271': instance.username, + 'field_3136278': instance.password, + 'field_3136279': instance.images?.map((e) => e.toJson()).toList(), + 'field_3136280': instance.salutation, + 'field_3136281': instance.title, + 'field_3136282': instance.firstName, + 'field_3136283': instance.lastName, + 'field_3136294': instance.phone, + 'field_3136284': instance.email, + 'field_3136285': instance.business?.map((e) => e.toJson()).toList(), + }; diff --git a/lib/src/entity/login/login_repository.dart b/lib/src/entity/login/login_repository.dart new file mode 100644 index 0000000..a708314 --- /dev/null +++ b/lib/src/entity/login/login_repository.dart @@ -0,0 +1,22 @@ +import 'dart:convert'; + +import 'package:ambito/src/entity/login/login.dart'; +import 'package:ambito/src/packages/ambito_db/base_db.dart'; +import 'package:crypto/crypto.dart'; +import 'package:isar/isar.dart'; + +import '../../consts/consts.dart'; + +class LoginRepository extends BaseDB { + @override + IsarCollection collection = isar.logins; + + Login? getLogin(String username, String password) { + return isar.logins + .where() + .usernameEqualTo(username) + .and() + .passwordEqualTo(sha1.convert(utf8.encode(password)).toString()) + .findFirst(); + } +} diff --git a/lib/src/entity/measure/months/measure_months_datasource.dart b/lib/src/entity/measure/months/measure_months_datasource.dart index 16b5c7b..dd3d344 100644 --- a/lib/src/entity/measure/months/measure_months_datasource.dart +++ b/lib/src/entity/measure/months/measure_months_datasource.dart @@ -18,73 +18,73 @@ class MeasureMonthsDatasource extends DataGridSource { value: dataGridRow.name, ), DataGridCell( - columnName: 'jan', + columnName: 'Jan', value: type == 'apply' ? dataGridRow.applyList![0] : dataGridRow.maintenanceList![0], ), DataGridCell( - columnName: 'feb', + columnName: 'Feb', value: type == 'apply' ? dataGridRow.applyList![1] : dataGridRow.maintenanceList![1], ), DataGridCell( - columnName: 'mar', + columnName: 'Mär', value: type == 'apply' ? dataGridRow.applyList![2] : dataGridRow.maintenanceList![2], ), DataGridCell( - columnName: 'apr', + columnName: 'Apr', value: type == 'apply' ? dataGridRow.applyList![3] : dataGridRow.maintenanceList![3], ), DataGridCell( - columnName: 'may', + columnName: 'Mai', value: type == 'apply' ? dataGridRow.applyList![4] : dataGridRow.maintenanceList![4], ), DataGridCell( - columnName: 'jun', + columnName: 'Jun', value: type == 'apply' ? dataGridRow.applyList![5] : dataGridRow.maintenanceList![5], ), DataGridCell( - columnName: 'jul', + columnName: 'Jul', value: type == 'apply' ? dataGridRow.applyList![6] : dataGridRow.maintenanceList![6], ), DataGridCell( - columnName: 'aug', + columnName: 'Aug', value: type == 'apply' ? dataGridRow.applyList![7] : dataGridRow.maintenanceList![7], ), DataGridCell( - columnName: 'sep', + columnName: 'Sep', value: type == 'apply' ? dataGridRow.applyList![8] : dataGridRow.maintenanceList![8], ), DataGridCell( - columnName: 'oct', + columnName: 'Okt', value: type == 'apply' ? dataGridRow.applyList![9] : dataGridRow.maintenanceList![9], ), DataGridCell( - columnName: 'nov', + columnName: 'Nov', value: type == 'apply' ? dataGridRow.applyList![10] : dataGridRow.maintenanceList![10], ), DataGridCell( - columnName: 'dec', + columnName: 'Dez', value: type == 'apply' ? dataGridRow.applyList![11] : dataGridRow.maintenanceList![11], @@ -114,16 +114,18 @@ class MeasureMonthsDatasource extends DataGridSource { return Container( alignment: Alignment.centerLeft, padding: const EdgeInsets.symmetric(horizontal: 10.0), - child: Text( - dataGridCell.value, - overflow: TextOverflow.ellipsis, - style: theme.bodyMedium.copyWith( - color: theme.currentColorScheme.primary, + child: InkWell( + child: Text( + dataGridCell.value, + overflow: TextOverflow.ellipsis, + style: theme.bodyMedium.copyWith( + color: theme.currentColorScheme.primary, + ), ), ), ); } - Widget content = SizedBox(); + Widget? content; if (type == 'apply' && dataGridCell.value == true) { content = Icon( Icons.carpenter_outlined, @@ -139,7 +141,7 @@ class MeasureMonthsDatasource extends DataGridSource { return Container( alignment: Alignment.centerLeft, padding: const EdgeInsets.symmetric(horizontal: 10.0), - child: content, + child: content ?? SizedBox(), ); }, ).toList()); diff --git a/lib/src/packages/ambito_api/base_api.dart b/lib/src/packages/ambito_api/base_api.dart index 725ace0..389d723 100644 --- a/lib/src/packages/ambito_api/base_api.dart +++ b/lib/src/packages/ambito_api/base_api.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'package:ambito/main.dart'; import 'package:ambito/src/entity/area/area_repository.dart'; import 'package:ambito/src/entity/entities.dart'; +import 'package:ambito/src/entity/login/login_repository.dart'; import 'package:ambito/src/entity/measure/details/measure_details.dart'; import 'package:ambito/src/entity/measure/details/measure_details_repository.dart'; import 'package:ambito/src/entity/measure/general/measure_general_repository.dart'; @@ -12,9 +13,11 @@ import 'package:ambito/src/packages/ambito_api/restclient.dart'; import 'package:get/get.dart'; import '../../config/config.dart'; +import '../../consts/consts.dart'; import '../../entity/area/area.dart'; import '../../entity/business/business_repository.dart'; import '../../entity/funding_program/funding_program_repository.dart'; +import '../../entity/login/login.dart'; import '../../entity/measure/measure_repository.dart'; class BaseApi { @@ -30,6 +33,7 @@ class BaseApi { 'area': AreaRepository().put, 'business': BusinessRepository().put, 'funding_program': FundingProgramRepository().put, + 'login': LoginRepository().put, 'measure_types': MeasureRepository().put, 'measure_general': MeasureGeneralRepository().put, 'measure_details': MeasureDetailsRepository().put, @@ -37,15 +41,31 @@ class BaseApi { }; } - Future patchContent(String table, int id, dynamic body) async { + Future patchContent(String table, int id, dynamic body, + [bool autosave = true]) async { init(); int tableId = tables[table] ?? 0; if (tableId <= 0) return false; + logger.d(body); + var response = await RestClient().patch('$tableId/$id/', body); - if (response.statusCode != 200) Get.toNamed('/error'); - return true; + if (response.statusCode != 200) { + logger.e(response.headers); + logger.e(response.body); + Get.toNamed('/error'); + } + + if (autosave == true) { + final repositoryMap = _getMap(); + var model = _createModelFromJson(table, jsonDecode(response.body)); + var repositoryFunction = repositoryMap[table]; + if (repositoryFunction == null) return false; + repositoryFunction(model); + } + + return response.body; } Future deleteContent(String table, int id) async { @@ -99,6 +119,7 @@ class BaseApi { 'area': AreaRepository().put, 'business': BusinessRepository().put, 'funding_program': FundingProgramRepository().put, + 'login': LoginRepository().put, 'measure_types': MeasureRepository().put, 'measure_general': MeasureGeneralRepository().put, 'measure_details': MeasureDetailsRepository().put, @@ -136,6 +157,8 @@ class BaseApi { return MeasureTypesDetails.fromJson(json); case 'funding_program': return FundingProgram.fromJson(json); + case 'login': + return Login.fromJson(json); default: return null; } diff --git a/lib/src/packages/ambito_api/restclient.dart b/lib/src/packages/ambito_api/restclient.dart index 3f4ec1f..2ae96fa 100644 --- a/lib/src/packages/ambito_api/restclient.dart +++ b/lib/src/packages/ambito_api/restclient.dart @@ -127,7 +127,6 @@ class RestClient { final String uriString = '$baseUrl$endpoint'; final Uri uri = Uri.parse(uriString); final Map headers = _getHeaders(); - logger.d(jsonEncode(body)); return _performRequest( () { return _client.patch( diff --git a/lib/src/packages/ambito_db/base_db.dart b/lib/src/packages/ambito_db/base_db.dart index 7686fd9..584b731 100644 --- a/lib/src/packages/ambito_db/base_db.dart +++ b/lib/src/packages/ambito_db/base_db.dart @@ -4,6 +4,7 @@ import 'package:ambito/src/entity/entities.dart'; import 'package:ambito/src/entity/lists/list_measure.dart'; import 'package:ambito/src/entity/lists/list_measure_single.dart'; import 'package:ambito/src/entity/lists/list_measure_type_group_category.dart'; +import 'package:ambito/src/entity/login/login.dart'; import 'package:ambito/src/entity/measure/category/measure_category.dart'; import 'package:ambito/src/entity/measure/complete/measure_complete.dart'; import 'package:ambito/src/entity/measure/details/measure_details.dart'; @@ -41,6 +42,7 @@ class AmbitoIsarDB { ListMeasureSchema, ListMeasureSingleSchema, ListMeasureTypeGroupCategorySchema, + LoginSchema, MaterialSchema, MeasureMonthsSchema, MeasureCompleteSchema, diff --git a/lib/src/pages/calendar/calendar_page.dart b/lib/src/pages/calendar/calendar_page.dart index 285d0b8..2878f31 100644 --- a/lib/src/pages/calendar/calendar_page.dart +++ b/lib/src/pages/calendar/calendar_page.dart @@ -1,3 +1,5 @@ +import 'dart:convert'; + import 'package:ambito/src/entity/measure/months/measure_months.dart'; import 'package:ambito/src/entity/measure/months/measure_months_datasource.dart'; import 'package:ambito/src/packages/ambito_theme/ambito_theme.dart'; @@ -6,9 +8,13 @@ import 'package:isar/isar.dart'; import 'package:screen_breakpoints/screen_breakpoints.dart'; import 'package:syncfusion_flutter_core/theme.dart'; import 'package:syncfusion_flutter_datagrid/datagrid.dart'; +import 'package:syncfusion_flutter_datagrid_export/export.dart'; +import 'package:syncfusion_flutter_pdf/pdf.dart'; import 'package:toggle_switch/toggle_switch.dart'; +import 'package:url_launcher/url_launcher.dart'; import '../../consts/consts.dart'; +import '../../widgets/buttons/print_button.dart'; import '../../widgets/page/base_page.dart'; class CalendarPage extends StatefulWidget { @@ -34,6 +40,8 @@ class CalendarPageState extends State { final AmbitoTheme theme = getTheme(context); + final GlobalKey key = GlobalKey(); + return BasePage().getPage( context, SingleChildScrollView( @@ -88,12 +96,47 @@ class CalendarPageState extends State { }); }, ), + Spacer(), + PrintButton( + onPressed: () async { + PdfDocument document = + key.currentState!.exportToPdfDocument( + headerFooterExport: + (DataGridPdfHeaderFooterExportDetails + headerFooterExport) { + final double width = headerFooterExport + .pdfPage + .getClientSize() + .width; + final PdfPageTemplateElement header = + PdfPageTemplateElement( + Rect.fromLTWH(0, 0, width, 65)); + header.graphics.drawString( + 'Dingens"', + PdfStandardFont( + PdfFontFamily.helvetica, 13, + style: PdfFontStyle.bold), + bounds: + const Rect.fromLTWH(0, 25, 400, 60), + ); + headerFooterExport.pdfDocumentTemplate.top = + header; + }, + cellExport: (details) {}, + fitAllColumnsInOnePage: true, + ); + final List bytes = document.saveSync(); + launchUrl(Uri.parse( + "data:application/octet-stream;base64,${base64Encode(bytes)}")); + }, + ), ], ), theme.verticalSpacer, Expanded( child: gridWidget( mm, + key, ), ), theme.verticalSpacerMax, @@ -107,7 +150,7 @@ class CalendarPageState extends State { )); } - Widget gridWidget(List mm) { + Widget gridWidget(List mm, GlobalKey key) { final AmbitoTheme theme = getTheme(context); return SizedBox( @@ -121,13 +164,15 @@ class CalendarPageState extends State { ), ), child: SfDataGrid( - allowSorting: true, + isScrollbarAlwaysShown: true, + key: key, + allowSorting: false, source: MeasureMonthsDatasource(areas: mm, context: context, type: type), columnWidthMode: ColumnWidthMode.fill, columns: [ GridColumn( - columnName: 'name', + columnName: 'Bezeichnung', label: Container( padding: const EdgeInsets.symmetric(horizontal: 10.0), alignment: Alignment.centerLeft, @@ -141,7 +186,7 @@ class CalendarPageState extends State { ), ), GridColumn( - columnName: 'jan', + columnName: 'Jan', maximumWidth: 70, label: Container( padding: const EdgeInsets.symmetric(horizontal: 10.0), @@ -156,7 +201,7 @@ class CalendarPageState extends State { ), ), GridColumn( - columnName: 'feb', + columnName: 'Feb', maximumWidth: 70, label: Container( padding: const EdgeInsets.symmetric(horizontal: 10.0), @@ -171,7 +216,7 @@ class CalendarPageState extends State { ), ), GridColumn( - columnName: 'mar', + columnName: 'Mär', maximumWidth: 70, label: Container( padding: const EdgeInsets.symmetric(horizontal: 10.0), @@ -186,7 +231,7 @@ class CalendarPageState extends State { ), ), GridColumn( - columnName: 'apr', + columnName: 'Apr', maximumWidth: 70, label: Container( padding: const EdgeInsets.symmetric(horizontal: 10.0), @@ -201,7 +246,7 @@ class CalendarPageState extends State { ), ), GridColumn( - columnName: 'may', + columnName: 'Mai', maximumWidth: 70, label: Container( padding: const EdgeInsets.symmetric(horizontal: 10.0), @@ -216,7 +261,7 @@ class CalendarPageState extends State { ), ), GridColumn( - columnName: 'jun', + columnName: 'Jun', maximumWidth: 70, label: Container( padding: const EdgeInsets.symmetric(horizontal: 10.0), @@ -231,7 +276,7 @@ class CalendarPageState extends State { ), ), GridColumn( - columnName: 'jul', + columnName: 'Jul', maximumWidth: 70, label: Container( padding: const EdgeInsets.symmetric(horizontal: 10.0), @@ -246,7 +291,7 @@ class CalendarPageState extends State { ), ), GridColumn( - columnName: 'aug', + columnName: 'Aug', maximumWidth: 70, label: Container( padding: const EdgeInsets.symmetric(horizontal: 10.0), @@ -261,7 +306,7 @@ class CalendarPageState extends State { ), ), GridColumn( - columnName: 'sep', + columnName: 'Sep', maximumWidth: 70, label: Container( padding: const EdgeInsets.symmetric(horizontal: 10.0), @@ -276,7 +321,7 @@ class CalendarPageState extends State { ), ), GridColumn( - columnName: 'oct', + columnName: 'Okt', maximumWidth: 70, label: Container( padding: const EdgeInsets.symmetric(horizontal: 10.0), @@ -291,7 +336,7 @@ class CalendarPageState extends State { ), ), GridColumn( - columnName: 'nov', + columnName: 'Nov', maximumWidth: 70, label: Container( padding: const EdgeInsets.symmetric(horizontal: 10.0), @@ -306,7 +351,7 @@ class CalendarPageState extends State { ), ), GridColumn( - columnName: 'dec', + columnName: 'Dez', maximumWidth: 70, label: Container( padding: const EdgeInsets.symmetric(horizontal: 10.0), diff --git a/lib/src/pages/dashboard/areas/dashboard_areas_page.dart b/lib/src/pages/dashboard/areas/dashboard_areas_page.dart index 7fa7520..dff4001 100644 --- a/lib/src/pages/dashboard/areas/dashboard_areas_page.dart +++ b/lib/src/pages/dashboard/areas/dashboard_areas_page.dart @@ -114,6 +114,7 @@ class DashboardAreasPageState extends State { padding: context.breakpoint.padding, child: SizedBox( width: 1152, + height: MediaQuery.of(context).size.height - 80, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -541,6 +542,7 @@ class DashboardAreasPageState extends State { return SizedBox( width: 1152, + height: MediaQuery.of(context).size.height - 80, child: SfDataGridTheme( data: SfDataGridThemeData( headerColor: theme.currentColorScheme.primaryContainer, diff --git a/lib/src/pages/dashboard/layouts/normal_layout_dashboard_page.dart b/lib/src/pages/dashboard/layouts/normal_layout_dashboard_page.dart index b90febc..e70a49b 100644 --- a/lib/src/pages/dashboard/layouts/normal_layout_dashboard_page.dart +++ b/lib/src/pages/dashboard/layouts/normal_layout_dashboard_page.dart @@ -13,6 +13,7 @@ extension NormalLayoutDashboardPage on DashboardPageState { const Spacer(), SizedBox( width: 532, + height: 532, child: mapWidget, ), ], diff --git a/lib/src/pages/dashboard/master_data/master_data_page.dart b/lib/src/pages/dashboard/master_data/master_data_page.dart new file mode 100644 index 0000000..cf8afbb --- /dev/null +++ b/lib/src/pages/dashboard/master_data/master_data_page.dart @@ -0,0 +1,613 @@ +import 'package:ambito/src/entity/_general/id_value/id_value.dart'; +import 'package:ambito/src/packages/ambito_api/base_api.dart'; +import 'package:ambito/src/widgets/buttons/edit_button.dart'; +import 'package:ambito/src/widgets/buttons/outline_button.dart'; +import 'package:ambito/src/widgets/buttons/save_buttons_group_with_cancel_action.dart'; +import 'package:ambito/src/widgets/buttons/upload_image_button.dart'; +import 'package:ambito/src/widgets/form/form_builder_fields/fbf_dropdown.dart'; +import 'package:ambito/src/widgets/form/form_builder_fields/fbf_text.dart'; +import 'package:ambito/src/widgets/form/form_builder_fields/fbf_textfield.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_form_builder/flutter_form_builder.dart'; +import 'package:get/get.dart'; +import 'package:isar/isar.dart'; +import 'package:screen_breakpoints/screen_breakpoints.dart'; +import 'package:toggle_switch/toggle_switch.dart'; + +import '../../../consts/consts.dart'; +import '../../../entity/business/business.dart'; +import '../../../entity/login/login.dart'; +import '../../../packages/ambito_theme/ambito_theme.dart'; +import '../../../widgets/form/form_builder_fields/fbf_password.dart'; +import '../../../widgets/page/base_page.dart'; + +class MasterDataPage extends StatefulWidget { + const MasterDataPage( + {super.key, required this.businessId, required this.userId}); + + final int businessId; + final int userId; + + @override + State createState() => MasterDataPageState(); +} + +class MasterDataPageState extends State { + Login? login; + Business? business; + bool editMode = false; + + final formKeyPersonal = GlobalKey(); + final formKeyBusiness = GlobalKey(); + + int display = 0; + + @override + void initState() { + login = isar.logins.where().idEqualTo(widget.userId).findFirst(); + + if (login != null) { + int businessId = login!.business!.first.id!; + business = isar.business.where().idEqualTo(businessId).findFirst(); + } + + super.initState(); + } + + @override + Widget build(BuildContext context) { + final AmbitoTheme theme = getTheme(context); + + return BasePage().getPage( + context, + SingleChildScrollView( + child: Align( + alignment: Alignment.topCenter, + child: Padding( + padding: context.breakpoint.padding, + child: SizedBox( + width: 1152, + height: MediaQuery.of(context).size.height - 80, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + theme.verticalSpacer, + Text( + 'Stammdaten', + style: theme.titleMedium, + ), + theme.verticalSpacer, + Row( + children: [ + ToggleSwitch( + initialLabelIndex: display, + totalSwitches: 2, + minWidth: 200, + borderWidth: 1, + labels: const ['Persönliches', 'Betriebsstätte'], + activeBgColor: [theme.currentColorScheme.secondary], + borderColor: [theme.currentColorScheme.secondary], + inactiveBgColor: Colors.white, + activeFgColor: theme.currentColorScheme.onSecondary, + customTextStyles: [theme.bodyMedium], + onToggle: (index) { + setState(() { + display = index ?? 0; + }); + }, + ), + const Spacer(), + (editMode == false) + ? EditButton(onPressed: () { + setState(() { + editMode = true; + }); + }) + : SaveButtonsGroupWithCancelAction( + onPressedCancel: () { + setState(() { + editMode = false; + }); + }, + onPressedSave: () async { + await prefs.setBool('extended_json', false); + if (display == 0) { + Login changedlogin = Login() + ..id = widget.userId + ..username = login!.username + ..images = [] + ..salutation = formKeyPersonal.currentState! + .fields['salutation']!.value ?? + '' + ..salutation = formKeyPersonal.currentState! + .fields['salutation']!.value ?? + '' + ..title = formKeyPersonal.currentState! + .fields['title']!.value ?? + '' + ..firstName = formKeyPersonal.currentState! + .fields['firstName']!.value ?? + '' + ..lastName = formKeyPersonal.currentState! + .fields['lastName']!.value ?? + '' + ..email = formKeyPersonal.currentState! + .fields['email']!.value ?? + '' + ..phone = formKeyPersonal.currentState! + .fields['phone']!.value ?? + '' + ..password = formKeyPersonal.currentState! + .fields['password']!.value ?? + '' + ..business = [ + IdValue() + ..id = business!.id + ..value = business!.name + ]; + + final ret = await BaseApi().patchContent( + 'login', + login!.id, + changedlogin.toJson(), + true, + ); + } + setState(() { + editMode = false; + }); + await prefs.setBool('extended_json', true); + Get.to(() => MasterDataPage( + businessId: business!.id, + userId: widget.userId)); + }, + ), + ], + ), + theme.verticalSpacer, + (display == 0) + ? personalWidget(context, theme, login!, formKeyPersonal) + : businessWidget( + context, theme, business!, formKeyBusiness), + theme.verticalSpacer, + ], + ), + ), + ), + ), + ), + ); + } + + Widget personalWidget(BuildContext context, AmbitoTheme theme, Login login, + GlobalKey formKey) { + return SizedBox( + width: 1152, + child: Card( + elevation: 0, + color: theme.currentColorScheme.tertiary, + child: Padding( + padding: EdgeInsets.all(20), + child: (editMode == false) + ? personalDisplay(context, theme, login) + : personalEdit(context, theme, login, formKey), + ), + ), + ); + } + + Widget personalDisplay(BuildContext context, AmbitoTheme theme, Login login) { + return Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Persönliches', + style: theme.headlineSmall, + ), + theme.verticalSpacer, + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(10)), + child: login.getImage() != null + ? login.getImage()! + : Icon( + Icons.camera_alt_outlined, + size: 100, + ), + ), + theme.verticalSpacerSmall, + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 20, + children: [ + Row( + children: [ + Text( + login.salutation ?? '', + style: theme.bodyMedium, + ), + theme.horizontalSpacerSmall, + Text( + login.title ?? '', + style: theme.bodyMedium, + ), + ], + ), + Row( + children: [ + Text( + login.firstName ?? '', + style: theme.bodyMedium, + ), + theme.horizontalSpacerSmall, + Text( + login.lastName ?? '', + style: theme.bodyMedium, + ), + ], + ), + Row( + children: [ + Icon(Icons.email_outlined), + theme.horizontalSpacerSmall, + Text( + login.email ?? '', + style: theme.bodyMedium, + ), + ], + ), + Row( + children: [ + Icon(Icons.phone_outlined), + theme.horizontalSpacerSmall, + Text( + login.phone ?? '', + style: theme.bodyMedium, + ), + ], + ), + ], + ), + ], + ); + } + + Widget personalEdit(BuildContext context, AmbitoTheme theme, Login login, + GlobalKey formKey) { + List salutationOptions = ['Herr', 'Frau', 'Ohne Anrede']; + + return FormBuilder( + key: formKey, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Persönliches', + style: theme.headlineSmall, + ), + theme.verticalSpacer, + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(10)), + child: login.getImage() != null + ? login.getImage()! + : Icon( + Icons.camera_alt_outlined, + size: 100, + ), + ), + theme.horizontalSpacer, + UploadImageButton( + onPressed: () {}, + ), + ], + ), + theme.verticalSpacer, + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 20, + children: [ + FormBuilderFieldsDropDown.build( + theme, + 'salutation', + 'Anrede', + login.salutation, + salutationOptions, + ), + FormBuilderFieldsText.build( + theme, + 'firstName', + 'Vorname', + login.firstName, + ), + FormBuilderFieldsText.build( + theme, + 'email', + 'E-Mail', + login.email, + ), + FormBuilderFieldsPassword.build( + theme, + 'password', + 'Passwort', + login.password, + ), + ], + )), + theme.horizontalSpacer, + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 20, + children: [ + FormBuilderFieldsText.build( + theme, + 'title', + 'Titel', + login.title, + ), + FormBuilderFieldsText.build( + theme, + 'lastName', + 'Nachname', + login.lastName, + ), + FormBuilderFieldsText.build( + theme, + 'phone', + 'Telefon', + login.phone, + ), + WidgetOutlineButton( + onPressed: () {}, + title: 'Passwort ändern', + backgroundColor: theme.currentColorScheme.onPrimary, + foregroundColor: theme.currentColorScheme.secondary, + borderColor: theme.currentColorScheme.secondary, + ) + ], + ), + ), + ], + ) + ], + ), + ); + } + + Widget businessWidget(BuildContext context, AmbitoTheme theme, + Business business, GlobalKey formKey) { + return SizedBox( + width: 1152, + child: Card( + elevation: 0, + color: theme.currentColorScheme.tertiary, + child: Padding( + padding: EdgeInsets.all(20), + child: (editMode == false) + ? businessDisplay(context, theme, business) + : businessEdit(context, theme, business, formKey), + ), + ), + ); + } + + Widget businessDisplay( + BuildContext context, AmbitoTheme theme, Business business) { + return Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Betriebsstätte', + style: theme.headlineSmall, + ), + theme.verticalSpacer, + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 20, + children: [ + Row( + children: [ + Text( + business.name ?? '', + style: theme.bodyMedium, + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Icon(Icons.location_city_outlined), + theme.horizontalSpacerSmall, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 10, + children: [ + Text( + business.addressStreet ?? '', + style: theme.bodyMedium, + ), + Row( + spacing: 10, + children: [ + Text( + business.addressPostalCode ?? '', + style: theme.bodyMedium, + ), + Text( + business.addressCity ?? '', + style: theme.bodyMedium, + ), + ], + ), + Text( + business.addressRegion ?? '', + style: theme.bodyMedium, + ), + Text( + business.addressFederalState ?? '', + style: theme.bodyMedium, + ), + ], + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Icon(Icons.note_alt_outlined), + theme.horizontalSpacerSmall, + Expanded( + child: Text( + business.notice ?? '', + style: theme.bodyMedium, + ), + ), + ], + ), + ], + ), + ], + ); + } + + Widget businessEdit(BuildContext context, AmbitoTheme theme, + Business business, GlobalKey formKey) { + List regions = [ + 'Ahr', + 'Baden', + 'Franken', + 'Hessische Bergtraße', + 'Mittelrhein', + 'Mosel', + 'Nahe', + 'Pfalz', + 'Rheingau', + 'Rheinhessen', + 'Saale-Unstrut', + 'Sachsen', + 'Württemberg', + ]; + List bundeslaender = [ + 'Baden-Württemberg', + 'Bayern', + 'Berlin', + 'Brandenburg', + 'Bremen', + 'Hamburg', + 'Hessen', + 'Mecklenburg-Vorpommern', + 'Niedersachsen', + 'Nordrhein-Westfalen', + 'Rheinland-Pfalz', + 'Saarland', + 'Sachsen', + 'Sachsen-Anhalt', + 'Schleswig-Holstein', + 'Thüringen' + ]; + + return FormBuilder( + key: formKey, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Betriebsstätte', + style: theme.headlineSmall, + ), + theme.verticalSpacer, + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 20, + children: [ + FormBuilderFieldsText.build( + theme, + 'name', + 'Bezeichnung', + business.name, + ), + FormBuilderFieldsText.build( + theme, + 'postalCode', + 'PLZ', + business.addressPostalCode, + ), + FormBuilderFieldsDropDown.build( + theme, + 'federalState', + 'Bundesland', + business.addressFederalState, + bundeslaender, + ), + ], + )), + theme.horizontalSpacer, + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 20, + children: [ + FormBuilderFieldsText.build( + theme, + 'addressStreet', + 'Adresse', + business.addressStreet, + ), + FormBuilderFieldsText.build( + theme, + 'addressCity', + 'Stadt', + business.addressCity, + ), + FormBuilderFieldsDropDown.build( + theme, + 'region', + 'Region', + business.addressRegion, + regions, + ), + ], + ), + ), + ], + ), + theme.verticalSpacer, + FormBuilderFieldsTextField.build( + theme, + 'notice', + 'Notiz', + business.notice, + ), + ], + ), + ); + } +} diff --git a/lib/src/widgets/buttons/cancel_button_with_action.dart b/lib/src/widgets/buttons/cancel_button_with_action.dart new file mode 100644 index 0000000..3d397e0 --- /dev/null +++ b/lib/src/widgets/buttons/cancel_button_with_action.dart @@ -0,0 +1,23 @@ +import 'package:ambito/src/extensions/extensions.dart'; +import 'package:flutter/material.dart'; + +import '../../packages/ambito_theme/ambito_theme.dart'; +import 'outline_button.dart'; + +class CancelButtonWithAction extends StatelessWidget { + final VoidCallback onPressed; + + const CancelButtonWithAction({super.key, required this.onPressed}); + + @override + Widget build(BuildContext context) { + final AmbitoTheme theme = getTheme(context); + return WidgetOutlineButton( + onPressed: onPressed, + title: context.translate('page.general.buttons.cancel'), + backgroundColor: theme.currentColorScheme.onPrimary, + foregroundColor: theme.currentColorScheme.secondary, + borderColor: theme.currentColorScheme.secondary, + ); + } +} diff --git a/lib/src/widgets/buttons/edit_button.dart b/lib/src/widgets/buttons/edit_button.dart new file mode 100644 index 0000000..590d3c9 --- /dev/null +++ b/lib/src/widgets/buttons/edit_button.dart @@ -0,0 +1,23 @@ +import 'package:ambito/src/extensions/extensions.dart'; +import 'package:flutter/material.dart'; + +import '../../packages/ambito_theme/ambito_theme.dart'; +import 'outline_button.dart'; + +class EditButton extends StatelessWidget { + final VoidCallback onPressed; + + const EditButton({super.key, required this.onPressed}); + + @override + Widget build(BuildContext context) { + final AmbitoTheme theme = getTheme(context); + return WidgetOutlineButton( + onPressed: onPressed, + title: context.translate('page.general.buttons.edit'), + backgroundColor: theme.currentColorScheme.secondary, + foregroundColor: theme.currentColorScheme.onPrimary, + borderColor: theme.currentColorScheme.secondary, + ); + } +} diff --git a/lib/src/widgets/buttons/save_buttons_group_with_cancel_action.dart b/lib/src/widgets/buttons/save_buttons_group_with_cancel_action.dart new file mode 100644 index 0000000..93dbf61 --- /dev/null +++ b/lib/src/widgets/buttons/save_buttons_group_with_cancel_action.dart @@ -0,0 +1,30 @@ +import 'package:ambito/src/widgets/buttons/cancel_button_with_action.dart'; +import 'package:ambito/src/widgets/buttons/save_button.dart'; +import 'package:flutter/material.dart'; + +import '../../packages/ambito_theme/ambito_theme.dart'; + +class SaveButtonsGroupWithCancelAction extends StatelessWidget { + final VoidCallback onPressedCancel; + final VoidCallback onPressedSave; + + const SaveButtonsGroupWithCancelAction( + {super.key, required this.onPressedCancel, required this.onPressedSave}); + + @override + Widget build(BuildContext context) { + final AmbitoTheme theme = getTheme(context); + + return Align( + alignment: Alignment.centerRight, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + CancelButtonWithAction(onPressed: onPressedCancel), + theme.horizontalSpacer, + SaveButton(onPressed: onPressedSave), + ], + ), + ); + } +} diff --git a/lib/src/widgets/buttons/upload_image_button.dart b/lib/src/widgets/buttons/upload_image_button.dart new file mode 100644 index 0000000..8dd43c8 --- /dev/null +++ b/lib/src/widgets/buttons/upload_image_button.dart @@ -0,0 +1,23 @@ +import 'package:ambito/src/extensions/extensions.dart'; +import 'package:flutter/material.dart'; + +import '../../packages/ambito_theme/ambito_theme.dart'; +import 'outline_button.dart'; + +class UploadImageButton extends StatelessWidget { + final VoidCallback onPressed; + + const UploadImageButton({super.key, required this.onPressed}); + + @override + Widget build(BuildContext context) { + final AmbitoTheme theme = getTheme(context); + return WidgetOutlineButton( + onPressed: onPressed, + title: context.translate('page.general.buttons.upload_image'), + backgroundColor: theme.currentColorScheme.secondary, + foregroundColor: theme.currentColorScheme.onPrimary, + borderColor: theme.currentColorScheme.secondary, + ); + } +} diff --git a/lib/src/widgets/form/form_builder_fields/fbf_dropdown.dart b/lib/src/widgets/form/form_builder_fields/fbf_dropdown.dart new file mode 100644 index 0000000..272b66a --- /dev/null +++ b/lib/src/widgets/form/form_builder_fields/fbf_dropdown.dart @@ -0,0 +1,37 @@ +import 'package:ambito/src/packages/ambito_theme/ambito_theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_form_builder/flutter_form_builder.dart'; + +class FormBuilderFieldsDropDown { + static Widget build( + AmbitoTheme theme, + String name, + String label, + String? initial, + List options, + ) { + return FormBuilderDropdown( + name: name, + isDense: true, + initialValue: initial, + decoration: InputDecoration( + fillColor: theme.currentColorScheme.onPrimary, + filled: true, + labelText: label, + hintText: label, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + items: options + .map( + (option) => DropdownMenuItem( + alignment: AlignmentDirectional.centerStart, + value: option, + child: Text(option), + ), + ) + .toList(), + ); + } +} diff --git a/lib/src/widgets/form/form_builder_fields/fbf_password.dart b/lib/src/widgets/form/form_builder_fields/fbf_password.dart new file mode 100644 index 0000000..b60fa61 --- /dev/null +++ b/lib/src/widgets/form/form_builder_fields/fbf_password.dart @@ -0,0 +1,27 @@ +import 'package:ambito/src/packages/ambito_theme/ambito_theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_form_builder/flutter_form_builder.dart'; + +class FormBuilderFieldsPassword { + static Widget build( + AmbitoTheme theme, + String name, + String label, + String? initial, + ) { + return FormBuilderTextField( + name: name, + obscureText: true, + initialValue: initial, + decoration: InputDecoration( + fillColor: theme.currentColorScheme.onPrimary, + labelText: label, + filled: true, + hintText: label, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + ); + } +} diff --git a/lib/src/widgets/form/form_builder_fields/fbf_text.dart b/lib/src/widgets/form/form_builder_fields/fbf_text.dart new file mode 100644 index 0000000..25fee4a --- /dev/null +++ b/lib/src/widgets/form/form_builder_fields/fbf_text.dart @@ -0,0 +1,26 @@ +import 'package:ambito/src/packages/ambito_theme/ambito_theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_form_builder/flutter_form_builder.dart'; + +class FormBuilderFieldsText { + static Widget build( + AmbitoTheme theme, + String name, + String label, + String? initial, + ) { + return FormBuilderTextField( + name: name, + initialValue: initial, + decoration: InputDecoration( + fillColor: theme.currentColorScheme.onPrimary, + labelText: label, + filled: true, + hintText: label, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + ); + } +} diff --git a/lib/src/widgets/form/form_builder_fields/fbf_textfield.dart b/lib/src/widgets/form/form_builder_fields/fbf_textfield.dart new file mode 100644 index 0000000..e05d11a --- /dev/null +++ b/lib/src/widgets/form/form_builder_fields/fbf_textfield.dart @@ -0,0 +1,28 @@ +import 'package:ambito/src/packages/ambito_theme/ambito_theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_form_builder/flutter_form_builder.dart'; + +class FormBuilderFieldsTextField { + static Widget build( + AmbitoTheme theme, + String name, + String label, + String? initial, + ) { + return FormBuilderTextField( + name: name, + maxLines: 5, + initialValue: initial, + decoration: InputDecoration( + fillColor: theme.currentColorScheme.onPrimary, + labelText: label, + filled: true, + isDense: true, + hintText: label, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + ); + } +} diff --git a/lib/src/widgets/map/map_widget.dart b/lib/src/widgets/map/map_widget.dart index be59c74..45a6a9f 100644 --- a/lib/src/widgets/map/map_widget.dart +++ b/lib/src/widgets/map/map_widget.dart @@ -52,23 +52,6 @@ class MapWidgetState extends State { width: double.infinity, child: Column( children: [ - Row( - children: [ - const Spacer(), - IconButton( - onPressed: () { - setState(() { - _drawPolygon = !_drawPolygon; - }); - }, - icon: Icon( - Icons.polyline_outlined, - color: (_drawPolygon - ? theme.currentColorScheme.primary - : theme.currentColorScheme.outline), - )) - ], - ), Expanded( child: GoogleMap( onTap: (position) { @@ -114,6 +97,23 @@ class MapWidgetState extends State { }, ), ), + Row( + children: [ + const Spacer(), + IconButton( + onPressed: () { + setState(() { + _drawPolygon = !_drawPolygon; + }); + }, + icon: Icon( + Icons.polyline_outlined, + color: (_drawPolygon + ? theme.currentColorScheme.primary + : theme.currentColorScheme.outline), + )) + ], + ), ], )), ); diff --git a/pubspec.lock b/pubspec.lock index ba519af..fc5a6bb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1376,7 +1376,7 @@ packages: source: hosted version: "28.1.33" syncfusion_flutter_pdf: - dependency: transitive + dependency: "direct main" description: name: syncfusion_flutter_pdf sha256: bdd6b6c085fc39fbcfbf641efbf7f97d9c39b58e57accc47fca4f9db592b2294 diff --git a/pubspec.yaml b/pubspec.yaml index acaeb50..3170322 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -72,6 +72,7 @@ dependencies: syncfusion_flutter_datagrid_export: ^28.1.33 url_launcher_web: ^2.3.3 url_launcher: ^6.3.1 + syncfusion_flutter_pdf: ^28.1.33