import 'package:flutter/cupertino.dart'; import 'package:get_it/get_it.dart'; import 'package:hiddingsel_app/appflow/model/images.dart'; import 'package:hiddingsel_app/appflow/model/persons.dart'; import '../../constants/constant.dart'; import 'contacts.dart'; import 'interfaces.dart'; import 'package:hiddingsel_app/appflow/model/topics.dart'; class CompanyModel extends PushNotificationTopicModel with Contact, Person { final ImageModel image; final PersonModel person; final ContactModel contact; final String? products; final String? connectionToHiddingsel; InlineSpan get text => TextSpan(text: 'Produkte/Dienstleistungen:\n', style: UITheme.theme.textTheme.headlineSmall, children: [ TextSpan(text: '$products\n', style: UITheme.theme.textTheme.bodyLarge), TextSpan(text: 'Was verbindet Euch mit Hiddingsel?\n', style: UITheme.theme.textTheme.headlineSmall), TextSpan(text: '$connectionToHiddingsel\n', style: UITheme.theme.textTheme.bodyLarge),],); const CompanyModel.withImageModel(id, name, this.image, this.person, this.contact, this.products, this.connectionToHiddingsel) : super(id, name); CompanyModel(id, name, String imageResource, this.person, this.contact, this.products, this.connectionToHiddingsel) : this.image = ImageModel(imageResource), super(id, name); factory CompanyModel.fromJson(Map json) { return CompanyModel( json['id'] as String, json['name'] as String, json['image'] as String, PersonModel.fromJson(json['person'] as Map), ContactModel.fromJson(json['contact'] as Map), json['products'] as String?, json['connectionToHiddingsel'] as String?, ); } static final List values = GetIt.I>()..sort((a, b) => a.name.compareTo(b.name)); bool operator ==(Object other) => other is CompanyModel && runtimeType == other.runtimeType && id == other.id; int get hashCode => id.hashCode; }