Update fix after service generation + need test geoloc ! + need test for connexion with apikey also ! + check where http needed.. need to pass by service generation
This commit is contained in:
parent
538e677993
commit
e8ef78d0e2
@ -201,7 +201,7 @@ class _AudioPlayerFloatingContainerState extends State<AudioPlayerFloatingContai
|
|||||||
width: size.width,
|
width: size.width,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Color(int.parse(visitAppContext.configuration!.primaryColor!.split('(0x')[1].split(')')[0], radix: 16)).withValues(alpha: 0.7),
|
color: Color(int.parse(visitAppContext.configuration!.primaryColor!.split('(0x')[1].split(')')[0], radix: 16)).withValues(alpha: 0.7),
|
||||||
borderRadius: BorderRadius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 15.0),
|
borderRadius: BorderRadius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 15.0),
|
||||||
),
|
),
|
||||||
child: isplaying ? Column(
|
child: isplaying ? Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
|||||||
@ -31,8 +31,7 @@ class DatabaseHelper {
|
|||||||
static const columnData = 'data';
|
static const columnData = 'data';
|
||||||
static const columnType = 'type';
|
static const columnType = 'type';
|
||||||
static const columnDateCreation = 'dateCreation';
|
static const columnDateCreation = 'dateCreation';
|
||||||
static const columnIsMobile = 'isMobile';
|
// columnIsMobile/columnIsTablet removed: now in AppConfigurationLink
|
||||||
static const columnIsTablet = 'isTablet';
|
|
||||||
static const columnIsOffline = 'isOffline';
|
static const columnIsOffline = 'isOffline';
|
||||||
|
|
||||||
static const configurationsTable = 'configurations';
|
static const configurationsTable = 'configurations';
|
||||||
@ -65,6 +64,7 @@ class DatabaseHelper {
|
|||||||
|
|
||||||
static const columnIsAdmin = 'isAdmin';
|
static const columnIsAdmin = 'isAdmin';
|
||||||
static const columnIsAllLanguages = 'isAllLanguages';
|
static const columnIsAllLanguages = 'isAllLanguages';
|
||||||
|
static const columnApiKey = 'apiKey';
|
||||||
|
|
||||||
|
|
||||||
DatabaseHelper._privateConstructor();
|
DatabaseHelper._privateConstructor();
|
||||||
@ -158,7 +158,8 @@ class DatabaseHelper {
|
|||||||
$columnLanguage TEXT NOT NULL,
|
$columnLanguage TEXT NOT NULL,
|
||||||
$columnInstanceId TEXT NOT NULL,
|
$columnInstanceId TEXT NOT NULL,
|
||||||
$columnIsAdmin BOOLEAN NOT NULL CHECK ($columnIsAdmin IN (0,1)),
|
$columnIsAdmin BOOLEAN NOT NULL CHECK ($columnIsAdmin IN (0,1)),
|
||||||
$columnIsAllLanguages BOOLEAN CHECK ($columnIsAllLanguages IN (0,1))
|
$columnIsAllLanguages BOOLEAN CHECK ($columnIsAllLanguages IN (0,1)),
|
||||||
|
$columnApiKey TEXT
|
||||||
)
|
)
|
||||||
''');
|
''');
|
||||||
break;
|
break;
|
||||||
@ -175,8 +176,6 @@ class DatabaseHelper {
|
|||||||
$columnDateCreation TEXT NOT NULL,
|
$columnDateCreation TEXT NOT NULL,
|
||||||
$columnPrimaryColor TEXT,
|
$columnPrimaryColor TEXT,
|
||||||
$columnSecondaryColor TEXT,
|
$columnSecondaryColor TEXT,
|
||||||
$columnIsMobile BOOLEAN NOT NULL CHECK ($columnIsMobile IN (0,1)),
|
|
||||||
$columnIsTablet BOOLEAN NOT NULL CHECK ($columnIsTablet IN (0,1)),
|
|
||||||
$columnIsOffline BOOLEAN NOT NULL CHECK ($columnIsOffline IN (0,1))
|
$columnIsOffline BOOLEAN NOT NULL CHECK ($columnIsOffline IN (0,1))
|
||||||
)
|
)
|
||||||
''');
|
''');
|
||||||
@ -255,6 +254,9 @@ class DatabaseHelper {
|
|||||||
} else {
|
} else {
|
||||||
print("IN columnIsAllLanguages");
|
print("IN columnIsAllLanguages");
|
||||||
}
|
}
|
||||||
|
if(test.where((e) => e.toString().contains(columnApiKey)).isEmpty) {
|
||||||
|
await db.rawQuery("ALTER TABLE $nameOfTable ADD $columnApiKey TEXT");
|
||||||
|
}
|
||||||
DatabaseHelper.instance.insert(DatabaseTableType.main, visitAppContext.toMap());
|
DatabaseHelper.instance.insert(DatabaseTableType.main, visitAppContext.toMap());
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("ERROR IN updateTableMain");
|
print("ERROR IN updateTableMain");
|
||||||
@ -321,6 +323,7 @@ class DatabaseHelper {
|
|||||||
language: element["language"],
|
language: element["language"],
|
||||||
isAdmin: element["isAdmin"] == 1 ? true : false,
|
isAdmin: element["isAdmin"] == 1 ? true : false,
|
||||||
isAllLanguages: element["isAllLanguages"] == 1 ? true : false,
|
isAllLanguages: element["isAllLanguages"] == 1 ? true : false,
|
||||||
|
apiKey: element["apiKey"] as String?,
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case DatabaseTableType.configurations:
|
case DatabaseTableType.configurations:
|
||||||
@ -381,8 +384,6 @@ class DatabaseHelper {
|
|||||||
secondaryColor: element["secondaryColor"],
|
secondaryColor: element["secondaryColor"],
|
||||||
languages: List<String>.from(jsonDecode(element["languages"])),
|
languages: List<String>.from(jsonDecode(element["languages"])),
|
||||||
dateCreation: DateTime.tryParse(element["dateCreation"]),
|
dateCreation: DateTime.tryParse(element["dateCreation"]),
|
||||||
isMobile: element["isMobile"] == 1 ? true : false,
|
|
||||||
isTablet: element["isTablet"] == 1 ? true : false,
|
|
||||||
isOffline: element["isOffline"] == 1 ? true : false
|
isOffline: element["isOffline"] == 1 ? true : false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,8 +16,6 @@ class ModelsHelper {
|
|||||||
'secondaryColor': configuration.secondaryColor,
|
'secondaryColor': configuration.secondaryColor,
|
||||||
'languages': configuration.languages,
|
'languages': configuration.languages,
|
||||||
'dateCreation': configuration.dateCreation!.toUtc().toIso8601String(),
|
'dateCreation': configuration.dateCreation!.toUtc().toIso8601String(),
|
||||||
'isMobile': configuration.isMobile,
|
|
||||||
'isTablet': configuration.isTablet,
|
|
||||||
'isOffline': configuration.isOffline
|
'isOffline': configuration.isOffline
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,13 +5,15 @@ import 'package:mymuseum_visitapp/Services/statisticsService.dart';
|
|||||||
import 'package:mymuseum_visitapp/Models/beaconSection.dart';
|
import 'package:mymuseum_visitapp/Models/beaconSection.dart';
|
||||||
import 'package:mymuseum_visitapp/Models/resourceModel.dart';
|
import 'package:mymuseum_visitapp/Models/resourceModel.dart';
|
||||||
import 'package:mymuseum_visitapp/client.dart';
|
import 'package:mymuseum_visitapp/client.dart';
|
||||||
|
import 'package:mymuseum_visitapp/constants.dart';
|
||||||
|
|
||||||
class VisitAppContext with ChangeNotifier {
|
class VisitAppContext with ChangeNotifier {
|
||||||
Client clientAPI = Client("http://192.168.31.228:5000"); // Replace by https://api.mymuseum.be //http://192.168.31.140:8089 // https://api.myinfomate.be // http://192.168.31.228:5000
|
Client clientAPI = Client(kApiBaseUrl);
|
||||||
|
|
||||||
String? id = "";
|
String? id = "";
|
||||||
String? language = "";
|
String? language = "";
|
||||||
String? instanceId = "63514fd67ed8c735aaa4b8f2"; // 63514fd67ed8c735aaa4b8f2 MyInfoMate test instance -- Fort de Saint-Héribert Mymuseum instance id : 633ee379d9405f32f166f047 // 63514fd67ed8c735aaa4b8f1 Mymuseum test // MDLF instance 65ccc67265373befd15be511
|
String? instanceId = kInstanceId;
|
||||||
|
String? apiKey;
|
||||||
|
|
||||||
List<ConfigurationDTO>? configurations;
|
List<ConfigurationDTO>? configurations;
|
||||||
ConfigurationDTO? configuration;
|
ConfigurationDTO? configuration;
|
||||||
@ -31,12 +33,21 @@ class VisitAppContext with ChangeNotifier {
|
|||||||
ApplicationInstanceDTO? applicationInstanceDTO; // null = assistant non activé
|
ApplicationInstanceDTO? applicationInstanceDTO; // null = assistant non activé
|
||||||
StatisticsService? statisticsService;
|
StatisticsService? statisticsService;
|
||||||
|
|
||||||
|
/// Retourne l'AppConfigurationLink de l'instance mobile pour la configuration courante.
|
||||||
|
/// Contient roundedValue, isSectionImageBackground, etc.
|
||||||
|
AppConfigurationLink? get currentAppConfigurationLink {
|
||||||
|
if (applicationInstanceDTO == null || configuration == null) return null;
|
||||||
|
return applicationInstanceDTO!.configurations
|
||||||
|
?.where((c) => c.configurationId == configuration!.id)
|
||||||
|
.firstOrNull;
|
||||||
|
}
|
||||||
|
|
||||||
bool? isAdmin = false;
|
bool? isAdmin = false;
|
||||||
bool? isAllLanguages = false;
|
bool? isAllLanguages = false;
|
||||||
|
|
||||||
String? localPath;
|
String? localPath;
|
||||||
|
|
||||||
VisitAppContext({this.language, this.id, this.configuration, this.isAdmin, this.isAllLanguages, this.instanceId});
|
VisitAppContext({this.language, this.id, this.configuration, this.isAdmin, this.isAllLanguages, this.instanceId, this.apiKey});
|
||||||
|
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
@ -44,7 +55,8 @@ class VisitAppContext with ChangeNotifier {
|
|||||||
'instanceId': instanceId,
|
'instanceId': instanceId,
|
||||||
'language': language,
|
'language': language,
|
||||||
'isAdmin': isAdmin != null ? isAdmin! ? 1 : 0 : 0,
|
'isAdmin': isAdmin != null ? isAdmin! ? 1 : 0 : 0,
|
||||||
'isAllLanguages': isAllLanguages != null ? isAllLanguages! ? 1 : 0 : 0
|
'isAllLanguages': isAllLanguages != null ? isAllLanguages! ? 1 : 0 : 0,
|
||||||
|
'apiKey': apiKey,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,6 +66,7 @@ class VisitAppContext with ChangeNotifier {
|
|||||||
instanceId: json['instanceId'] as String,
|
instanceId: json['instanceId'] as String,
|
||||||
language: json['language'] as String,
|
language: json['language'] as String,
|
||||||
configuration: json['configuration'] == null ? null : ConfigurationDTO.fromJson(json['configuration']),
|
configuration: json['configuration'] == null ? null : ConfigurationDTO.fromJson(json['configuration']),
|
||||||
|
apiKey: json['apiKey'] as String?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -58,7 +58,12 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
|||||||
future: getConfigurationsCall(visitAppContext.clientAPI, appContext),
|
future: getConfigurationsCall(visitAppContext.clientAPI, appContext),
|
||||||
builder: (context, AsyncSnapshot<dynamic> snapshot) {
|
builder: (context, AsyncSnapshot<dynamic> snapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
configurations = List<ConfigurationDTO>.from(snapshot.data).where((configuration) => configuration.isMobile!).toList();
|
// Filtrer par les configurations liées à l'instance Mobile (appType == Mobile)
|
||||||
|
final mobileConfigIds = visitAppContext.applicationInstanceDTO
|
||||||
|
?.configurations?.map((c) => c.configurationId).toSet() ?? {};
|
||||||
|
configurations = List<ConfigurationDTO>.from(snapshot.data)
|
||||||
|
.where((c) => mobileConfigIds.isEmpty || mobileConfigIds.contains(c.id))
|
||||||
|
.toList();
|
||||||
return RefreshIndicator (
|
return RefreshIndicator (
|
||||||
onRefresh: () {
|
onRefresh: () {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
|||||||
@ -159,8 +159,10 @@ class _HomePage3State extends State<HomePage3> with WidgetsBindingObserver {
|
|||||||
future: _futureConfigurations,
|
future: _futureConfigurations,
|
||||||
builder: (context, AsyncSnapshot<dynamic> snapshot) {
|
builder: (context, AsyncSnapshot<dynamic> snapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
|
final mobileConfigIds = visitAppContext.applicationInstanceDTO
|
||||||
|
?.configurations?.map((c) => c.configurationId).toSet() ?? {};
|
||||||
configurations = List<ConfigurationDTO>.from(snapshot.data)
|
configurations = List<ConfigurationDTO>.from(snapshot.data)
|
||||||
.where((c) => c.isMobile!)
|
.where((c) => mobileConfigIds.isEmpty || mobileConfigIds.contains(c.id))
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
final layoutType = visitAppContext.applicationInstanceDTO?.layoutMainPage;
|
final layoutType = visitAppContext.applicationInstanceDTO?.layoutMainPage;
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class EventListItem extends StatelessWidget {
|
|||||||
return Container(
|
return Container(
|
||||||
margin: const EdgeInsets.all(10.0),
|
margin: const EdgeInsets.all(10.0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0),
|
borderRadius: BorderRadius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0),
|
||||||
//color: Colors.red,
|
//color: Colors.red,
|
||||||
boxShadow: const [
|
boxShadow: const [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
@ -53,7 +53,7 @@ class EventListItem extends StatelessWidget {
|
|||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
eventAgenda.image != null ? ClipRRect(
|
eventAgenda.image != null ? ClipRRect(
|
||||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0), topRight: Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)),
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0), topRight: Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0)),
|
||||||
child: Container(
|
child: Container(
|
||||||
//color: Colors.green,
|
//color: Colors.green,
|
||||||
//constraints: const BoxConstraints(maxHeight: 175),
|
//constraints: const BoxConstraints(maxHeight: 175),
|
||||||
@ -82,7 +82,7 @@ class EventListItem extends StatelessWidget {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
topLeft: Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0),
|
topLeft: Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
@ -127,7 +127,7 @@ class EventListItem extends StatelessWidget {
|
|||||||
width: size.width,
|
width: size.width,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0), bottomRight: Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)),
|
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0), bottomRight: Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0)),
|
||||||
border: Border(top: BorderSide(width: 0.1, color: kMainGrey))
|
border: Border(top: BorderSide(width: 0.1, color: kMainGrey))
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
|||||||
@ -130,11 +130,11 @@ class _EventPopupState extends State<EventPopup> {
|
|||||||
return Dialog(
|
return Dialog(
|
||||||
insetPadding: const EdgeInsets.all(4.0),
|
insetPadding: const EdgeInsets.all(4.0),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0))
|
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0))
|
||||||
),
|
),
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)),
|
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0)),
|
||||||
color: kBackgroundColor,
|
color: kBackgroundColor,
|
||||||
),
|
),
|
||||||
height: size.height * 0.92,
|
height: size.height * 0.92,
|
||||||
@ -142,7 +142,7 @@ class _EventPopupState extends State<EventPopup> {
|
|||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
ClipRRect(
|
ClipRRect(
|
||||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0), topRight: Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)),
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0), topRight: Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0)),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
@ -234,7 +234,7 @@ class _EventPopupState extends State<EventPopup> {
|
|||||||
width: size.width,
|
width: size.width,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: kBackgroundLight,
|
color: kBackgroundLight,
|
||||||
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0))
|
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0))
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(left: 20, right: 10, bottom: 10, top: 15),
|
padding: const EdgeInsets.only(left: 20, right: 10, bottom: 10, top: 15),
|
||||||
@ -286,7 +286,7 @@ class _EventPopupState extends State<EventPopup> {
|
|||||||
height: size.height * 0.2,
|
height: size.height * 0.2,
|
||||||
child: widget.mapProvider == MapProvider.Google ?
|
child: widget.mapProvider == MapProvider.Google ?
|
||||||
ClipRRect(
|
ClipRRect(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)),
|
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0)),
|
||||||
child: GoogleMap(
|
child: GoogleMap(
|
||||||
mapToolbarEnabled: false,
|
mapToolbarEnabled: false,
|
||||||
initialCameraPosition: CameraPosition(
|
initialCameraPosition: CameraPosition(
|
||||||
@ -300,7 +300,7 @@ class _EventPopupState extends State<EventPopup> {
|
|||||||
),
|
),
|
||||||
) :
|
) :
|
||||||
ClipRRect(
|
ClipRRect(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)),
|
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0)),
|
||||||
child: mapBox.MapWidget(
|
child: mapBox.MapWidget(
|
||||||
key: ValueKey("mapBoxWidget"),
|
key: ValueKey("mapBoxWidget"),
|
||||||
styleUri: mapBox.MapboxStyles.STANDARD,
|
styleUri: mapBox.MapboxStyles.STANDARD,
|
||||||
|
|||||||
@ -74,7 +74,7 @@ class _MonthFilterState extends State<MonthFilter> with SingleTickerProviderStat
|
|||||||
? Color(int.parse(visitAppContext.configuration!.primaryColor!.split('(0x')[1].split(')')[0], radix: 16))
|
? Color(int.parse(visitAppContext.configuration!.primaryColor!.split('(0x')[1].split(')')[0], radix: 16))
|
||||||
: kSecondColor;
|
: kSecondColor;
|
||||||
|
|
||||||
double rounded = visitAppContext.configuration?.roundedValue?.toDouble() ?? 20.0;
|
double rounded = visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0;
|
||||||
|
|
||||||
List<Map<String, dynamic>> sortedMonths = _getSortedMonths();
|
List<Map<String, dynamic>> sortedMonths = _getSortedMonths();
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import 'package:manager_api_new/api.dart';
|
|||||||
import 'package:mymuseum_visitapp/Components/loading_common.dart';
|
import 'package:mymuseum_visitapp/Components/loading_common.dart';
|
||||||
import 'package:mymuseum_visitapp/Helpers/translationHelper.dart';
|
import 'package:mymuseum_visitapp/Helpers/translationHelper.dart';
|
||||||
import 'package:mymuseum_visitapp/Models/visitContext.dart';
|
import 'package:mymuseum_visitapp/Models/visitContext.dart';
|
||||||
import 'package:mymuseum_visitapp/Screens/Sections/Puzzle/message_dialog.dart';
|
import 'package:mymuseum_visitapp/Screens/Sections/Game/message_dialog.dart';
|
||||||
import 'package:mymuseum_visitapp/app_context.dart';
|
import 'package:mymuseum_visitapp/app_context.dart';
|
||||||
import 'package:mymuseum_visitapp/constants.dart';
|
import 'package:mymuseum_visitapp/constants.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
@ -17,20 +17,20 @@ import 'puzzle_piece.dart';
|
|||||||
|
|
||||||
const IMAGE_PATH = 'image_path';
|
const IMAGE_PATH = 'image_path';
|
||||||
|
|
||||||
class PuzzlePage extends StatefulWidget {
|
class GamePage extends StatefulWidget {
|
||||||
final PuzzleDTO section;
|
final GameDTO section;
|
||||||
PuzzlePage({required this.section});
|
GamePage({required this.section});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_PuzzlePage createState() => _PuzzlePage();
|
_GamePage createState() => _GamePage();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _PuzzlePage extends State<PuzzlePage> {
|
class _GamePage extends State<GamePage> {
|
||||||
PuzzleDTO puzzleDTO = PuzzleDTO();
|
GameDTO gameDTO = GameDTO();
|
||||||
|
|
||||||
int allInPlaceCount = 0;
|
int allInPlaceCount = 0;
|
||||||
bool isFinished = false;
|
bool isFinished = false;
|
||||||
DateTime? _puzzleStartTime;
|
DateTime? _gameStartTime;
|
||||||
GlobalKey _widgetKey = GlobalKey();
|
GlobalKey _widgetKey = GlobalKey();
|
||||||
Size? realWidgetSize;
|
Size? realWidgetSize;
|
||||||
List<Widget> pieces = [];
|
List<Widget> pieces = [];
|
||||||
@ -40,28 +40,28 @@ class _PuzzlePage extends State<PuzzlePage> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
//puzzleDTO = PuzzleDTO.fromJson(jsonDecode(widget.section!.data!))!;
|
//puzzleDTO = PuzzleDTO.fromJson(jsonDecode(widget.section!.data!))!;
|
||||||
puzzleDTO = widget.section;
|
gameDTO = widget.section;
|
||||||
puzzleDTO.rows = puzzleDTO.rows ?? 3;
|
gameDTO.rows = gameDTO.rows ?? 3;
|
||||||
puzzleDTO.cols = puzzleDTO.cols ?? 3;
|
gameDTO.cols = gameDTO.cols ?? 3;
|
||||||
_puzzleStartTime = DateTime.now();
|
_gameStartTime = DateTime.now();
|
||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||||
Size size = MediaQuery.of(context).size;
|
Size size = MediaQuery.of(context).size;
|
||||||
final appContext = Provider.of<AppContext>(context, listen: false);
|
final appContext = Provider.of<AppContext>(context, listen: false);
|
||||||
VisitAppContext visitAppContext = appContext.getContext();
|
VisitAppContext visitAppContext = appContext.getContext();
|
||||||
|
|
||||||
print(puzzleDTO.messageDebut);
|
print(gameDTO.messageDebut);
|
||||||
TranslationAndResourceDTO? messageDebut = puzzleDTO.messageDebut != null && puzzleDTO.messageDebut!.isNotEmpty ? puzzleDTO.messageDebut!.where((message) => message.language!.toUpperCase() == visitAppContext.language!.toUpperCase()).firstOrNull : null;
|
TranslationAndResourceDTO? messageDebut = gameDTO.messageDebut != null && gameDTO.messageDebut!.isNotEmpty ? gameDTO.messageDebut!.where((message) => message.language!.toUpperCase() == visitAppContext.language!.toUpperCase()).firstOrNull : null;
|
||||||
|
|
||||||
//await Future.delayed(const Duration(milliseconds: 50));
|
//await Future.delayed(const Duration(milliseconds: 50));
|
||||||
|
|
||||||
await WidgetsBinding.instance.endOfFrame;
|
await WidgetsBinding.instance.endOfFrame;
|
||||||
getRealWidgetSize();
|
getRealWidgetSize();
|
||||||
|
|
||||||
if(puzzleDTO.puzzleImage != null && puzzleDTO.puzzleImage!.url != null) {
|
if(gameDTO.puzzleImage != null && gameDTO.puzzleImage!.url != null) {
|
||||||
//splitImage(Image.network(puzzleDTO.image!.resourceUrl!));
|
//splitImage(Image.network(puzzleDTO.image!.resourceUrl!));
|
||||||
splitImage(CachedNetworkImage(
|
splitImage(CachedNetworkImage(
|
||||||
imageUrl: puzzleDTO.puzzleImage!.url!,
|
imageUrl: gameDTO.puzzleImage!.url!,
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
errorWidget: (context, url, error) => Icon(Icons.error),
|
errorWidget: (context, url, error) => Icon(Icons.error),
|
||||||
));
|
));
|
||||||
@ -152,8 +152,8 @@ class _PuzzlePage extends State<PuzzlePage> {
|
|||||||
//imageSize = realWidgetSize!;
|
//imageSize = realWidgetSize!;
|
||||||
Size imageSize = Size(realWidgetSize!.width * 1.25, realWidgetSize!.height * 1.25);
|
Size imageSize = Size(realWidgetSize!.width * 1.25, realWidgetSize!.height * 1.25);
|
||||||
|
|
||||||
for (int x = 0; x < puzzleDTO.rows!; x++) {
|
for (int x = 0; x < gameDTO.rows!; x++) {
|
||||||
for (int y = 0; y < puzzleDTO.cols!; y++) {
|
for (int y = 0; y < gameDTO.cols!; y++) {
|
||||||
setState(() {
|
setState(() {
|
||||||
pieces.add(
|
pieces.add(
|
||||||
PuzzlePiece(
|
PuzzlePiece(
|
||||||
@ -162,8 +162,8 @@ class _PuzzlePage extends State<PuzzlePage> {
|
|||||||
imageSize: imageSize,
|
imageSize: imageSize,
|
||||||
row: x,
|
row: x,
|
||||||
col: y,
|
col: y,
|
||||||
maxRow: puzzleDTO.rows!,
|
maxRow: gameDTO.rows!,
|
||||||
maxCol: puzzleDTO.cols!,
|
maxCol: gameDTO.cols!,
|
||||||
bringToTop: bringToTop,
|
bringToTop: bringToTop,
|
||||||
sendToBack: sendToBack,
|
sendToBack: sendToBack,
|
||||||
),
|
),
|
||||||
@ -190,7 +190,7 @@ class _PuzzlePage extends State<PuzzlePage> {
|
|||||||
void sendToBack(Widget widget) {
|
void sendToBack(Widget widget) {
|
||||||
setState(() {
|
setState(() {
|
||||||
allInPlaceCount++;
|
allInPlaceCount++;
|
||||||
isFinished = allInPlaceCount == puzzleDTO.rows! * puzzleDTO.cols!;
|
isFinished = allInPlaceCount == gameDTO.rows! * gameDTO.cols!;
|
||||||
pieces.remove(widget);
|
pieces.remove(widget);
|
||||||
pieces.insert(0, widget);
|
pieces.insert(0, widget);
|
||||||
|
|
||||||
@ -198,12 +198,12 @@ class _PuzzlePage extends State<PuzzlePage> {
|
|||||||
Size size = MediaQuery.of(context).size;
|
Size size = MediaQuery.of(context).size;
|
||||||
final appContext = Provider.of<AppContext>(context, listen: false);
|
final appContext = Provider.of<AppContext>(context, listen: false);
|
||||||
VisitAppContext visitAppContext = appContext.getContext();
|
VisitAppContext visitAppContext = appContext.getContext();
|
||||||
final duration = _puzzleStartTime != null ? DateTime.now().difference(_puzzleStartTime!).inSeconds : 0;
|
final duration = _gameStartTime != null ? DateTime.now().difference(_gameStartTime!).inSeconds : 0;
|
||||||
visitAppContext.statisticsService?.track(
|
visitAppContext.statisticsService?.track(
|
||||||
VisitEventType.gameComplete,
|
VisitEventType.gameComplete,
|
||||||
metadata: {'gameType': 'Puzzle', 'durationSeconds': duration},
|
metadata: {'gameType': 'Puzzle', 'durationSeconds': duration},
|
||||||
);
|
);
|
||||||
TranslationAndResourceDTO? messageFin = puzzleDTO.messageFin != null && puzzleDTO.messageFin!.isNotEmpty ? puzzleDTO.messageFin!.where((message) => message.language!.toUpperCase() == visitAppContext.language!.toUpperCase()).firstOrNull : null;
|
TranslationAndResourceDTO? messageFin = gameDTO.messageFin != null && gameDTO.messageFin!.isNotEmpty ? gameDTO.messageFin!.where((message) => message.language!.toUpperCase() == visitAppContext.language!.toUpperCase()).firstOrNull : null;
|
||||||
|
|
||||||
if(messageFin != null) {
|
if(messageFin != null) {
|
||||||
showMessage(messageFin, appContext, context, size);
|
showMessage(messageFin, appContext, context, size);
|
||||||
@ -336,7 +336,7 @@ class _PuzzlePage extends State<PuzzlePage> {
|
|||||||
key: _widgetKey,
|
key: _widgetKey,
|
||||||
padding: const EdgeInsets.all(0.0),
|
padding: const EdgeInsets.all(0.0),
|
||||||
child: isSplittingImage ? Center(child: LoadingCommon()) :
|
child: isSplittingImage ? Center(child: LoadingCommon()) :
|
||||||
puzzleDTO.puzzleImage == null || puzzleDTO.puzzleImage!.url == null || realWidgetSize == null
|
gameDTO.puzzleImage == null || gameDTO.puzzleImage!.url == null || realWidgetSize == null
|
||||||
? Center(child: Text("Aucune image à afficher", style: TextStyle(fontSize: kNoneInfoOrIncorrect)))
|
? Center(child: Text("Aucune image à afficher", style: TextStyle(fontSize: kNoneInfoOrIncorrect)))
|
||||||
: Center(
|
: Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
|||||||
@ -15,7 +15,7 @@ void showMessage(TranslationAndResourceDTO translationAndResourceDTO, AppContext
|
|||||||
showDialog(
|
showDialog(
|
||||||
builder: (BuildContext context) => AlertDialog(
|
builder: (BuildContext context) => AlertDialog(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0))
|
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0))
|
||||||
),
|
),
|
||||||
content: SingleChildScrollView(
|
content: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -31,7 +31,7 @@ void showMessage(TranslationAndResourceDTO translationAndResourceDTO, AppContext
|
|||||||
child: Center(
|
child: Center(
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 30),
|
borderRadius: BorderRadius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 30),
|
||||||
//border: Border.all(width: 3, color: Colors.black)
|
//border: Border.all(width: 3, color: Colors.black)
|
||||||
),
|
),
|
||||||
child: showElementForResource(ResourceDTO(id: translationAndResourceDTO.resourceId, type: translationAndResourceDTO.resource!.type, url: translationAndResourceDTO.resource!.url), appContext, true, false),
|
child: showElementForResource(ResourceDTO(id: translationAndResourceDTO.resourceId, type: translationAndResourceDTO.resource!.type, url: translationAndResourceDTO.resource!.url), appContext, true, false),
|
||||||
|
|||||||
@ -46,11 +46,16 @@ class _FlutterMapViewState extends State<FlutterMapView> {
|
|||||||
|
|
||||||
//var icon = point.categorie == null ? BitmapDescriptor.fromBytes(widget.icons.where((i) => i['id'] == null).first['icon']) : widget.icons.any((i) => i['id'] == point.categorieId) ? BitmapDescriptor.fromBytes(widget.icons.where((i) => i['id'] == point.categorieId).first['icon']) : BitmapDescriptor.fromBytes(widget.icons.where((i) => i['id'] == null).first['icon']); //widget.selectedMarkerIcon,;
|
//var icon = point.categorie == null ? BitmapDescriptor.fromBytes(widget.icons.where((i) => i['id'] == null).first['icon']) : widget.icons.any((i) => i['id'] == point.categorieId) ? BitmapDescriptor.fromBytes(widget.icons.where((i) => i['id'] == point.categorieId).first['icon']) : BitmapDescriptor.fromBytes(widget.icons.where((i) => i['id'] == null).first['icon']); //widget.selectedMarkerIcon,;
|
||||||
|
|
||||||
|
final coords = point.geometry?.type == 'Point' && point.geometry?.coordinates is List ? point.geometry!.coordinates as List : null;
|
||||||
|
if (coords == null || coords.length < 2) return;
|
||||||
|
final lat = (coords[1] as num).toDouble();
|
||||||
|
final lon = (coords[0] as num).toDouble();
|
||||||
|
|
||||||
markers.add(
|
markers.add(
|
||||||
Marker(
|
Marker(
|
||||||
width: 80.0,
|
width: 80.0,
|
||||||
height: 80.0,
|
height: 80.0,
|
||||||
point: LatLng(double.tryParse(point.latitude!)!, double.tryParse(point.longitude!)!),
|
point: LatLng(lat, lon),
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
/*final mapContext = Provider.of<MapContext>(context, listen: false);
|
/*final mapContext = Provider.of<MapContext>(context, listen: false);
|
||||||
@ -121,8 +126,13 @@ class _FlutterMapViewState extends State<FlutterMapView> {
|
|||||||
builder: (context, mapContext, _) {
|
builder: (context, mapContext, _) {
|
||||||
var geoPoint = mapContext.getSelectedPointForNavigate() as GeoPointDTO?;
|
var geoPoint = mapContext.getSelectedPointForNavigate() as GeoPointDTO?;
|
||||||
if (geoPoint != null && mapController != null) {
|
if (geoPoint != null && mapController != null) {
|
||||||
|
final coords = geoPoint.geometry?.type == 'Point' && geoPoint.geometry?.coordinates is List ? geoPoint.geometry!.coordinates as List : null;
|
||||||
|
if (coords != null && coords.length >= 2) {
|
||||||
|
final lat = (coords[1] as num).toDouble();
|
||||||
|
final lon = (coords[0] as num).toDouble();
|
||||||
print("COUCOU IL FAUT NAVIGATE FLUTTER MAP");
|
print("COUCOU IL FAUT NAVIGATE FLUTTER MAP");
|
||||||
mapController!.move(LatLng(double.tryParse(geoPoint.latitude!)!, double.tryParse(geoPoint.longitude!)!), mapController!.camera.zoom/*, widget.mapDTO!.zoom != null ? widget.mapDTO!.zoom!.toDouble() : 16*/); // keep actual zoom
|
mapController!.move(LatLng(lat, lon), mapController!.camera.zoom);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return SizedBox();
|
return SizedBox();
|
||||||
},
|
},
|
||||||
|
|||||||
@ -90,9 +90,15 @@ class _GeoPointFilterState extends State<GeoPointFilter> with SingleTickerProvid
|
|||||||
for(var pointWithoutCat in geoPoints.where((gp) => gp.categorieId == null))
|
for(var pointWithoutCat in geoPoints.where((gp) => gp.categorieId == null))
|
||||||
{
|
{
|
||||||
if(pointWithoutCat.title!.where((l) => l.language == widget.language).firstOrNull != null) {
|
if(pointWithoutCat.title!.where((l) => l.language == widget.language).firstOrNull != null) {
|
||||||
|
// Extraire lat/lon depuis la géométrie GeoJSON (Point → [longitude, latitude])
|
||||||
|
final coordsNocat = pointWithoutCat.geometry?.type == 'Point'
|
||||||
|
? pointWithoutCat.geometry!.coordinates as List<dynamic>?
|
||||||
|
: null;
|
||||||
|
final latNocat = coordsNocat != null && coordsNocat.length >= 2 ? (coordsNocat[1] as num).toDouble().toString() : '';
|
||||||
|
final lonNocat = coordsNocat != null && coordsNocat.length >= 2 ? (coordsNocat[0] as num).toDouble().toString() : '';
|
||||||
TreeNode nodeWithoutCat = TreeNode(
|
TreeNode nodeWithoutCat = TreeNode(
|
||||||
id: 000 + int.parse(
|
id: 000 + int.parse(
|
||||||
(pointWithoutCat.latitude ?? '').substring(0, min(pointWithoutCat.latitude!.length, 10)).replaceAll(".", "").replaceAll("-","") + (pointWithoutCat.longitude ?? '').substring(0, min(pointWithoutCat.longitude!.length, 10)).replaceAll(".", "").replaceAll("-","")
|
latNocat.substring(0, min(latNocat.length, 10)).replaceAll(".", "").replaceAll("-","") + lonNocat.substring(0, min(lonNocat.length, 10)).replaceAll(".", "").replaceAll("-","")
|
||||||
),
|
),
|
||||||
title: parse(pointWithoutCat.title!.firstWhere((l) => l.language == widget.language).value!).documentElement!.text,
|
title: parse(pointWithoutCat.title!.firstWhere((l) => l.language == widget.language).value!).documentElement!.text,
|
||||||
children: [],
|
children: [],
|
||||||
@ -122,9 +128,11 @@ class _GeoPointFilterState extends State<GeoPointFilter> with SingleTickerProvid
|
|||||||
// Ajoutez les géopoints correspondant à cette catégorie en tant qu'enfants du nœud parent
|
// Ajoutez les géopoints correspondant à cette catégorie en tant qu'enfants du nœud parent
|
||||||
for (var geoPoint in geoPoints.where((gp) => gp.categorieId != null)) {
|
for (var geoPoint in geoPoints.where((gp) => gp.categorieId != null)) {
|
||||||
if (geoPoint.categorieId == category.id && geoPoint.title!.where((l) => l.language == widget.language).firstOrNull != null) {
|
if (geoPoint.categorieId == category.id && geoPoint.title!.where((l) => l.language == widget.language).firstOrNull != null) {
|
||||||
|
final lat = _getPointLatLon(geoPoint, true);
|
||||||
|
final lon = _getPointLatLon(geoPoint, false);
|
||||||
TreeNode geoPointNode = TreeNode(
|
TreeNode geoPointNode = TreeNode(
|
||||||
id: 000 + int.parse(
|
id: 000 + int.parse(
|
||||||
(geoPoint.latitude ?? '').substring(0, min(geoPoint.latitude!.length, 10)).replaceAll(".", "").replaceAll("-", "") + (geoPoint.longitude ?? '').substring(0, min(geoPoint.longitude!.length, 10)).replaceAll(".", "").replaceAll("-", "")
|
lat.substring(0, min(lat.length, 10)).replaceAll(".", "").replaceAll("-", "") + lon.substring(0, min(lon.length, 10)).replaceAll(".", "").replaceAll("-", "")
|
||||||
),
|
),
|
||||||
title: parse(geoPoint.title!.firstWhere((l) => l.language == widget.language).value!).documentElement!.text,
|
title: parse(geoPoint.title!.firstWhere((l) => l.language == widget.language).value!).documentElement!.text,
|
||||||
checked: true, // default true
|
checked: true, // default true
|
||||||
@ -170,12 +178,12 @@ class _GeoPointFilterState extends State<GeoPointFilter> with SingleTickerProvid
|
|||||||
if (childNode.checked) {
|
if (childNode.checked) {
|
||||||
var point = widget.geoPoints.firstWhere(
|
var point = widget.geoPoints.firstWhere(
|
||||||
(point) {
|
(point) {
|
||||||
String latitudePart = (point.latitude ?? '')
|
String latitudePart = _getPointLatLon(point, true)
|
||||||
.substring(0, min(point.latitude!.length, 10))
|
.substring(0, min(_getPointLatLon(point, true).length, 10))
|
||||||
.replaceAll(".", "")
|
.replaceAll(".", "")
|
||||||
.replaceAll("-", "");
|
.replaceAll("-", "");
|
||||||
String longitudePart = (point.longitude ?? '')
|
String longitudePart = _getPointLatLon(point, false)
|
||||||
.substring(0, min(point.longitude!.length, 10))
|
.substring(0, min(_getPointLatLon(point, false).length, 10))
|
||||||
.replaceAll(".", "")
|
.replaceAll(".", "")
|
||||||
.replaceAll("-", "");
|
.replaceAll("-", "");
|
||||||
int combinedValue = int.parse(latitudePart + longitudePart);
|
int combinedValue = int.parse(latitudePart + longitudePart);
|
||||||
@ -194,12 +202,12 @@ class _GeoPointFilterState extends State<GeoPointFilter> with SingleTickerProvid
|
|||||||
if(node.checked) {
|
if(node.checked) {
|
||||||
var point = widget.geoPoints.firstWhere(
|
var point = widget.geoPoints.firstWhere(
|
||||||
(point) {
|
(point) {
|
||||||
String latitudePart = (point.latitude ?? '')
|
String latitudePart = _getPointLatLon(point, true)
|
||||||
.substring(0, min(point.latitude!.length, 10))
|
.substring(0, min(_getPointLatLon(point, true).length, 10))
|
||||||
.replaceAll(".", "")
|
.replaceAll(".", "")
|
||||||
.replaceAll("-", "");
|
.replaceAll("-", "");
|
||||||
String longitudePart = (point.longitude ?? '')
|
String longitudePart = _getPointLatLon(point, false)
|
||||||
.substring(0, min(point.longitude!.length, 10))
|
.substring(0, min(_getPointLatLon(point, false).length, 10))
|
||||||
.replaceAll(".", "")
|
.replaceAll(".", "")
|
||||||
.replaceAll("-", "");
|
.replaceAll("-", "");
|
||||||
int combinedValue = int.parse(latitudePart + longitudePart);
|
int combinedValue = int.parse(latitudePart + longitudePart);
|
||||||
@ -261,7 +269,7 @@ class _GeoPointFilterState extends State<GeoPointFilter> with SingleTickerProvid
|
|||||||
final mapContext = Provider.of<MapContext>(context);
|
final mapContext = Provider.of<MapContext>(context);
|
||||||
|
|
||||||
var primaryColor = visitAppContext.configuration != null ? visitAppContext.configuration!.primaryColor != null ? Color(int.parse(visitAppContext.configuration!.primaryColor!.split('(0x')[1].split(')')[0], radix: 16)) : kSecondColor : kSecondColor;
|
var primaryColor = visitAppContext.configuration != null ? visitAppContext.configuration!.primaryColor != null ? Color(int.parse(visitAppContext.configuration!.primaryColor!.split('(0x')[1].split(')')[0], radix: 16)) : kSecondColor : kSecondColor;
|
||||||
double rounded = visitAppContext.configuration?.roundedValue?.toDouble() ?? 20.0;
|
double rounded = visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0;
|
||||||
|
|
||||||
return Positioned(
|
return Positioned(
|
||||||
left: 0,
|
left: 0,
|
||||||
@ -307,7 +315,7 @@ class _GeoPointFilterState extends State<GeoPointFilter> with SingleTickerProvid
|
|||||||
),
|
),
|
||||||
focusColor: primaryColor,
|
focusColor: primaryColor,
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)),
|
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0)),
|
||||||
borderSide: BorderSide(color: primaryColor)),
|
borderSide: BorderSide(color: primaryColor)),
|
||||||
//labelStyle: TextStyle(color: primaryColor),
|
//labelStyle: TextStyle(color: primaryColor),
|
||||||
suffixIcon: IconButton(
|
suffixIcon: IconButton(
|
||||||
@ -345,12 +353,14 @@ class _GeoPointFilterState extends State<GeoPointFilter> with SingleTickerProvid
|
|||||||
onClicked: (node, commonID) {
|
onClicked: (node, commonID) {
|
||||||
var selectedNode = widget.geoPoints.firstWhere(
|
var selectedNode = widget.geoPoints.firstWhere(
|
||||||
(point) {
|
(point) {
|
||||||
String latitudePart = (point.latitude ?? '')
|
final lat = _getPointLatLon(point, true);
|
||||||
.substring(0, min(point.latitude!.length, 10))
|
final lon = _getPointLatLon(point, false);
|
||||||
|
String latitudePart = lat
|
||||||
|
.substring(0, min(lat.length, 10))
|
||||||
.replaceAll(".", "")
|
.replaceAll(".", "")
|
||||||
.replaceAll("-", "");
|
.replaceAll("-", "");
|
||||||
String longitudePart = (point.longitude ?? '')
|
String longitudePart = lon
|
||||||
.substring(0, min(point.longitude!.length, 10))
|
.substring(0, min(lon.length, 10))
|
||||||
.replaceAll(".", "")
|
.replaceAll(".", "")
|
||||||
.replaceAll("-", "");
|
.replaceAll("-", "");
|
||||||
int combinedValue =
|
int combinedValue =
|
||||||
@ -385,5 +395,15 @@ class _GeoPointFilterState extends State<GeoPointFilter> with SingleTickerProvid
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String _getPointLatLon(GeoPointDTO point, bool isLat) {
|
||||||
|
if (point.geometry?.type == 'Point' && point.geometry?.coordinates is List) {
|
||||||
|
final coords = point.geometry!.coordinates as List;
|
||||||
|
if (coords.length >= 2) {
|
||||||
|
return (coords[isLat ? 1 : 0] as num).toDouble().toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,6 @@ class _GoogleMapViewState extends State<GoogleMapView> {
|
|||||||
GoogleMapController? _GoogleMapcontroller;
|
GoogleMapController? _GoogleMapcontroller;
|
||||||
Set<Marker> markers = {};
|
Set<Marker> markers = {};
|
||||||
List<GeoPointDTO>? pointsToShow = [];
|
List<GeoPointDTO>? pointsToShow = [];
|
||||||
//List<String>? selectedCategories = [];
|
|
||||||
bool init = false;
|
bool init = false;
|
||||||
|
|
||||||
Set<Marker> getMarkers(language, mapContext) {
|
Set<Marker> getMarkers(language, mapContext) {
|
||||||
@ -40,35 +39,25 @@ class _GoogleMapViewState extends State<GoogleMapView> {
|
|||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
pointsToShow!.forEach((point) {
|
pointsToShow!.forEach((point) {
|
||||||
var textSansHTML = parse(point.title!.firstWhere((translation) => translation.language == language).value);
|
if (point.title != null && point.title!.any((translation) => translation.language == language)) {
|
||||||
|
var translation = point.title!.firstWhere((translation) => translation.language == language);
|
||||||
|
var textSansHTML = parse(translation.value);
|
||||||
point.id = i;
|
point.id = i;
|
||||||
/*var mapMarker = new MapMarker(
|
var coords = _getPointLatLon(point);
|
||||||
id: point.id,
|
if (coords != null) {
|
||||||
title: parse(textSansHTML.body!.text).documentElement!.text,
|
var icon = point.categorieId == null
|
||||||
description: point.description!.firstWhere((translation) => translation.language == language).value,
|
? BitmapDescriptor.bytes(widget.icons.where((i) => i['id'] == null).first['icon'])
|
||||||
longitude: point.longitude,
|
: widget.icons.any((i) => i['id'] == point.categorieId)
|
||||||
latitude: point.latitude,
|
? BitmapDescriptor.bytes(widget.icons.where((i) => i['id'] == point.categorieId).first['icon'])
|
||||||
contents: point.contents
|
: BitmapDescriptor.bytes(widget.icons.where((i) => i['id'] == null).first['icon']);
|
||||||
);*/
|
|
||||||
if (point.latitude != null && point.longitude != null) {
|
|
||||||
var icon = point.categorieId == null ? BitmapDescriptor.bytes(widget.icons.where((i) => i['id'] == null).first['icon']) : widget.icons.any((i) => i['id'] == point.categorieId) ? BitmapDescriptor.bytes(widget.icons.where((i) => i['id'] == point.categorieId).first['icon']) : BitmapDescriptor.bytes(widget.icons.where((i) => i['id'] == null).first['icon']); //widget.selectedMarkerIcon,;
|
|
||||||
markers.add(Marker(
|
markers.add(Marker(
|
||||||
draggable: false,
|
draggable: false,
|
||||||
markerId: MarkerId(parse(textSansHTML.body!.text).documentElement!.text + point.latitude! + point.longitude!),
|
markerId: MarkerId(parse(textSansHTML.body!.text).documentElement!.text + coords.latitude.toString() + coords.longitude.toString()),
|
||||||
position: LatLng(
|
position: coords,
|
||||||
double.tryParse(point.latitude!)!,
|
icon: icon,
|
||||||
double.tryParse(point.longitude!)!,
|
|
||||||
),
|
|
||||||
icon: icon, //widget.selectedMarkerIcon,
|
|
||||||
//widget.selectedMarkerIcon != null ? BitmapDescriptor.fromBytes(widget.selectedMarkerIcon!) : BitmapDescriptor.defaultMarker,
|
|
||||||
/*icon: BitmapDescriptor.defaultMarkerWithHue(
|
|
||||||
BitmapDescriptor.hueYellow,
|
|
||||||
),*/
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
//setState(() {
|
|
||||||
mapContext.setSelectedPoint(point);
|
mapContext.setSelectedPoint(point);
|
||||||
//mapContext.setSelectedPointForNavigate(point);
|
|
||||||
//});
|
|
||||||
(Provider.of<AppContext>(context, listen: false).getContext() as VisitAppContext)
|
(Provider.of<AppContext>(context, listen: false).getContext() as VisitAppContext)
|
||||||
.statisticsService?.track(
|
.statisticsService?.track(
|
||||||
VisitEventType.mapPoiTap,
|
VisitEventType.mapPoiTap,
|
||||||
@ -80,91 +69,75 @@ class _GoogleMapViewState extends State<GoogleMapView> {
|
|||||||
},
|
},
|
||||||
infoWindow: InfoWindow.noText));
|
infoWindow: InfoWindow.noText));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
i++;
|
i++;
|
||||||
});
|
});
|
||||||
return markers;
|
return markers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LatLng? _getPointLatLon(GeoPointDTO point) {
|
||||||
|
if (point.geometry?.type == 'Point' && point.geometry?.coordinates != null && point.geometry!.coordinates! is List) {
|
||||||
|
final coords = point.geometry!.coordinates! as List;
|
||||||
|
if (coords.length >= 2) {
|
||||||
|
return LatLng(
|
||||||
|
(coords[1] as num).toDouble(),
|
||||||
|
(coords[0] as num).toDouble(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
//selectedCategories = widget.mapDTO.categories!.map((cat) => cat.label!.firstWhere((element) => element.language == widget.language).value!).toList();
|
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
// TODO: implement dispose
|
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final mapContext = Provider.of<MapContext>(context);
|
final mapContext = Provider.of<MapContext>(context);
|
||||||
final appContext = Provider.of<AppContext>(context);
|
//final appContext = Provider.of<AppContext>(context);
|
||||||
VisitAppContext visitAppContext = appContext.getContext() as VisitAppContext;
|
|
||||||
Size size = MediaQuery.of(context).size;
|
|
||||||
|
|
||||||
pointsToShow = widget.geoPoints;
|
pointsToShow = widget.geoPoints;
|
||||||
|
|
||||||
/*if(!init) {
|
|
||||||
print("getmarkers in build");*/
|
|
||||||
getMarkers(widget.language, mapContext);
|
getMarkers(widget.language, mapContext);
|
||||||
/* init = true;
|
|
||||||
}*/
|
|
||||||
//MapTypeApp? mapTypeApp = MapTypeApp.fromJson(widget.mapDTO!.mapType!.value);
|
|
||||||
//print(mapTypeApp.toString());
|
|
||||||
|
|
||||||
MapType type = MapType.hybrid;
|
MapType type = MapType.hybrid;
|
||||||
//if(kIsWeb) {
|
|
||||||
if(widget.mapDTO.mapType != null) {
|
if(widget.mapDTO.mapType != null) {
|
||||||
switch(widget.mapDTO.mapType!.value) {
|
switch(widget.mapDTO.mapType!.value) {
|
||||||
case 0:
|
case 0: type = MapType.none; break;
|
||||||
type = MapType.none;
|
case 1: type = MapType.normal; break;
|
||||||
break;
|
case 2: type = MapType.satellite; break;
|
||||||
case 1:
|
case 3: type = MapType.terrain; break;
|
||||||
type = MapType.normal;
|
case 4: type = MapType.hybrid; break;
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
type = MapType.satellite;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
type = MapType.terrain;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
type = MapType.hybrid;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*} else {
|
|
||||||
print("is OTHEER");
|
|
||||||
type = EnumToString.fromString(MapType.values, widget.mapDTO!.mapType.toString()) != null ? EnumToString.fromString(MapType.values, widget.mapDTO!.mapType.toString())! : MapType.hybrid;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
//MapType type = EnumToString.fromString(MapType.values, widget.mapDTO!.mapType.toString()) != null ? EnumToString.fromString(MapType.values, widget.mapDTO!.mapType.toString())! : MapType.hybrid;
|
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
Center(
|
Center(
|
||||||
child: GoogleMap(
|
child: GoogleMap(
|
||||||
mapType: type, // widget.mapDTO!.mapType != null ? EnumToString.fromString(MapType.values, widget.mapDTO!.mapType.toString())!: MapType.hybrid,
|
mapType: type,
|
||||||
mapToolbarEnabled: false,
|
mapToolbarEnabled: false,
|
||||||
indoorViewEnabled: false,
|
indoorViewEnabled: false,
|
||||||
initialCameraPosition: CameraPosition(
|
initialCameraPosition: CameraPosition(
|
||||||
target: widget.mapDTO.longitude != null && widget.mapDTO.latitude != null ? LatLng(double.tryParse(widget.mapDTO.latitude!)!, double.tryParse(widget.mapDTO.longitude!)!) : LatLng(50.465503, 4.865105) , // MDLF 50.416639, 4.879169 / Namur 50.465503, 4.865105
|
target: widget.mapDTO.longitude != null && widget.mapDTO.latitude != null
|
||||||
|
? LatLng(double.tryParse(widget.mapDTO.latitude!)!, double.tryParse(widget.mapDTO.longitude!)!)
|
||||||
|
: LatLng(50.465503, 4.865105),
|
||||||
zoom: widget.mapDTO.zoom != null ? widget.mapDTO.zoom!.toDouble() : 18,
|
zoom: widget.mapDTO.zoom != null ? widget.mapDTO.zoom!.toDouble() : 18,
|
||||||
),
|
),
|
||||||
onMapCreated: (GoogleMapController controller) {
|
onMapCreated: (GoogleMapController controller) {
|
||||||
if(kIsWeb) {
|
if (!kIsWeb) {
|
||||||
//_controllerWeb.complete(controller);
|
|
||||||
} else {
|
|
||||||
_controller.complete(controller);
|
_controller.complete(controller);
|
||||||
_GoogleMapcontroller = controller;
|
_GoogleMapcontroller = controller;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
markers: markers,
|
markers: markers,
|
||||||
onTap: (LatLng location) {
|
onTap: (LatLng location) {
|
||||||
print(location);
|
|
||||||
mapContext.setSelectedPoint(null);
|
mapContext.setSelectedPoint(null);
|
||||||
mapContext.setSelectedPointForNavigate(null);
|
mapContext.setSelectedPointForNavigate(null);
|
||||||
},
|
},
|
||||||
@ -177,19 +150,19 @@ class _GoogleMapViewState extends State<GoogleMapView> {
|
|||||||
builder: (context, mapContext, _) {
|
builder: (context, mapContext, _) {
|
||||||
var geopoint = mapContext.getSelectedPointForNavigate() as GeoPointDTO?;
|
var geopoint = mapContext.getSelectedPointForNavigate() as GeoPointDTO?;
|
||||||
if (geopoint != null && _GoogleMapcontroller != null) {
|
if (geopoint != null && _GoogleMapcontroller != null) {
|
||||||
print("COUCOU IL FAUT NAVUGATE");
|
|
||||||
// TODO Handle zoomDetail
|
|
||||||
_GoogleMapcontroller!.getZoomLevel().then((actualZoom) {
|
_GoogleMapcontroller!.getZoomLevel().then((actualZoom) {
|
||||||
var zoomToNavigate = actualZoom <= 12.0 ? 15.0 : actualZoom;
|
var zoomToNavigate = actualZoom <= 12.0 ? 15.0 : actualZoom;
|
||||||
|
var coords = _getPointLatLon(geopoint);
|
||||||
|
if (coords != null) {
|
||||||
_GoogleMapcontroller!.animateCamera(CameraUpdate.newCameraPosition(
|
_GoogleMapcontroller!.animateCamera(CameraUpdate.newCameraPosition(
|
||||||
CameraPosition(
|
CameraPosition(
|
||||||
target: LatLng(double.tryParse(geopoint.latitude!)!, double.tryParse(geopoint.longitude!)!),
|
target: coords,
|
||||||
tilt: 0.0,
|
tilt: 0.0,
|
||||||
bearing: 0.0,
|
bearing: 0.0,
|
||||||
zoom: zoomToNavigate
|
zoom: zoomToNavigate
|
||||||
//zoom: widget.mapDTO.zoom != null ? widget.mapDTO.zoom!.toDouble() : 16
|
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return SizedBox();
|
return SizedBox();
|
||||||
@ -198,50 +171,7 @@ class _GoogleMapViewState extends State<GoogleMapView> {
|
|||||||
}
|
}
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
/*Positioned(
|
|
||||||
left: 5,
|
|
||||||
top: 35,
|
|
||||||
child: SizedBox(
|
|
||||||
width: size.width * 0.3,
|
|
||||||
height: size.height * 0.76,
|
|
||||||
child: GeoPointFilter(
|
|
||||||
language: tabletAppContext.language!,
|
|
||||||
geoPoints: widget.mapDTO!.points!,
|
|
||||||
categories: widget.mapDTO!.categories!,
|
|
||||||
filteredPoints: (filteredPoints) {
|
|
||||||
print("COUCOU FILTERED POINTS");
|
|
||||||
print(filteredPoints);
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Positioned(
|
|
||||||
bottom: 35,
|
|
||||||
left: 10,
|
|
||||||
child: SizedBox(
|
|
||||||
width: size.width * 0.75,
|
|
||||||
child: MultiSelectContainer(
|
|
||||||
label: null,
|
|
||||||
color: kBackgroundGrey,
|
|
||||||
initialValue: selectedCategories!,
|
|
||||||
isMultiple: true,
|
|
||||||
values: widget.mapDTO!.categories!.map((categorie) => categorie.label!.firstWhere((element) => element.language == widget.language).value!).toList(),
|
|
||||||
onChanged: (value) {
|
|
||||||
var tempOutput = new List<String>.from(value);
|
|
||||||
print(tempOutput);
|
|
||||||
if(init) {
|
|
||||||
selectedCategories = tempOutput;
|
|
||||||
pointsToShow = widget.mapDTO!.points!.where((point) => tempOutput.any((tps) => point.categorie?.label?.firstWhere((lab) => lab.language == widget.language).value == tps) || point.categorie == null).toList();
|
|
||||||
setState(() {
|
|
||||||
markers = getMarkers(widget.language, mapContext);
|
|
||||||
mapContext.notifyListeners();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),*/
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -40,7 +40,17 @@ class AnnotationClickListener extends mapBox.OnPointAnnotationClickListener {
|
|||||||
@override
|
@override
|
||||||
void onPointAnnotationClick(mapBox.PointAnnotation annotation) {
|
void onPointAnnotationClick(mapBox.PointAnnotation annotation) {
|
||||||
try{
|
try{
|
||||||
var markerToShow = markersList.firstWhere((ml) => "${parse(ml.title!.first.value).documentElement!.text}${ml.latitude}${ml.longitude}" == annotation.textField);
|
var markerToShow = markersList.firstWhere((ml) {
|
||||||
|
if (ml.geometry?.type == 'Point' && ml.geometry?.coordinates != null && ml.geometry!.coordinates! is List) {
|
||||||
|
final coords = ml.geometry!.coordinates! as List;
|
||||||
|
if (coords.length >= 2) {
|
||||||
|
final lat = (coords[1] as num).toDouble();
|
||||||
|
final lon = (coords[0] as num).toDouble();
|
||||||
|
return "${parse(ml.title!.first.value).documentElement!.text}$lat$lon" == annotation.textField;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
mapContext.setSelectedPoint(markerToShow);
|
mapContext.setSelectedPoint(markerToShow);
|
||||||
//mapContext.setSelectedPointForNavigate(markerToShow);
|
//mapContext.setSelectedPointForNavigate(markerToShow);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
@ -73,14 +83,16 @@ class _MapBoxViewState extends State<MapBoxView> {
|
|||||||
contents: point.contents
|
contents: point.contents
|
||||||
);*/
|
);*/
|
||||||
markersList.add(point);
|
markersList.add(point);
|
||||||
|
var coords = _getPointLatLon(point);
|
||||||
|
if (coords != null) {
|
||||||
options.add(mapBox.PointAnnotationOptions(
|
options.add(mapBox.PointAnnotationOptions(
|
||||||
geometry: mapBox.Point(
|
geometry: mapBox.Point(
|
||||||
coordinates: mapBox.Position(
|
coordinates: mapBox.Position(
|
||||||
double.tryParse(point.longitude!)!,
|
coords.longitude,
|
||||||
double.tryParse(point.latitude!)!,
|
coords.latitude,
|
||||||
)), // .toJson()
|
)), // .toJson()
|
||||||
iconSize: 1.3,
|
iconSize: 1.3,
|
||||||
textField: "${parse(textSansHTML.body!.text).documentElement!.text}${point.latitude}${point.longitude}",
|
textField: "${parse(textSansHTML.body!.text).documentElement!.text}${coords.latitude}${coords.longitude}",
|
||||||
textOpacity: 0.0,
|
textOpacity: 0.0,
|
||||||
iconOffset: [0.0, 0.0],
|
iconOffset: [0.0, 0.0],
|
||||||
symbolSortKey: 10,
|
symbolSortKey: 10,
|
||||||
@ -88,6 +100,7 @@ class _MapBoxViewState extends State<MapBoxView> {
|
|||||||
iconImage: null,
|
iconImage: null,
|
||||||
image: point.categorieId == null ? widget.icons.where((i) => i['id'] == null).first['icon'] : widget.icons.any((i) => i['id'] == point.categorieId) ? widget.icons.where((i) => i['id'] == point.categorieId).first['icon'] : widget.icons.where((i) => i['id'] == null).first['icon'], //widget.selectedMarkerIcon,
|
image: point.categorieId == null ? widget.icons.where((i) => i['id'] == null).first['icon'] : widget.icons.any((i) => i['id'] == point.categorieId) ? widget.icons.where((i) => i['id'] == point.categorieId).first['icon'] : widget.icons.where((i) => i['id'] == null).first['icon'], //widget.selectedMarkerIcon,
|
||||||
)); // ,
|
)); // ,
|
||||||
|
}
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
@ -199,14 +212,17 @@ class _MapBoxViewState extends State<MapBoxView> {
|
|||||||
if (geoPoint != null && mapboxMap != null) {
|
if (geoPoint != null && mapboxMap != null) {
|
||||||
print("COUCOU IL FAUT NAVUGATE MAPBOX");
|
print("COUCOU IL FAUT NAVUGATE MAPBOX");
|
||||||
// TODO Handle zoomDetail
|
// TODO Handle zoomDetail
|
||||||
|
var coords = _getPointLatLon(geoPoint);
|
||||||
|
if (coords != null) {
|
||||||
mapboxMap?.easeTo(
|
mapboxMap?.easeTo(
|
||||||
mapBox.CameraOptions(
|
mapBox.CameraOptions(
|
||||||
center: mapBox.Point(coordinates: mapBox.Position(double.tryParse(geoPoint.longitude!)!, double.tryParse(geoPoint.latitude!)!)), //.toJson()
|
center: mapBox.Point(coordinates: mapBox.Position(coords.longitude, coords.latitude)), //.toJson()
|
||||||
zoom: 16,
|
zoom: 16,
|
||||||
bearing: 0,
|
bearing: 0,
|
||||||
pitch: 3),
|
pitch: 3),
|
||||||
mapBox.MapAnimationOptions(duration: 2000, startDelay: 0));
|
mapBox.MapAnimationOptions(duration: 2000, startDelay: 0));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return SizedBox();
|
return SizedBox();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -233,4 +249,16 @@ class _MapBoxViewState extends State<MapBoxView> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LatLng? _getPointLatLon(GeoPointDTO point) {
|
||||||
|
if (point.geometry?.type == 'Point' && point.geometry?.coordinates != null && point.geometry!.coordinates! is List) {
|
||||||
|
final coords = point.geometry!.coordinates! as List;
|
||||||
|
if (coords.length >= 2) {
|
||||||
|
return LatLng(
|
||||||
|
(coords[1] as num).toDouble(),
|
||||||
|
(coords[0] as num).toDouble(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -71,7 +71,7 @@ class _MarkerInfoWidget extends State<MarkerViewWidget> {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: kBackgroundColor, // Colors.amberAccent //kBackgroundLight,
|
color: kBackgroundColor, // Colors.amberAccent //kBackgroundLight,
|
||||||
//shape: BoxShape.rectangle,
|
//shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 10.0),
|
borderRadius: BorderRadius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 10.0),
|
||||||
/*boxShadow: [
|
/*boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: kBackgroundSecondGrey,
|
color: kBackgroundSecondGrey,
|
||||||
@ -85,7 +85,7 @@ class _MarkerInfoWidget extends State<MarkerViewWidget> {
|
|||||||
children: <Widget> [
|
children: <Widget> [
|
||||||
if(selectedPoint != null)
|
if(selectedPoint != null)
|
||||||
ClipRRect(
|
ClipRRect(
|
||||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0), topRight: Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)),
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0), topRight: Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0)),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
@ -149,7 +149,7 @@ class _MarkerInfoWidget extends State<MarkerViewWidget> {
|
|||||||
width: size.width,
|
width: size.width,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: kBackgroundLight,
|
color: kBackgroundLight,
|
||||||
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0))
|
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0))
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(left: 20, right: 10, bottom: 10, top: 15),
|
padding: const EdgeInsets.only(left: 20, right: 10, bottom: 10, top: 15),
|
||||||
@ -222,7 +222,7 @@ class _MarkerInfoWidget extends State<MarkerViewWidget> {
|
|||||||
width: size.width,
|
width: size.width,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: kBackgroundLight,
|
color: kBackgroundLight,
|
||||||
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0))
|
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0))
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(left: 20, right: 10, bottom: 10, top: 15),
|
padding: const EdgeInsets.only(left: 20, right: 10, bottom: 10, top: 15),
|
||||||
@ -400,7 +400,7 @@ class _MarkerInfoWidget extends State<MarkerViewWidget> {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: kBackgroundColor,
|
color: kBackgroundColor,
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(tabletAppContext.configuration!.roundedValue?.toDouble() ?? 10.0),
|
borderRadius: BorderRadius.circular(tabletAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 10.0),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: kBackgroundSecondGrey,
|
color: kBackgroundSecondGrey,
|
||||||
@ -509,13 +509,13 @@ getElementForResource(BuildContext context, AppContext appContext, ContentDTO i,
|
|||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0))
|
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0))
|
||||||
),
|
),
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
// title: Text(eventAgenda.name!),
|
// title: Text(eventAgenda.name!),
|
||||||
content: Container(
|
content: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)),
|
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0)),
|
||||||
color: kBackgroundColor,
|
color: kBackgroundColor,
|
||||||
),
|
),
|
||||||
constraints: const BoxConstraints(minWidth: 250, minHeight: 250, maxHeight: 350),
|
constraints: const BoxConstraints(minWidth: 250, minHeight: 250, maxHeight: 350),
|
||||||
@ -524,7 +524,7 @@ getElementForResource(BuildContext context, AppContext appContext, ContentDTO i,
|
|||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
//color: Colors.yellow,
|
//color: Colors.yellow,
|
||||||
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 15.0)),
|
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 15.0)),
|
||||||
),
|
),
|
||||||
child: PhotoView(
|
child: PhotoView(
|
||||||
imageProvider: ImageCustomProvider.getImageProvider(appContext, i.resourceId!, i.resource!.url!),
|
imageProvider: ImageCustomProvider.getImageProvider(appContext, i.resourceId!, i.resource!.url!),
|
||||||
@ -533,7 +533,7 @@ getElementForResource(BuildContext context, AppContext appContext, ContentDTO i,
|
|||||||
backgroundDecoration: BoxDecoration(
|
backgroundDecoration: BoxDecoration(
|
||||||
color: kBackgroundGrey,
|
color: kBackgroundGrey,
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 15.0),
|
borderRadius: BorderRadius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 15.0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -550,7 +550,7 @@ getElementForResource(BuildContext context, AppContext appContext, ContentDTO i,
|
|||||||
image: ImageCustomProvider.getImageProvider(appContext, i.resourceId!, i.resource!.url!),
|
image: ImageCustomProvider.getImageProvider(appContext, i.resourceId!, i.resource!.url!),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 15.0)),
|
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 15.0)),
|
||||||
/*border: Border.all(
|
/*border: Border.all(
|
||||||
color: kBackgroundGrey,
|
color: kBackgroundGrey,
|
||||||
width: 1.0,
|
width: 1.0,
|
||||||
@ -571,13 +571,13 @@ getElementForResource(BuildContext context, AppContext appContext, ContentDTO i,
|
|||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0))
|
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0))
|
||||||
),
|
),
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
// title: Text(eventAgenda.name!),
|
// title: Text(eventAgenda.name!),
|
||||||
content: Container(
|
content: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)),
|
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0)),
|
||||||
color: kBackgroundColor,
|
color: kBackgroundColor,
|
||||||
),
|
),
|
||||||
constraints: const BoxConstraints(minWidth: 250, minHeight: 250, maxHeight: 350),
|
constraints: const BoxConstraints(minWidth: 250, minHeight: 250, maxHeight: 350),
|
||||||
@ -595,7 +595,7 @@ getElementForResource(BuildContext context, AppContext appContext, ContentDTO i,
|
|||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 15.0),
|
borderRadius: BorderRadius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 15.0),
|
||||||
),
|
),
|
||||||
child: showElementForResource(ResourceDTO(id: i.resourceId, url: i.resource?.url, type: i.resource?.type), appContext, false, true),
|
child: showElementForResource(ResourceDTO(id: i.resourceId, url: i.resource?.url, type: i.resource?.type), appContext, false, true),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -341,7 +341,7 @@ boxDecoration(AppContext appContext, SectionDTO section, bool isSelected, Object
|
|||||||
return BoxDecoration(
|
return BoxDecoration(
|
||||||
color: kBackgroundLight,
|
color: kBackgroundLight,
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0),
|
borderRadius: BorderRadius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0),
|
||||||
image: section.imageSource != null || section.type == SectionType.Video ? DecorationImage(
|
image: section.imageSource != null || section.type == SectionType.Video ? DecorationImage(
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
colorFilter: !isSelected? ColorFilter.mode(kBackgroundLight.withValues(alpha: 0.35), BlendMode.dstATop) : null,
|
colorFilter: !isSelected? ColorFilter.mode(kBackgroundLight.withValues(alpha: 0.35), BlendMode.dstATop) : null,
|
||||||
|
|||||||
@ -63,7 +63,7 @@ class _PdfFilterState extends State<PdfFilter> with SingleTickerProviderStateMix
|
|||||||
? Color(int.parse(visitAppContext.configuration!.primaryColor!.split('(0x')[1].split(')')[0], radix: 16))
|
? Color(int.parse(visitAppContext.configuration!.primaryColor!.split('(0x')[1].split(')')[0], radix: 16))
|
||||||
: kSecondColor;
|
: kSecondColor;
|
||||||
|
|
||||||
double rounded = visitAppContext.configuration?.roundedValue?.toDouble() ?? 20.0;
|
double rounded = visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0;
|
||||||
|
|
||||||
return AnimatedBuilder(
|
return AnimatedBuilder(
|
||||||
animation: _widthAnimation,
|
animation: _widthAnimation,
|
||||||
|
|||||||
@ -279,7 +279,7 @@ class _PDFPage extends State<PDFPage> {
|
|||||||
builder: (context, value, _) {
|
builder: (context, value, _) {
|
||||||
return Container(
|
return Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)),
|
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0)),
|
||||||
color: primaryColor
|
color: primaryColor
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
|||||||
@ -83,7 +83,7 @@ class _SliderPage extends State<SliderPage> {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: kBackgroundGrey,
|
color: kBackgroundGrey,
|
||||||
//color: configurationDTO.imageId == null ? configurationDTO.secondaryColor != null ? new Color(int.parse(configurationDTO.secondaryColor!.split('(0x')[1].split(')')[0], radix: 16)): kBackgroundGrey : null,
|
//color: configurationDTO.imageId == null ? configurationDTO.secondaryColor != null ? new Color(int.parse(configurationDTO.secondaryColor!.split('(0x')[1].split(')')[0], radix: 16)): kBackgroundGrey : null,
|
||||||
borderRadius: BorderRadius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 10.0),
|
borderRadius: BorderRadius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 10.0),
|
||||||
//border: Border.all(width: 0.3, color: kSecondGrey),
|
//border: Border.all(width: 0.3, color: kSecondGrey),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -142,7 +142,7 @@ class _SliderPage extends State<SliderPage> {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: kBackgroundLight,// kBackgroundLight,
|
color: kBackgroundLight,// kBackgroundLight,
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 10.0),
|
borderRadius: BorderRadius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 10.0),
|
||||||
boxShadow: const [
|
boxShadow: const [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: kBackgroundSecondGrey,
|
color: kBackgroundSecondGrey,
|
||||||
@ -305,7 +305,7 @@ class _SliderPage extends State<SliderPage> {
|
|||||||
offset: Offset(0, 2), // changes position of shadow
|
offset: Offset(0, 2), // changes position of shadow
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
borderRadius: BorderRadius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 15.0),
|
borderRadius: BorderRadius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 15.0),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
@ -325,7 +325,7 @@ class _SliderPage extends State<SliderPage> {
|
|||||||
offset: Offset(0, 2), // changes position of shadow
|
offset: Offset(0, 2), // changes position of shadow
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
borderRadius: BorderRadius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 15.0),
|
borderRadius: BorderRadius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 15.0),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
@ -336,7 +336,7 @@ class _SliderPage extends State<SliderPage> {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: kBackgroundLight,
|
color: kBackgroundLight,
|
||||||
//shape: BoxShape.rectangle,
|
//shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 15.0),
|
borderRadius: BorderRadius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 15.0),
|
||||||
),
|
),
|
||||||
child: showElementForResource(ResourceDTO(id: i.resourceId, url: i.resource!.url, type: i.resource!.type), appContext, false, true),
|
child: showElementForResource(ResourceDTO(id: i.resourceId, url: i.resource!.url, type: i.resource!.type), appContext, false, true),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -153,7 +153,7 @@ class _WeatherPageState extends State<WeatherPage> {
|
|||||||
children: [
|
children: [
|
||||||
weatherData == null ? const Center(child: Text("Aucune donnée à afficher")) : Container( // TODO translate ?
|
weatherData == null ? const Center(child: Text("Aucune donnée à afficher")) : Container( // TODO translate ?
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)),
|
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0)),
|
||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
begin: Alignment.topRight,
|
begin: Alignment.topRight,
|
||||||
end: Alignment.bottomLeft,
|
end: Alignment.bottomLeft,
|
||||||
@ -234,7 +234,7 @@ class _WeatherPageState extends State<WeatherPage> {
|
|||||||
height: size.height * 0.25,
|
height: size.height * 0.25,
|
||||||
width: size.width,
|
width: size.width,
|
||||||
/*decoration: BoxDecoration(
|
/*decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)),
|
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0)),
|
||||||
//color: Colors.grey,
|
//color: Colors.grey,
|
||||||
),*/
|
),*/
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -260,7 +260,7 @@ class _WeatherPageState extends State<WeatherPage> {
|
|||||||
width: size.width * 0.25,
|
width: size.width * 0.25,
|
||||||
constraints: const BoxConstraints(minWidth: 125, maxWidth: 250),
|
constraints: const BoxConstraints(minWidth: 125, maxWidth: 250),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)),
|
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0)),
|
||||||
color: Colors.lightBlueAccent,
|
color: Colors.lightBlueAccent,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
@ -295,7 +295,7 @@ class _WeatherPageState extends State<WeatherPage> {
|
|||||||
height: size.height * 0.3,
|
height: size.height * 0.3,
|
||||||
width: size.width,
|
width: size.width,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)),
|
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0)),
|
||||||
//color: Colors.amber,
|
//color: Colors.amber,
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -321,7 +321,7 @@ class _WeatherPageState extends State<WeatherPage> {
|
|||||||
width: size.width * 0.125,
|
width: size.width * 0.125,
|
||||||
constraints: const BoxConstraints(minWidth: 150, maxWidth: 250),
|
constraints: const BoxConstraints(minWidth: 150, maxWidth: 250),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)),
|
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.currentAppConfigurationLink?.roundedValue?.toDouble() ?? 20.0)),
|
||||||
color: Colors.lightBlue,
|
color: Colors.lightBlue,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
|
|||||||
@ -7,10 +7,8 @@ import 'package:flutter/foundation.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:manager_api_new/api.dart';
|
import 'package:manager_api_new/api.dart';
|
||||||
import 'package:mymuseum_visitapp/Components/CustomAppBar.dart';
|
|
||||||
import 'package:mymuseum_visitapp/Components/loading_common.dart';
|
import 'package:mymuseum_visitapp/Components/loading_common.dart';
|
||||||
import 'package:mymuseum_visitapp/Helpers/DatabaseHelper.dart';
|
import 'package:mymuseum_visitapp/Helpers/DatabaseHelper.dart';
|
||||||
import 'package:mymuseum_visitapp/Helpers/translationHelper.dart';
|
|
||||||
import 'package:mymuseum_visitapp/Models/articleRead.dart';
|
import 'package:mymuseum_visitapp/Models/articleRead.dart';
|
||||||
import 'package:mymuseum_visitapp/Models/resourceModel.dart';
|
import 'package:mymuseum_visitapp/Models/resourceModel.dart';
|
||||||
import 'package:mymuseum_visitapp/Models/visitContext.dart';
|
import 'package:mymuseum_visitapp/Models/visitContext.dart';
|
||||||
@ -26,7 +24,6 @@ import 'package:mymuseum_visitapp/Screens/Sections/Slider/slider_page.dart';
|
|||||||
import 'package:mymuseum_visitapp/Screens/Sections/Video/video_page.dart';
|
import 'package:mymuseum_visitapp/Screens/Sections/Video/video_page.dart';
|
||||||
import 'package:mymuseum_visitapp/Screens/Sections/Weather/weather_page.dart';
|
import 'package:mymuseum_visitapp/Screens/Sections/Weather/weather_page.dart';
|
||||||
import 'package:mymuseum_visitapp/Screens/Sections/Web/web_page.dart';
|
import 'package:mymuseum_visitapp/Screens/Sections/Web/web_page.dart';
|
||||||
import 'package:mymuseum_visitapp/Services/statisticsService.dart';
|
|
||||||
import 'package:mymuseum_visitapp/app_context.dart';
|
import 'package:mymuseum_visitapp/app_context.dart';
|
||||||
import 'package:mymuseum_visitapp/client.dart';
|
import 'package:mymuseum_visitapp/client.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
@ -130,13 +127,13 @@ class _SectionPageState extends State<SectionPage> {
|
|||||||
);
|
);
|
||||||
case SectionType.Menu:
|
case SectionType.Menu:
|
||||||
MenuDTO menuDTO = MenuDTO.fromJson(sectionResult)!;
|
MenuDTO menuDTO = MenuDTO.fromJson(sectionResult)!;
|
||||||
return MenuPage(section: menuDTO, isImageBackground: widget.configuration.isSectionImageBackground!);
|
return MenuPage(section: menuDTO, isImageBackground: visitAppContext.currentAppConfigurationLink?.isSectionImageBackground ?? false);
|
||||||
case SectionType.Pdf:
|
case SectionType.Pdf:
|
||||||
PdfDTO pdfDTO = PdfDTO.fromJson(sectionResult)!;
|
PdfDTO pdfDTO = PdfDTO.fromJson(sectionResult)!;
|
||||||
return PDFPage(section: pdfDTO);
|
return PDFPage(section: pdfDTO);
|
||||||
case SectionType.Puzzle:
|
case SectionType.Game:
|
||||||
PuzzleDTO puzzleDTO = PuzzleDTO.fromJson(sectionResult)!;
|
GameDTO gameDTO = GameDTO.fromJson(sectionResult)!;
|
||||||
return PuzzlePage(section: puzzleDTO);
|
return GamePage(section: gameDTO);
|
||||||
case SectionType.Quiz:
|
case SectionType.Quiz:
|
||||||
QuizDTO quizDTO = QuizDTO.fromJson(sectionResult)!;
|
QuizDTO quizDTO = QuizDTO.fromJson(sectionResult)!;
|
||||||
return QuizPage(
|
return QuizPage(
|
||||||
|
|||||||
@ -45,7 +45,7 @@ class ApiService {
|
|||||||
bool isOnline = await hasNetwork();
|
bool isOnline = await hasNetwork();
|
||||||
if(isOnline) {
|
if(isOnline) {
|
||||||
final rawList = await client.sectionApi!.sectionGetFromConfigurationDetail(configurationId);
|
final rawList = await client.sectionApi!.sectionGetFromConfigurationDetail(configurationId);
|
||||||
var sections = rawList.map((json) => SectionDTO.fromJson(json)).toList();
|
var sections = rawList?.map((json) => SectionDTO.fromJson(json)).toList();
|
||||||
return rawList ?? [];
|
return rawList ?? [];
|
||||||
} else {
|
} else {
|
||||||
return []; // TODO return local list..
|
return []; // TODO return local list..
|
||||||
|
|||||||
@ -34,10 +34,9 @@ class Client {
|
|||||||
StatsApi? _statsApi;
|
StatsApi? _statsApi;
|
||||||
StatsApi? get statsApi => _statsApi;
|
StatsApi? get statsApi => _statsApi;
|
||||||
|
|
||||||
Client(String path) {
|
Client(String path, {String? apiKey}) {
|
||||||
_apiClient = ApiClient(
|
_apiClient = ApiClient(basePath: path);
|
||||||
basePath: path); // "http://192.168.31.96"
|
if (apiKey != null) _apiClient!.addDefaultHeader('X-Api-Key', apiKey);
|
||||||
//basePath: "https://localhost:44339");
|
|
||||||
_authenticationApi = AuthenticationApi(_apiClient);
|
_authenticationApi = AuthenticationApi(_apiClient);
|
||||||
_userApi = UserApi(_apiClient);
|
_userApi = UserApi(_apiClient);
|
||||||
_configurationApi = ConfigurationApi(_apiClient);
|
_configurationApi = ConfigurationApi(_apiClient);
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
// API configuration
|
||||||
|
const kApiBaseUrl = 'http://192.168.31.228:5000'; // Replace with production URL
|
||||||
|
const kInstancePinCode = ''; // TODO: fill in the instance PIN code
|
||||||
|
const kInstanceId = '63514fd67ed8c735aaa4b8f2'; // TODO: fill in the instance ID
|
||||||
|
|
||||||
// Colors - TO FILL WITH CORRECT COLOR
|
// Colors - TO FILL WITH CORRECT COLOR
|
||||||
const kBackgroundColor = Color(0xFFFFFFFF);
|
const kBackgroundColor = Color(0xFFFFFFFF);
|
||||||
const kMainColor = Color(0xFF306bac);
|
const kMainColor = Color(0xFF306bac);
|
||||||
|
|||||||
@ -1,24 +1,25 @@
|
|||||||
//import 'package:audioplayers/audioplayers.dart';
|
//import 'package:audioplayers/audioplayers.dart';
|
||||||
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
// TODO // import 'package:flutter_beacon/flutter_beacon.dart';
|
// TODO // import 'package:flutter_beacon/flutter_beacon.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:mapbox_maps_flutter/mapbox_maps_flutter.dart';
|
import 'package:mapbox_maps_flutter/mapbox_maps_flutter.dart';
|
||||||
import 'package:mymuseum_visitapp/Helpers/requirement_state_controller.dart';
|
import 'package:mymuseum_visitapp/Helpers/requirement_state_controller.dart';
|
||||||
import 'package:mymuseum_visitapp/Models/articleRead.dart';
|
import 'package:mymuseum_visitapp/Models/articleRead.dart';
|
||||||
import 'package:mymuseum_visitapp/Screens/Home/home.dart';
|
|
||||||
import 'package:mymuseum_visitapp/Screens/Home/home_3.0.dart';
|
import 'package:mymuseum_visitapp/Screens/Home/home_3.0.dart';
|
||||||
import 'package:mymuseum_visitapp/l10n/app_localizations.dart';
|
import 'package:mymuseum_visitapp/l10n/app_localizations.dart';
|
||||||
|
import 'package:path_provider/path_provider.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'Helpers/DatabaseHelper.dart';
|
import 'Helpers/DatabaseHelper.dart';
|
||||||
import 'Models/visitContext.dart';
|
import 'Models/visitContext.dart';
|
||||||
import 'app_context.dart';
|
import 'app_context.dart';
|
||||||
|
import 'client.dart';
|
||||||
import 'constants.dart';
|
import 'constants.dart';
|
||||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
import 'l10n/app_localizations.dart';
|
|
||||||
import 'package:path_provider/path_provider.dart';
|
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
@ -37,7 +38,7 @@ void main() async {
|
|||||||
List<SectionRead> articleReadTest = List<SectionRead>.from(await DatabaseHelper.instance.getData(DatabaseTableType.articleRead));
|
List<SectionRead> articleReadTest = List<SectionRead>.from(await DatabaseHelper.instance.getData(DatabaseTableType.articleRead));
|
||||||
localContext.readSections = articleReadTest;
|
localContext.readSections = articleReadTest;
|
||||||
} else {
|
} else {
|
||||||
localContext = VisitAppContext(language: "FR", id: "UserId_Init", instanceId: "63514fd67ed8c735aaa4b8f2", isAdmin: false, isAllLanguages: false); // 63514fd67ed8c735aaa4b8f2 MyInfoMate test instance -- 633ee379d9405f32f166f047 MyMuseum Fort Saint-Héribert - MyMuseum instance 63514fd67ed8c735aaa4b8f1 // MDLF instance 65ccc67265373befd15be511
|
localContext = VisitAppContext(language: "FR", id: "UserId_Init", instanceId: kInstanceId, isAdmin: false, isAllLanguages: false);
|
||||||
DatabaseHelper.instance.insert(DatabaseTableType.main, localContext.toMap());
|
DatabaseHelper.instance.insert(DatabaseTableType.main, localContext.toMap());
|
||||||
|
|
||||||
List<SectionRead> articleReadTest = List<SectionRead>.from(await DatabaseHelper.instance.getData(DatabaseTableType.articleRead));
|
List<SectionRead> articleReadTest = List<SectionRead>.from(await DatabaseHelper.instance.getData(DatabaseTableType.articleRead));
|
||||||
@ -47,6 +48,23 @@ void main() async {
|
|||||||
print("NO LOCAL DB !");
|
print("NO LOCAL DB !");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bootstrap API key if not yet stored
|
||||||
|
if (localContext.apiKey == null && kInstancePinCode.isNotEmpty) {
|
||||||
|
try {
|
||||||
|
final resp = await http.get(Uri.parse(
|
||||||
|
'$kApiBaseUrl/api/instance/app-key?pinCode=$kInstancePinCode&appType=VisitApp'));
|
||||||
|
if (resp.statusCode == 200) {
|
||||||
|
localContext.apiKey = jsonDecode(resp.body)['key'] as String?;
|
||||||
|
DatabaseHelper.instance.updateTableMain(DatabaseTableType.main, localContext);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
print('Bootstrap apiKey failed: $e');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Always initialize clientAPI with the current apiKey
|
||||||
|
localContext.clientAPI = Client(kApiBaseUrl, apiKey: localContext.apiKey);
|
||||||
|
|
||||||
localContext.localPath = localPath;
|
localContext.localPath = localPath;
|
||||||
print("Local path $localPath");
|
print("Local path $localPath");
|
||||||
|
|
||||||
|
|||||||
@ -91,6 +91,19 @@ part 'model/user_detail_dto.dart';
|
|||||||
part 'model/video_dto.dart';
|
part 'model/video_dto.dart';
|
||||||
part 'model/weather_dto.dart';
|
part 'model/weather_dto.dart';
|
||||||
part 'model/web_dto.dart';
|
part 'model/web_dto.dart';
|
||||||
|
part 'model/map_annotation.dart';
|
||||||
|
part 'model/programme_block.dart';
|
||||||
|
part 'model/app_configuration_link_configuration.dart';
|
||||||
|
part 'model/app_configuration_link_device.dart';
|
||||||
|
part 'model/app_configuration_link.dart';
|
||||||
|
part 'model/app_configuration_link_application_instance.dart';
|
||||||
|
part 'model/app_type.dart';
|
||||||
|
part 'model/layout_main_page_type.dart';
|
||||||
|
part 'model/application_instance_dto.dart';
|
||||||
|
part 'model/application_instance_dto_section_event_dto.dart';
|
||||||
|
part 'model/application_instance_section_event.dart';
|
||||||
|
part 'model/section_event.dart';
|
||||||
|
part 'model/section_event_dto.dart';
|
||||||
|
|
||||||
/// An [ApiClient] instance that uses the default values obtained from
|
/// An [ApiClient] instance that uses the default values obtained from
|
||||||
/// the OpenAPI specification file.
|
/// the OpenAPI specification file.
|
||||||
|
|||||||
369
manager_api_new/lib/model/app_configuration_link.dart
Normal file
369
manager_api_new/lib/model/app_configuration_link.dart
Normal file
@ -0,0 +1,369 @@
|
|||||||
|
//
|
||||||
|
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||||
|
//
|
||||||
|
// @dart=2.18
|
||||||
|
|
||||||
|
// ignore_for_file: unused_element, unused_import
|
||||||
|
// ignore_for_file: always_put_required_named_parameters_first
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: lines_longer_than_80_chars
|
||||||
|
|
||||||
|
part of openapi.api;
|
||||||
|
|
||||||
|
class AppConfigurationLink {
|
||||||
|
/// Returns a new [AppConfigurationLink] instance.
|
||||||
|
AppConfigurationLink({
|
||||||
|
required this.configurationId,
|
||||||
|
required this.applicationInstanceId,
|
||||||
|
this.id,
|
||||||
|
this.order,
|
||||||
|
this.isActive,
|
||||||
|
this.weightMasonryGrid,
|
||||||
|
this.isDate,
|
||||||
|
this.isHour,
|
||||||
|
this.roundedValue,
|
||||||
|
this.screenPercentageSectionsMainPage,
|
||||||
|
this.isSectionImageBackground,
|
||||||
|
this.layoutMainPage,
|
||||||
|
this.loaderImageId,
|
||||||
|
this.loaderImageUrl,
|
||||||
|
this.primaryColor,
|
||||||
|
this.secondaryColor,
|
||||||
|
this.configuration,
|
||||||
|
this.applicationInstance,
|
||||||
|
this.deviceId,
|
||||||
|
this.device,
|
||||||
|
});
|
||||||
|
|
||||||
|
String configurationId;
|
||||||
|
|
||||||
|
String applicationInstanceId;
|
||||||
|
|
||||||
|
String? id;
|
||||||
|
|
||||||
|
int? order;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isActive;
|
||||||
|
|
||||||
|
int? weightMasonryGrid;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isDate;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isHour;
|
||||||
|
|
||||||
|
int? roundedValue;
|
||||||
|
|
||||||
|
int? screenPercentageSectionsMainPage;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isSectionImageBackground;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
LayoutMainPageType? layoutMainPage;
|
||||||
|
|
||||||
|
String? loaderImageId;
|
||||||
|
|
||||||
|
String? loaderImageUrl;
|
||||||
|
|
||||||
|
String? primaryColor;
|
||||||
|
|
||||||
|
String? secondaryColor;
|
||||||
|
|
||||||
|
AppConfigurationLinkConfiguration? configuration;
|
||||||
|
|
||||||
|
AppConfigurationLinkApplicationInstance? applicationInstance;
|
||||||
|
|
||||||
|
String? deviceId;
|
||||||
|
|
||||||
|
AppConfigurationLinkDevice? device;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is AppConfigurationLink &&
|
||||||
|
other.configurationId == configurationId &&
|
||||||
|
other.applicationInstanceId == applicationInstanceId &&
|
||||||
|
other.id == id &&
|
||||||
|
other.order == order &&
|
||||||
|
other.isActive == isActive &&
|
||||||
|
other.weightMasonryGrid == weightMasonryGrid &&
|
||||||
|
other.isDate == isDate &&
|
||||||
|
other.isHour == isHour &&
|
||||||
|
other.roundedValue == roundedValue &&
|
||||||
|
other.screenPercentageSectionsMainPage ==
|
||||||
|
screenPercentageSectionsMainPage &&
|
||||||
|
other.isSectionImageBackground == isSectionImageBackground &&
|
||||||
|
other.layoutMainPage == layoutMainPage &&
|
||||||
|
other.loaderImageId == loaderImageId &&
|
||||||
|
other.loaderImageUrl == loaderImageUrl &&
|
||||||
|
other.primaryColor == primaryColor &&
|
||||||
|
other.secondaryColor == secondaryColor &&
|
||||||
|
other.configuration == configuration &&
|
||||||
|
other.applicationInstance == applicationInstance &&
|
||||||
|
other.deviceId == deviceId &&
|
||||||
|
other.device == device;
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode =>
|
||||||
|
// ignore: unnecessary_parenthesis
|
||||||
|
(configurationId.hashCode) +
|
||||||
|
(applicationInstanceId.hashCode) +
|
||||||
|
(id == null ? 0 : id!.hashCode) +
|
||||||
|
(order == null ? 0 : order!.hashCode) +
|
||||||
|
(isActive == null ? 0 : isActive!.hashCode) +
|
||||||
|
(weightMasonryGrid == null ? 0 : weightMasonryGrid!.hashCode) +
|
||||||
|
(isDate == null ? 0 : isDate!.hashCode) +
|
||||||
|
(isHour == null ? 0 : isHour!.hashCode) +
|
||||||
|
(roundedValue == null ? 0 : roundedValue!.hashCode) +
|
||||||
|
(screenPercentageSectionsMainPage == null
|
||||||
|
? 0
|
||||||
|
: screenPercentageSectionsMainPage!.hashCode) +
|
||||||
|
(isSectionImageBackground == null
|
||||||
|
? 0
|
||||||
|
: isSectionImageBackground!.hashCode) +
|
||||||
|
(layoutMainPage == null ? 0 : layoutMainPage!.hashCode) +
|
||||||
|
(loaderImageId == null ? 0 : loaderImageId!.hashCode) +
|
||||||
|
(loaderImageUrl == null ? 0 : loaderImageUrl!.hashCode) +
|
||||||
|
(primaryColor == null ? 0 : primaryColor!.hashCode) +
|
||||||
|
(secondaryColor == null ? 0 : secondaryColor!.hashCode) +
|
||||||
|
(configuration == null ? 0 : configuration!.hashCode) +
|
||||||
|
(applicationInstance == null ? 0 : applicationInstance!.hashCode) +
|
||||||
|
(deviceId == null ? 0 : deviceId!.hashCode) +
|
||||||
|
(device == null ? 0 : device!.hashCode);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() =>
|
||||||
|
'AppConfigurationLink[configurationId=$configurationId, applicationInstanceId=$applicationInstanceId, id=$id, order=$order, isActive=$isActive, weightMasonryGrid=$weightMasonryGrid, isDate=$isDate, isHour=$isHour, roundedValue=$roundedValue, screenPercentageSectionsMainPage=$screenPercentageSectionsMainPage, isSectionImageBackground=$isSectionImageBackground, layoutMainPage=$layoutMainPage, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, primaryColor=$primaryColor, secondaryColor=$secondaryColor, configuration=$configuration, applicationInstance=$applicationInstance, deviceId=$deviceId, device=$device]';
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final json = <String, dynamic>{};
|
||||||
|
json[r'configurationId'] = this.configurationId;
|
||||||
|
json[r'applicationInstanceId'] = this.applicationInstanceId;
|
||||||
|
if (this.id != null) {
|
||||||
|
json[r'id'] = this.id;
|
||||||
|
} else {
|
||||||
|
json[r'id'] = null;
|
||||||
|
}
|
||||||
|
if (this.order != null) {
|
||||||
|
json[r'order'] = this.order;
|
||||||
|
} else {
|
||||||
|
json[r'order'] = null;
|
||||||
|
}
|
||||||
|
if (this.isActive != null) {
|
||||||
|
json[r'isActive'] = this.isActive;
|
||||||
|
} else {
|
||||||
|
json[r'isActive'] = null;
|
||||||
|
}
|
||||||
|
if (this.weightMasonryGrid != null) {
|
||||||
|
json[r'weightMasonryGrid'] = this.weightMasonryGrid;
|
||||||
|
} else {
|
||||||
|
json[r'weightMasonryGrid'] = null;
|
||||||
|
}
|
||||||
|
if (this.isDate != null) {
|
||||||
|
json[r'isDate'] = this.isDate;
|
||||||
|
} else {
|
||||||
|
json[r'isDate'] = null;
|
||||||
|
}
|
||||||
|
if (this.isHour != null) {
|
||||||
|
json[r'isHour'] = this.isHour;
|
||||||
|
} else {
|
||||||
|
json[r'isHour'] = null;
|
||||||
|
}
|
||||||
|
if (this.roundedValue != null) {
|
||||||
|
json[r'roundedValue'] = this.roundedValue;
|
||||||
|
} else {
|
||||||
|
json[r'roundedValue'] = null;
|
||||||
|
}
|
||||||
|
if (this.screenPercentageSectionsMainPage != null) {
|
||||||
|
json[r'screenPercentageSectionsMainPage'] =
|
||||||
|
this.screenPercentageSectionsMainPage;
|
||||||
|
} else {
|
||||||
|
json[r'screenPercentageSectionsMainPage'] = null;
|
||||||
|
}
|
||||||
|
if (this.isSectionImageBackground != null) {
|
||||||
|
json[r'isSectionImageBackground'] = this.isSectionImageBackground;
|
||||||
|
} else {
|
||||||
|
json[r'isSectionImageBackground'] = null;
|
||||||
|
}
|
||||||
|
if (this.layoutMainPage != null) {
|
||||||
|
json[r'layoutMainPage'] = this.layoutMainPage;
|
||||||
|
} else {
|
||||||
|
json[r'layoutMainPage'] = null;
|
||||||
|
}
|
||||||
|
if (this.loaderImageId != null) {
|
||||||
|
json[r'loaderImageId'] = this.loaderImageId;
|
||||||
|
} else {
|
||||||
|
json[r'loaderImageId'] = null;
|
||||||
|
}
|
||||||
|
if (this.loaderImageUrl != null) {
|
||||||
|
json[r'loaderImageUrl'] = this.loaderImageUrl;
|
||||||
|
} else {
|
||||||
|
json[r'loaderImageUrl'] = null;
|
||||||
|
}
|
||||||
|
if (this.primaryColor != null) {
|
||||||
|
json[r'primaryColor'] = this.primaryColor;
|
||||||
|
} else {
|
||||||
|
json[r'primaryColor'] = null;
|
||||||
|
}
|
||||||
|
if (this.secondaryColor != null) {
|
||||||
|
json[r'secondaryColor'] = this.secondaryColor;
|
||||||
|
} else {
|
||||||
|
json[r'secondaryColor'] = null;
|
||||||
|
}
|
||||||
|
if (this.configuration != null) {
|
||||||
|
json[r'configuration'] = this.configuration;
|
||||||
|
} else {
|
||||||
|
json[r'configuration'] = null;
|
||||||
|
}
|
||||||
|
if (this.applicationInstance != null) {
|
||||||
|
json[r'applicationInstance'] = this.applicationInstance;
|
||||||
|
} else {
|
||||||
|
json[r'applicationInstance'] = null;
|
||||||
|
}
|
||||||
|
if (this.deviceId != null) {
|
||||||
|
json[r'deviceId'] = this.deviceId;
|
||||||
|
} else {
|
||||||
|
json[r'deviceId'] = null;
|
||||||
|
}
|
||||||
|
if (this.device != null) {
|
||||||
|
json[r'device'] = this.device;
|
||||||
|
} else {
|
||||||
|
json[r'device'] = null;
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns a new [AppConfigurationLink] instance and imports its values from
|
||||||
|
/// [value] if it's a [Map], null otherwise.
|
||||||
|
// ignore: prefer_constructors_over_static_methods
|
||||||
|
static AppConfigurationLink? fromJson(dynamic value) {
|
||||||
|
if (value is Map) {
|
||||||
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
requiredKeys.forEach((key) {
|
||||||
|
assert(json.containsKey(key),
|
||||||
|
'Required key "AppConfigurationLink[$key]" is missing from JSON.');
|
||||||
|
assert(json[key] != null,
|
||||||
|
'Required key "AppConfigurationLink[$key]" has a null value in JSON.');
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
|
return AppConfigurationLink(
|
||||||
|
configurationId: mapValueOfType<String>(json, r'configurationId')!,
|
||||||
|
applicationInstanceId:
|
||||||
|
mapValueOfType<String>(json, r'applicationInstanceId')!,
|
||||||
|
id: mapValueOfType<String>(json, r'id'),
|
||||||
|
order: mapValueOfType<int>(json, r'order'),
|
||||||
|
isActive: mapValueOfType<bool>(json, r'isActive'),
|
||||||
|
weightMasonryGrid: mapValueOfType<int>(json, r'weightMasonryGrid'),
|
||||||
|
isDate: mapValueOfType<bool>(json, r'isDate'),
|
||||||
|
isHour: mapValueOfType<bool>(json, r'isHour'),
|
||||||
|
roundedValue: mapValueOfType<int>(json, r'roundedValue'),
|
||||||
|
screenPercentageSectionsMainPage:
|
||||||
|
mapValueOfType<int>(json, r'screenPercentageSectionsMainPage'),
|
||||||
|
isSectionImageBackground:
|
||||||
|
mapValueOfType<bool>(json, r'isSectionImageBackground'),
|
||||||
|
layoutMainPage: LayoutMainPageType.fromJson(json[r'layoutMainPage']),
|
||||||
|
loaderImageId: mapValueOfType<String>(json, r'loaderImageId'),
|
||||||
|
loaderImageUrl: mapValueOfType<String>(json, r'loaderImageUrl'),
|
||||||
|
primaryColor: mapValueOfType<String>(json, r'primaryColor'),
|
||||||
|
secondaryColor: mapValueOfType<String>(json, r'secondaryColor'),
|
||||||
|
configuration:
|
||||||
|
AppConfigurationLinkConfiguration.fromJson(json[r'configuration']),
|
||||||
|
applicationInstance: AppConfigurationLinkApplicationInstance.fromJson(
|
||||||
|
json[r'applicationInstance']),
|
||||||
|
deviceId: mapValueOfType<String>(json, r'deviceId'),
|
||||||
|
device: AppConfigurationLinkDevice.fromJson(json[r'device']),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
static List<AppConfigurationLink> listFromJson(
|
||||||
|
dynamic json, {
|
||||||
|
bool growable = false,
|
||||||
|
}) {
|
||||||
|
final result = <AppConfigurationLink>[];
|
||||||
|
if (json is List && json.isNotEmpty) {
|
||||||
|
for (final row in json) {
|
||||||
|
final value = AppConfigurationLink.fromJson(row);
|
||||||
|
if (value != null) {
|
||||||
|
result.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.toList(growable: growable);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Map<String, AppConfigurationLink> mapFromJson(dynamic json) {
|
||||||
|
final map = <String, AppConfigurationLink>{};
|
||||||
|
if (json is Map && json.isNotEmpty) {
|
||||||
|
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||||
|
for (final entry in json.entries) {
|
||||||
|
final value = AppConfigurationLink.fromJson(entry.value);
|
||||||
|
if (value != null) {
|
||||||
|
map[entry.key] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
// maps a json object with a list of AppConfigurationLink-objects as value to a dart map
|
||||||
|
static Map<String, List<AppConfigurationLink>> mapListFromJson(
|
||||||
|
dynamic json, {
|
||||||
|
bool growable = false,
|
||||||
|
}) {
|
||||||
|
final map = <String, List<AppConfigurationLink>>{};
|
||||||
|
if (json is Map && json.isNotEmpty) {
|
||||||
|
// ignore: parameter_assignments
|
||||||
|
json = json.cast<String, dynamic>();
|
||||||
|
for (final entry in json.entries) {
|
||||||
|
map[entry.key] = AppConfigurationLink.listFromJson(
|
||||||
|
entry.value,
|
||||||
|
growable: growable,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The list of required keys that must be present in a JSON.
|
||||||
|
static const requiredKeys = <String>{
|
||||||
|
'configurationId',
|
||||||
|
'applicationInstanceId',
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,277 @@
|
|||||||
|
//
|
||||||
|
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||||
|
//
|
||||||
|
// @dart=2.18
|
||||||
|
|
||||||
|
// ignore_for_file: unused_element, unused_import
|
||||||
|
// ignore_for_file: always_put_required_named_parameters_first
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: lines_longer_than_80_chars
|
||||||
|
|
||||||
|
part of openapi.api;
|
||||||
|
|
||||||
|
class AppConfigurationLinkApplicationInstance {
|
||||||
|
/// Returns a new [AppConfigurationLinkApplicationInstance] instance.
|
||||||
|
AppConfigurationLinkApplicationInstance({
|
||||||
|
required this.instanceId,
|
||||||
|
required this.appType,
|
||||||
|
this.id,
|
||||||
|
this.configurations = const [],
|
||||||
|
this.mainImageId,
|
||||||
|
this.mainImageUrl,
|
||||||
|
this.loaderImageId,
|
||||||
|
this.loaderImageUrl,
|
||||||
|
this.primaryColor,
|
||||||
|
this.secondaryColor,
|
||||||
|
this.layoutMainPage,
|
||||||
|
this.languages = const [],
|
||||||
|
this.sectionEventId,
|
||||||
|
this.sectionEvent,
|
||||||
|
});
|
||||||
|
|
||||||
|
String instanceId;
|
||||||
|
|
||||||
|
AppType appType;
|
||||||
|
|
||||||
|
String? id;
|
||||||
|
|
||||||
|
List<AppConfigurationLink>? configurations;
|
||||||
|
|
||||||
|
String? mainImageId;
|
||||||
|
|
||||||
|
String? mainImageUrl;
|
||||||
|
|
||||||
|
String? loaderImageId;
|
||||||
|
|
||||||
|
String? loaderImageUrl;
|
||||||
|
|
||||||
|
String? primaryColor;
|
||||||
|
|
||||||
|
String? secondaryColor;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
LayoutMainPageType? layoutMainPage;
|
||||||
|
|
||||||
|
List<String>? languages;
|
||||||
|
|
||||||
|
String? sectionEventId;
|
||||||
|
|
||||||
|
ApplicationInstanceSectionEvent? sectionEvent;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is AppConfigurationLinkApplicationInstance &&
|
||||||
|
other.instanceId == instanceId &&
|
||||||
|
other.appType == appType &&
|
||||||
|
other.id == id &&
|
||||||
|
_deepEquality.equals(other.configurations, configurations) &&
|
||||||
|
other.mainImageId == mainImageId &&
|
||||||
|
other.mainImageUrl == mainImageUrl &&
|
||||||
|
other.loaderImageId == loaderImageId &&
|
||||||
|
other.loaderImageUrl == loaderImageUrl &&
|
||||||
|
other.primaryColor == primaryColor &&
|
||||||
|
other.secondaryColor == secondaryColor &&
|
||||||
|
other.layoutMainPage == layoutMainPage &&
|
||||||
|
_deepEquality.equals(other.languages, languages) &&
|
||||||
|
other.sectionEventId == sectionEventId &&
|
||||||
|
other.sectionEvent == sectionEvent;
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode =>
|
||||||
|
// ignore: unnecessary_parenthesis
|
||||||
|
(instanceId.hashCode) +
|
||||||
|
(appType.hashCode) +
|
||||||
|
(id == null ? 0 : id!.hashCode) +
|
||||||
|
(configurations == null ? 0 : configurations!.hashCode) +
|
||||||
|
(mainImageId == null ? 0 : mainImageId!.hashCode) +
|
||||||
|
(mainImageUrl == null ? 0 : mainImageUrl!.hashCode) +
|
||||||
|
(loaderImageId == null ? 0 : loaderImageId!.hashCode) +
|
||||||
|
(loaderImageUrl == null ? 0 : loaderImageUrl!.hashCode) +
|
||||||
|
(primaryColor == null ? 0 : primaryColor!.hashCode) +
|
||||||
|
(secondaryColor == null ? 0 : secondaryColor!.hashCode) +
|
||||||
|
(layoutMainPage == null ? 0 : layoutMainPage!.hashCode) +
|
||||||
|
(languages == null ? 0 : languages!.hashCode) +
|
||||||
|
(sectionEventId == null ? 0 : sectionEventId!.hashCode) +
|
||||||
|
(sectionEvent == null ? 0 : sectionEvent!.hashCode);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() =>
|
||||||
|
'AppConfigurationLinkApplicationInstance[instanceId=$instanceId, appType=$appType, id=$id, configurations=$configurations, mainImageId=$mainImageId, mainImageUrl=$mainImageUrl, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, primaryColor=$primaryColor, secondaryColor=$secondaryColor, layoutMainPage=$layoutMainPage, languages=$languages, sectionEventId=$sectionEventId, sectionEvent=$sectionEvent]';
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final json = <String, dynamic>{};
|
||||||
|
json[r'instanceId'] = this.instanceId;
|
||||||
|
json[r'appType'] = this.appType;
|
||||||
|
if (this.id != null) {
|
||||||
|
json[r'id'] = this.id;
|
||||||
|
} else {
|
||||||
|
json[r'id'] = null;
|
||||||
|
}
|
||||||
|
if (this.configurations != null) {
|
||||||
|
json[r'configurations'] = this.configurations;
|
||||||
|
} else {
|
||||||
|
json[r'configurations'] = null;
|
||||||
|
}
|
||||||
|
if (this.mainImageId != null) {
|
||||||
|
json[r'mainImageId'] = this.mainImageId;
|
||||||
|
} else {
|
||||||
|
json[r'mainImageId'] = null;
|
||||||
|
}
|
||||||
|
if (this.mainImageUrl != null) {
|
||||||
|
json[r'mainImageUrl'] = this.mainImageUrl;
|
||||||
|
} else {
|
||||||
|
json[r'mainImageUrl'] = null;
|
||||||
|
}
|
||||||
|
if (this.loaderImageId != null) {
|
||||||
|
json[r'loaderImageId'] = this.loaderImageId;
|
||||||
|
} else {
|
||||||
|
json[r'loaderImageId'] = null;
|
||||||
|
}
|
||||||
|
if (this.loaderImageUrl != null) {
|
||||||
|
json[r'loaderImageUrl'] = this.loaderImageUrl;
|
||||||
|
} else {
|
||||||
|
json[r'loaderImageUrl'] = null;
|
||||||
|
}
|
||||||
|
if (this.primaryColor != null) {
|
||||||
|
json[r'primaryColor'] = this.primaryColor;
|
||||||
|
} else {
|
||||||
|
json[r'primaryColor'] = null;
|
||||||
|
}
|
||||||
|
if (this.secondaryColor != null) {
|
||||||
|
json[r'secondaryColor'] = this.secondaryColor;
|
||||||
|
} else {
|
||||||
|
json[r'secondaryColor'] = null;
|
||||||
|
}
|
||||||
|
if (this.layoutMainPage != null) {
|
||||||
|
json[r'layoutMainPage'] = this.layoutMainPage;
|
||||||
|
} else {
|
||||||
|
json[r'layoutMainPage'] = null;
|
||||||
|
}
|
||||||
|
if (this.languages != null) {
|
||||||
|
json[r'languages'] = this.languages;
|
||||||
|
} else {
|
||||||
|
json[r'languages'] = null;
|
||||||
|
}
|
||||||
|
if (this.sectionEventId != null) {
|
||||||
|
json[r'sectionEventId'] = this.sectionEventId;
|
||||||
|
} else {
|
||||||
|
json[r'sectionEventId'] = null;
|
||||||
|
}
|
||||||
|
if (this.sectionEvent != null) {
|
||||||
|
json[r'sectionEvent'] = this.sectionEvent;
|
||||||
|
} else {
|
||||||
|
json[r'sectionEvent'] = null;
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns a new [AppConfigurationLinkApplicationInstance] instance and imports its values from
|
||||||
|
/// [value] if it's a [Map], null otherwise.
|
||||||
|
// ignore: prefer_constructors_over_static_methods
|
||||||
|
static AppConfigurationLinkApplicationInstance? fromJson(dynamic value) {
|
||||||
|
if (value is Map) {
|
||||||
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
requiredKeys.forEach((key) {
|
||||||
|
assert(json.containsKey(key),
|
||||||
|
'Required key "AppConfigurationLinkApplicationInstance[$key]" is missing from JSON.');
|
||||||
|
assert(json[key] != null,
|
||||||
|
'Required key "AppConfigurationLinkApplicationInstance[$key]" has a null value in JSON.');
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
|
return AppConfigurationLinkApplicationInstance(
|
||||||
|
instanceId: mapValueOfType<String>(json, r'instanceId')!,
|
||||||
|
appType: AppType.fromJson(json[r'appType'])!,
|
||||||
|
id: mapValueOfType<String>(json, r'id'),
|
||||||
|
configurations:
|
||||||
|
AppConfigurationLink.listFromJson(json[r'configurations']),
|
||||||
|
mainImageId: mapValueOfType<String>(json, r'mainImageId'),
|
||||||
|
mainImageUrl: mapValueOfType<String>(json, r'mainImageUrl'),
|
||||||
|
loaderImageId: mapValueOfType<String>(json, r'loaderImageId'),
|
||||||
|
loaderImageUrl: mapValueOfType<String>(json, r'loaderImageUrl'),
|
||||||
|
primaryColor: mapValueOfType<String>(json, r'primaryColor'),
|
||||||
|
secondaryColor: mapValueOfType<String>(json, r'secondaryColor'),
|
||||||
|
layoutMainPage: LayoutMainPageType.fromJson(json[r'layoutMainPage']),
|
||||||
|
languages: json[r'languages'] is Iterable
|
||||||
|
? (json[r'languages'] as Iterable)
|
||||||
|
.cast<String>()
|
||||||
|
.toList(growable: false)
|
||||||
|
: const [],
|
||||||
|
sectionEventId: mapValueOfType<String>(json, r'sectionEventId'),
|
||||||
|
sectionEvent:
|
||||||
|
ApplicationInstanceSectionEvent.fromJson(json[r'sectionEvent']),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
static List<AppConfigurationLinkApplicationInstance> listFromJson(
|
||||||
|
dynamic json, {
|
||||||
|
bool growable = false,
|
||||||
|
}) {
|
||||||
|
final result = <AppConfigurationLinkApplicationInstance>[];
|
||||||
|
if (json is List && json.isNotEmpty) {
|
||||||
|
for (final row in json) {
|
||||||
|
final value = AppConfigurationLinkApplicationInstance.fromJson(row);
|
||||||
|
if (value != null) {
|
||||||
|
result.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.toList(growable: growable);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Map<String, AppConfigurationLinkApplicationInstance> mapFromJson(
|
||||||
|
dynamic json) {
|
||||||
|
final map = <String, AppConfigurationLinkApplicationInstance>{};
|
||||||
|
if (json is Map && json.isNotEmpty) {
|
||||||
|
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||||
|
for (final entry in json.entries) {
|
||||||
|
final value =
|
||||||
|
AppConfigurationLinkApplicationInstance.fromJson(entry.value);
|
||||||
|
if (value != null) {
|
||||||
|
map[entry.key] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
// maps a json object with a list of AppConfigurationLinkApplicationInstance-objects as value to a dart map
|
||||||
|
static Map<String, List<AppConfigurationLinkApplicationInstance>>
|
||||||
|
mapListFromJson(
|
||||||
|
dynamic json, {
|
||||||
|
bool growable = false,
|
||||||
|
}) {
|
||||||
|
final map = <String, List<AppConfigurationLinkApplicationInstance>>{};
|
||||||
|
if (json is Map && json.isNotEmpty) {
|
||||||
|
// ignore: parameter_assignments
|
||||||
|
json = json.cast<String, dynamic>();
|
||||||
|
for (final entry in json.entries) {
|
||||||
|
map[entry.key] = AppConfigurationLinkApplicationInstance.listFromJson(
|
||||||
|
entry.value,
|
||||||
|
growable: growable,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The list of required keys that must be present in a JSON.
|
||||||
|
static const requiredKeys = <String>{
|
||||||
|
'instanceId',
|
||||||
|
'appType',
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
//
|
||||||
|
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||||
|
//
|
||||||
|
// @dart=2.18
|
||||||
|
|
||||||
|
// ignore_for_file: unused_element, unused_import
|
||||||
|
// ignore_for_file: always_put_required_named_parameters_first
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: lines_longer_than_80_chars
|
||||||
|
|
||||||
|
part of openapi.api;
|
||||||
|
|
||||||
|
class AppConfigurationLinkConfiguration {
|
||||||
|
AppConfigurationLinkConfiguration({this.id});
|
||||||
|
String? id;
|
||||||
|
|
||||||
|
static AppConfigurationLinkConfiguration? fromJson(dynamic value) =>
|
||||||
|
value is Map ? AppConfigurationLinkConfiguration() : null;
|
||||||
|
|
||||||
|
static const requiredKeys = <String>{};
|
||||||
|
}
|
||||||
21
manager_api_new/lib/model/app_configuration_link_device.dart
Normal file
21
manager_api_new/lib/model/app_configuration_link_device.dart
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
//
|
||||||
|
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||||
|
//
|
||||||
|
// @dart=2.18
|
||||||
|
|
||||||
|
// ignore_for_file: unused_element, unused_import
|
||||||
|
// ignore_for_file: always_put_required_named_parameters_first
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: lines_longer_than_80_chars
|
||||||
|
|
||||||
|
part of openapi.api;
|
||||||
|
|
||||||
|
class AppConfigurationLinkDevice {
|
||||||
|
AppConfigurationLinkDevice({this.id});
|
||||||
|
String? id;
|
||||||
|
|
||||||
|
static AppConfigurationLinkDevice? fromJson(dynamic value) =>
|
||||||
|
value is Map ? AppConfigurationLinkDevice() : null;
|
||||||
|
|
||||||
|
static const requiredKeys = <String>{};
|
||||||
|
}
|
||||||
110
manager_api_new/lib/model/app_type.dart
Normal file
110
manager_api_new/lib/model/app_type.dart
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
//
|
||||||
|
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||||
|
//
|
||||||
|
// @dart=2.18
|
||||||
|
|
||||||
|
// ignore_for_file: unused_element, unused_import
|
||||||
|
// ignore_for_file: always_put_required_named_parameters_first
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: lines_longer_than_80_chars
|
||||||
|
|
||||||
|
part of openapi.api;
|
||||||
|
|
||||||
|
/// 0 = Mobile 1 = Tablet 2 = Web 3 = VR
|
||||||
|
class AppType {
|
||||||
|
/// Instantiate a new enum with the provided [value].
|
||||||
|
const AppType._(this.value);
|
||||||
|
|
||||||
|
/// The underlying value of this enum member.
|
||||||
|
final int value;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => value.toString();
|
||||||
|
|
||||||
|
int toJson() => value;
|
||||||
|
|
||||||
|
static const Mobile = AppType._(0);
|
||||||
|
static const Tablet = AppType._(1);
|
||||||
|
static const Web = AppType._(2);
|
||||||
|
static const VR = AppType._(3);
|
||||||
|
|
||||||
|
/// List of all possible values in this [enum][AppType].
|
||||||
|
static const values = <AppType>[
|
||||||
|
Mobile,
|
||||||
|
Tablet,
|
||||||
|
Web,
|
||||||
|
VR,
|
||||||
|
];
|
||||||
|
|
||||||
|
static AppType? fromJson(dynamic value) =>
|
||||||
|
AppTypeTypeTransformer().decode(value);
|
||||||
|
|
||||||
|
static List<AppType> listFromJson(
|
||||||
|
dynamic json, {
|
||||||
|
bool growable = false,
|
||||||
|
}) {
|
||||||
|
final result = <AppType>[];
|
||||||
|
if (json is List && json.isNotEmpty) {
|
||||||
|
for (final row in json) {
|
||||||
|
final value = AppType.fromJson(row);
|
||||||
|
if (value != null) {
|
||||||
|
result.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.toList(growable: growable);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Transformation class that can [encode] an instance of [AppType] to int,
|
||||||
|
/// and [decode] dynamic data back to [AppType].
|
||||||
|
class AppTypeTypeTransformer {
|
||||||
|
factory AppTypeTypeTransformer() =>
|
||||||
|
_instance ??= const AppTypeTypeTransformer._();
|
||||||
|
|
||||||
|
const AppTypeTypeTransformer._();
|
||||||
|
|
||||||
|
int encode(AppType data) => data.value;
|
||||||
|
|
||||||
|
/// Decodes a [dynamic value][data] to a AppType.
|
||||||
|
///
|
||||||
|
/// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
|
||||||
|
/// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
|
||||||
|
/// cannot be decoded successfully, then an [UnimplementedError] is thrown.
|
||||||
|
///
|
||||||
|
/// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
|
||||||
|
/// and users are still using an old app with the old code.
|
||||||
|
AppType? decode(dynamic data, {bool allowNull = true}) {
|
||||||
|
if (data != null) {
|
||||||
|
if(data.runtimeType == String) {
|
||||||
|
switch (data.toString()) {
|
||||||
|
case r'Mobile': return AppType.Mobile;
|
||||||
|
case r'Tablet': return AppType.Tablet;
|
||||||
|
case r'Web': return AppType.Web;
|
||||||
|
case r'VR': return AppType.VR;
|
||||||
|
default:
|
||||||
|
if (!allowNull) {
|
||||||
|
throw ArgumentError('Unknown enum value to decode: $data');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(data.runtimeType == int) {
|
||||||
|
switch (data) {
|
||||||
|
case 0: return AppType.Mobile;
|
||||||
|
case 1: return AppType.Tablet;
|
||||||
|
case 2: return AppType.Web;
|
||||||
|
case 3: return AppType.VR;
|
||||||
|
default:
|
||||||
|
if (!allowNull) {
|
||||||
|
throw ArgumentError('Unknown enum value to decode: $data');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Singleton [AppTypeTypeTransformer] instance.
|
||||||
|
static AppTypeTypeTransformer? _instance;
|
||||||
|
}
|
||||||
295
manager_api_new/lib/model/application_instance_dto.dart
Normal file
295
manager_api_new/lib/model/application_instance_dto.dart
Normal file
@ -0,0 +1,295 @@
|
|||||||
|
//
|
||||||
|
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||||
|
//
|
||||||
|
// @dart=2.18
|
||||||
|
|
||||||
|
// ignore_for_file: unused_element, unused_import
|
||||||
|
// ignore_for_file: always_put_required_named_parameters_first
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: lines_longer_than_80_chars
|
||||||
|
|
||||||
|
part of openapi.api;
|
||||||
|
|
||||||
|
class ApplicationInstanceDTO {
|
||||||
|
/// Returns a new [ApplicationInstanceDTO] instance.
|
||||||
|
ApplicationInstanceDTO({
|
||||||
|
this.id,
|
||||||
|
this.instanceId,
|
||||||
|
this.appType,
|
||||||
|
this.configurations = const [],
|
||||||
|
this.mainImageId,
|
||||||
|
this.mainImageUrl,
|
||||||
|
this.loaderImageId,
|
||||||
|
this.loaderImageUrl,
|
||||||
|
this.primaryColor,
|
||||||
|
this.secondaryColor,
|
||||||
|
this.layoutMainPage,
|
||||||
|
this.languages = const [],
|
||||||
|
this.sectionEventId,
|
||||||
|
this.sectionEventDTO,
|
||||||
|
this.isAssistant,
|
||||||
|
});
|
||||||
|
|
||||||
|
String? id;
|
||||||
|
|
||||||
|
String? instanceId;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
AppType? appType;
|
||||||
|
|
||||||
|
List<AppConfigurationLink>? configurations;
|
||||||
|
|
||||||
|
String? mainImageId;
|
||||||
|
|
||||||
|
String? mainImageUrl;
|
||||||
|
|
||||||
|
String? loaderImageId;
|
||||||
|
|
||||||
|
String? loaderImageUrl;
|
||||||
|
|
||||||
|
String? primaryColor;
|
||||||
|
|
||||||
|
String? secondaryColor;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
LayoutMainPageType? layoutMainPage;
|
||||||
|
|
||||||
|
List<String>? languages;
|
||||||
|
|
||||||
|
String? sectionEventId;
|
||||||
|
|
||||||
|
SectionEventDTO? sectionEventDTO;
|
||||||
|
|
||||||
|
bool? isAssistant;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is ApplicationInstanceDTO &&
|
||||||
|
other.id == id &&
|
||||||
|
other.instanceId == instanceId &&
|
||||||
|
other.appType == appType &&
|
||||||
|
_deepEquality.equals(other.configurations, configurations) &&
|
||||||
|
other.mainImageId == mainImageId &&
|
||||||
|
other.mainImageUrl == mainImageUrl &&
|
||||||
|
other.loaderImageId == loaderImageId &&
|
||||||
|
other.loaderImageUrl == loaderImageUrl &&
|
||||||
|
other.primaryColor == primaryColor &&
|
||||||
|
other.secondaryColor == secondaryColor &&
|
||||||
|
other.layoutMainPage == layoutMainPage &&
|
||||||
|
_deepEquality.equals(other.languages, languages) &&
|
||||||
|
other.sectionEventId == sectionEventId &&
|
||||||
|
other.sectionEventDTO == sectionEventDTO &&
|
||||||
|
other.isAssistant == isAssistant;
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode =>
|
||||||
|
// ignore: unnecessary_parenthesis
|
||||||
|
(id == null ? 0 : id!.hashCode) +
|
||||||
|
(instanceId == null ? 0 : instanceId!.hashCode) +
|
||||||
|
(appType == null ? 0 : appType!.hashCode) +
|
||||||
|
(configurations == null ? 0 : configurations!.hashCode) +
|
||||||
|
(mainImageId == null ? 0 : mainImageId!.hashCode) +
|
||||||
|
(mainImageUrl == null ? 0 : mainImageUrl!.hashCode) +
|
||||||
|
(loaderImageId == null ? 0 : loaderImageId!.hashCode) +
|
||||||
|
(loaderImageUrl == null ? 0 : loaderImageUrl!.hashCode) +
|
||||||
|
(primaryColor == null ? 0 : primaryColor!.hashCode) +
|
||||||
|
(secondaryColor == null ? 0 : secondaryColor!.hashCode) +
|
||||||
|
(layoutMainPage == null ? 0 : layoutMainPage!.hashCode) +
|
||||||
|
(languages == null ? 0 : languages!.hashCode) +
|
||||||
|
(sectionEventId == null ? 0 : sectionEventId!.hashCode) +
|
||||||
|
(sectionEventDTO == null ? 0 : sectionEventDTO!.hashCode) +
|
||||||
|
(isAssistant == null ? 0 : isAssistant!.hashCode);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() =>
|
||||||
|
'ApplicationInstanceDTO[id=$id, instanceId=$instanceId, appType=$appType, configurations=$configurations, mainImageId=$mainImageId, mainImageUrl=$mainImageUrl, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, primaryColor=$primaryColor, secondaryColor=$secondaryColor, layoutMainPage=$layoutMainPage, languages=$languages, sectionEventId=$sectionEventId, sectionEventDTO=$sectionEventDTO, isAssistant=$isAssistant]';
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final json = <String, dynamic>{};
|
||||||
|
if (this.id != null) {
|
||||||
|
json[r'id'] = this.id;
|
||||||
|
} else {
|
||||||
|
json[r'id'] = null;
|
||||||
|
}
|
||||||
|
if (this.instanceId != null) {
|
||||||
|
json[r'instanceId'] = this.instanceId;
|
||||||
|
} else {
|
||||||
|
json[r'instanceId'] = null;
|
||||||
|
}
|
||||||
|
if (this.appType != null) {
|
||||||
|
json[r'appType'] = this.appType;
|
||||||
|
} else {
|
||||||
|
json[r'appType'] = null;
|
||||||
|
}
|
||||||
|
if (this.configurations != null) {
|
||||||
|
json[r'configurations'] = this.configurations;
|
||||||
|
} else {
|
||||||
|
json[r'configurations'] = null;
|
||||||
|
}
|
||||||
|
if (this.mainImageId != null) {
|
||||||
|
json[r'mainImageId'] = this.mainImageId;
|
||||||
|
} else {
|
||||||
|
json[r'mainImageId'] = null;
|
||||||
|
}
|
||||||
|
if (this.mainImageUrl != null) {
|
||||||
|
json[r'mainImageUrl'] = this.mainImageUrl;
|
||||||
|
} else {
|
||||||
|
json[r'mainImageUrl'] = null;
|
||||||
|
}
|
||||||
|
if (this.loaderImageId != null) {
|
||||||
|
json[r'loaderImageId'] = this.loaderImageId;
|
||||||
|
} else {
|
||||||
|
json[r'loaderImageId'] = null;
|
||||||
|
}
|
||||||
|
if (this.loaderImageUrl != null) {
|
||||||
|
json[r'loaderImageUrl'] = this.loaderImageUrl;
|
||||||
|
} else {
|
||||||
|
json[r'loaderImageUrl'] = null;
|
||||||
|
}
|
||||||
|
if (this.primaryColor != null) {
|
||||||
|
json[r'primaryColor'] = this.primaryColor;
|
||||||
|
} else {
|
||||||
|
json[r'primaryColor'] = null;
|
||||||
|
}
|
||||||
|
if (this.secondaryColor != null) {
|
||||||
|
json[r'secondaryColor'] = this.secondaryColor;
|
||||||
|
} else {
|
||||||
|
json[r'secondaryColor'] = null;
|
||||||
|
}
|
||||||
|
if (this.layoutMainPage != null) {
|
||||||
|
json[r'layoutMainPage'] = this.layoutMainPage;
|
||||||
|
} else {
|
||||||
|
json[r'layoutMainPage'] = null;
|
||||||
|
}
|
||||||
|
if (this.languages != null) {
|
||||||
|
json[r'languages'] = this.languages;
|
||||||
|
} else {
|
||||||
|
json[r'languages'] = null;
|
||||||
|
}
|
||||||
|
if (this.sectionEventId != null) {
|
||||||
|
json[r'sectionEventId'] = this.sectionEventId;
|
||||||
|
} else {
|
||||||
|
json[r'sectionEventId'] = null;
|
||||||
|
}
|
||||||
|
if (this.sectionEventDTO != null) {
|
||||||
|
json[r'sectionEventDTO'] = this.sectionEventDTO;
|
||||||
|
} else {
|
||||||
|
json[r'sectionEventDTO'] = null;
|
||||||
|
}
|
||||||
|
if (this.isAssistant != null) {
|
||||||
|
json[r'isAssistant'] = this.isAssistant;
|
||||||
|
} else {
|
||||||
|
json[r'isAssistant'] = null;
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns a new [ApplicationInstanceDTO] instance and imports its values from
|
||||||
|
/// [value] if it's a [Map], null otherwise.
|
||||||
|
// ignore: prefer_constructors_over_static_methods
|
||||||
|
static ApplicationInstanceDTO? fromJson(dynamic value) {
|
||||||
|
if (value is Map) {
|
||||||
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
requiredKeys.forEach((key) {
|
||||||
|
assert(json.containsKey(key),
|
||||||
|
'Required key "ApplicationInstanceDTO[$key]" is missing from JSON.');
|
||||||
|
assert(json[key] != null,
|
||||||
|
'Required key "ApplicationInstanceDTO[$key]" has a null value in JSON.');
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
|
return ApplicationInstanceDTO(
|
||||||
|
id: mapValueOfType<String>(json, r'id'),
|
||||||
|
instanceId: mapValueOfType<String>(json, r'instanceId'),
|
||||||
|
appType: AppType.fromJson(json[r'appType']),
|
||||||
|
configurations:
|
||||||
|
AppConfigurationLink.listFromJson(json[r'configurations']),
|
||||||
|
mainImageId: mapValueOfType<String>(json, r'mainImageId'),
|
||||||
|
mainImageUrl: mapValueOfType<String>(json, r'mainImageUrl'),
|
||||||
|
loaderImageId: mapValueOfType<String>(json, r'loaderImageId'),
|
||||||
|
loaderImageUrl: mapValueOfType<String>(json, r'loaderImageUrl'),
|
||||||
|
primaryColor: mapValueOfType<String>(json, r'primaryColor'),
|
||||||
|
secondaryColor: mapValueOfType<String>(json, r'secondaryColor'),
|
||||||
|
layoutMainPage: LayoutMainPageType.fromJson(json[r'layoutMainPage']),
|
||||||
|
languages: json[r'languages'] is Iterable
|
||||||
|
? (json[r'languages'] as Iterable)
|
||||||
|
.cast<String>()
|
||||||
|
.toList(growable: false)
|
||||||
|
: const [],
|
||||||
|
sectionEventId: mapValueOfType<String>(json, r'sectionEventId'),
|
||||||
|
sectionEventDTO: SectionEventDTO.fromJson(json[r'sectionEventDTO']),
|
||||||
|
isAssistant: mapValueOfType<bool>(json, r'isAssistant'),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
static List<ApplicationInstanceDTO> listFromJson(
|
||||||
|
dynamic json, {
|
||||||
|
bool growable = false,
|
||||||
|
}) {
|
||||||
|
final result = <ApplicationInstanceDTO>[];
|
||||||
|
if (json is List && json.isNotEmpty) {
|
||||||
|
for (final row in json) {
|
||||||
|
final value = ApplicationInstanceDTO.fromJson(row);
|
||||||
|
if (value != null) {
|
||||||
|
result.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.toList(growable: growable);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Map<String, ApplicationInstanceDTO> mapFromJson(dynamic json) {
|
||||||
|
final map = <String, ApplicationInstanceDTO>{};
|
||||||
|
if (json is Map && json.isNotEmpty) {
|
||||||
|
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||||
|
for (final entry in json.entries) {
|
||||||
|
final value = ApplicationInstanceDTO.fromJson(entry.value);
|
||||||
|
if (value != null) {
|
||||||
|
map[entry.key] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
// maps a json object with a list of ApplicationInstanceDTO-objects as value to a dart map
|
||||||
|
static Map<String, List<ApplicationInstanceDTO>> mapListFromJson(
|
||||||
|
dynamic json, {
|
||||||
|
bool growable = false,
|
||||||
|
}) {
|
||||||
|
final map = <String, List<ApplicationInstanceDTO>>{};
|
||||||
|
if (json is Map && json.isNotEmpty) {
|
||||||
|
// ignore: parameter_assignments
|
||||||
|
json = json.cast<String, dynamic>();
|
||||||
|
for (final entry in json.entries) {
|
||||||
|
map[entry.key] = ApplicationInstanceDTO.listFromJson(
|
||||||
|
entry.value,
|
||||||
|
growable: growable,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The list of required keys that must be present in a JSON.
|
||||||
|
static const requiredKeys = <String>{};
|
||||||
|
}
|
||||||
@ -0,0 +1,409 @@
|
|||||||
|
//
|
||||||
|
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||||
|
//
|
||||||
|
// @dart=2.18
|
||||||
|
|
||||||
|
// ignore_for_file: unused_element, unused_import
|
||||||
|
// ignore_for_file: always_put_required_named_parameters_first
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: lines_longer_than_80_chars
|
||||||
|
|
||||||
|
part of openapi.api;
|
||||||
|
|
||||||
|
class ApplicationInstanceDTOSectionEventDTO {
|
||||||
|
/// Returns a new [ApplicationInstanceDTOSectionEventDTO] instance.
|
||||||
|
ApplicationInstanceDTOSectionEventDTO({
|
||||||
|
this.id,
|
||||||
|
this.label,
|
||||||
|
this.title = const [],
|
||||||
|
this.description = const [],
|
||||||
|
this.isActive,
|
||||||
|
this.imageId,
|
||||||
|
this.imageSource,
|
||||||
|
this.configurationId,
|
||||||
|
this.isSubSection,
|
||||||
|
this.parentId,
|
||||||
|
this.type,
|
||||||
|
this.dateCreation,
|
||||||
|
this.order,
|
||||||
|
this.instanceId,
|
||||||
|
this.latitude,
|
||||||
|
this.longitude,
|
||||||
|
this.meterZoneGPS,
|
||||||
|
this.isBeacon,
|
||||||
|
this.beaconId,
|
||||||
|
this.startDate,
|
||||||
|
this.endDate,
|
||||||
|
this.parcoursIds = const [],
|
||||||
|
this.programme = const [],
|
||||||
|
});
|
||||||
|
|
||||||
|
String? id;
|
||||||
|
|
||||||
|
String? label;
|
||||||
|
|
||||||
|
List<TranslationDTO>? title;
|
||||||
|
|
||||||
|
List<TranslationDTO>? description;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isActive;
|
||||||
|
|
||||||
|
String? imageId;
|
||||||
|
|
||||||
|
String? imageSource;
|
||||||
|
|
||||||
|
String? configurationId;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isSubSection;
|
||||||
|
|
||||||
|
String? parentId;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
SectionType? type;
|
||||||
|
|
||||||
|
DateTime? dateCreation;
|
||||||
|
|
||||||
|
int? order;
|
||||||
|
|
||||||
|
String? instanceId;
|
||||||
|
|
||||||
|
String? latitude;
|
||||||
|
|
||||||
|
String? longitude;
|
||||||
|
|
||||||
|
int? meterZoneGPS;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isBeacon;
|
||||||
|
|
||||||
|
int? beaconId;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
DateTime? startDate;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
DateTime? endDate;
|
||||||
|
|
||||||
|
List<String>? parcoursIds;
|
||||||
|
|
||||||
|
List<ProgrammeBlock>? programme;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is ApplicationInstanceDTOSectionEventDTO &&
|
||||||
|
other.id == id &&
|
||||||
|
other.label == label &&
|
||||||
|
_deepEquality.equals(other.title, title) &&
|
||||||
|
_deepEquality.equals(other.description, description) &&
|
||||||
|
other.isActive == isActive &&
|
||||||
|
other.imageId == imageId &&
|
||||||
|
other.imageSource == imageSource &&
|
||||||
|
other.configurationId == configurationId &&
|
||||||
|
other.isSubSection == isSubSection &&
|
||||||
|
other.parentId == parentId &&
|
||||||
|
other.type == type &&
|
||||||
|
other.dateCreation == dateCreation &&
|
||||||
|
other.order == order &&
|
||||||
|
other.instanceId == instanceId &&
|
||||||
|
other.latitude == latitude &&
|
||||||
|
other.longitude == longitude &&
|
||||||
|
other.meterZoneGPS == meterZoneGPS &&
|
||||||
|
other.isBeacon == isBeacon &&
|
||||||
|
other.beaconId == beaconId &&
|
||||||
|
other.startDate == startDate &&
|
||||||
|
other.endDate == endDate &&
|
||||||
|
_deepEquality.equals(other.parcoursIds, parcoursIds) &&
|
||||||
|
_deepEquality.equals(other.programme, programme);
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode =>
|
||||||
|
// ignore: unnecessary_parenthesis
|
||||||
|
(id == null ? 0 : id!.hashCode) +
|
||||||
|
(label == null ? 0 : label!.hashCode) +
|
||||||
|
(title == null ? 0 : title!.hashCode) +
|
||||||
|
(description == null ? 0 : description!.hashCode) +
|
||||||
|
(isActive == null ? 0 : isActive!.hashCode) +
|
||||||
|
(imageId == null ? 0 : imageId!.hashCode) +
|
||||||
|
(imageSource == null ? 0 : imageSource!.hashCode) +
|
||||||
|
(configurationId == null ? 0 : configurationId!.hashCode) +
|
||||||
|
(isSubSection == null ? 0 : isSubSection!.hashCode) +
|
||||||
|
(parentId == null ? 0 : parentId!.hashCode) +
|
||||||
|
(type == null ? 0 : type!.hashCode) +
|
||||||
|
(dateCreation == null ? 0 : dateCreation!.hashCode) +
|
||||||
|
(order == null ? 0 : order!.hashCode) +
|
||||||
|
(instanceId == null ? 0 : instanceId!.hashCode) +
|
||||||
|
(latitude == null ? 0 : latitude!.hashCode) +
|
||||||
|
(longitude == null ? 0 : longitude!.hashCode) +
|
||||||
|
(meterZoneGPS == null ? 0 : meterZoneGPS!.hashCode) +
|
||||||
|
(isBeacon == null ? 0 : isBeacon!.hashCode) +
|
||||||
|
(beaconId == null ? 0 : beaconId!.hashCode) +
|
||||||
|
(startDate == null ? 0 : startDate!.hashCode) +
|
||||||
|
(endDate == null ? 0 : endDate!.hashCode) +
|
||||||
|
(parcoursIds == null ? 0 : parcoursIds!.hashCode) +
|
||||||
|
(programme == null ? 0 : programme!.hashCode);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() =>
|
||||||
|
'ApplicationInstanceDTOSectionEventDTO[id=$id, label=$label, title=$title, description=$description, isActive=$isActive, imageId=$imageId, imageSource=$imageSource, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, dateCreation=$dateCreation, order=$order, instanceId=$instanceId, latitude=$latitude, longitude=$longitude, meterZoneGPS=$meterZoneGPS, isBeacon=$isBeacon, beaconId=$beaconId, startDate=$startDate, endDate=$endDate, parcoursIds=$parcoursIds, programme=$programme]';
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final json = <String, dynamic>{};
|
||||||
|
if (this.id != null) {
|
||||||
|
json[r'id'] = this.id;
|
||||||
|
} else {
|
||||||
|
json[r'id'] = null;
|
||||||
|
}
|
||||||
|
if (this.label != null) {
|
||||||
|
json[r'label'] = this.label;
|
||||||
|
} else {
|
||||||
|
json[r'label'] = null;
|
||||||
|
}
|
||||||
|
if (this.title != null) {
|
||||||
|
json[r'title'] = this.title;
|
||||||
|
} else {
|
||||||
|
json[r'title'] = null;
|
||||||
|
}
|
||||||
|
if (this.description != null) {
|
||||||
|
json[r'description'] = this.description;
|
||||||
|
} else {
|
||||||
|
json[r'description'] = null;
|
||||||
|
}
|
||||||
|
if (this.isActive != null) {
|
||||||
|
json[r'isActive'] = this.isActive;
|
||||||
|
} else {
|
||||||
|
json[r'isActive'] = null;
|
||||||
|
}
|
||||||
|
if (this.imageId != null) {
|
||||||
|
json[r'imageId'] = this.imageId;
|
||||||
|
} else {
|
||||||
|
json[r'imageId'] = null;
|
||||||
|
}
|
||||||
|
if (this.imageSource != null) {
|
||||||
|
json[r'imageSource'] = this.imageSource;
|
||||||
|
} else {
|
||||||
|
json[r'imageSource'] = null;
|
||||||
|
}
|
||||||
|
if (this.configurationId != null) {
|
||||||
|
json[r'configurationId'] = this.configurationId;
|
||||||
|
} else {
|
||||||
|
json[r'configurationId'] = null;
|
||||||
|
}
|
||||||
|
if (this.isSubSection != null) {
|
||||||
|
json[r'isSubSection'] = this.isSubSection;
|
||||||
|
} else {
|
||||||
|
json[r'isSubSection'] = null;
|
||||||
|
}
|
||||||
|
if (this.parentId != null) {
|
||||||
|
json[r'parentId'] = this.parentId;
|
||||||
|
} else {
|
||||||
|
json[r'parentId'] = null;
|
||||||
|
}
|
||||||
|
if (this.type != null) {
|
||||||
|
json[r'type'] = this.type;
|
||||||
|
} else {
|
||||||
|
json[r'type'] = null;
|
||||||
|
}
|
||||||
|
if (this.dateCreation != null) {
|
||||||
|
json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
|
||||||
|
} else {
|
||||||
|
json[r'dateCreation'] = null;
|
||||||
|
}
|
||||||
|
if (this.order != null) {
|
||||||
|
json[r'order'] = this.order;
|
||||||
|
} else {
|
||||||
|
json[r'order'] = null;
|
||||||
|
}
|
||||||
|
if (this.instanceId != null) {
|
||||||
|
json[r'instanceId'] = this.instanceId;
|
||||||
|
} else {
|
||||||
|
json[r'instanceId'] = null;
|
||||||
|
}
|
||||||
|
if (this.latitude != null) {
|
||||||
|
json[r'latitude'] = this.latitude;
|
||||||
|
} else {
|
||||||
|
json[r'latitude'] = null;
|
||||||
|
}
|
||||||
|
if (this.longitude != null) {
|
||||||
|
json[r'longitude'] = this.longitude;
|
||||||
|
} else {
|
||||||
|
json[r'longitude'] = null;
|
||||||
|
}
|
||||||
|
if (this.meterZoneGPS != null) {
|
||||||
|
json[r'meterZoneGPS'] = this.meterZoneGPS;
|
||||||
|
} else {
|
||||||
|
json[r'meterZoneGPS'] = null;
|
||||||
|
}
|
||||||
|
if (this.isBeacon != null) {
|
||||||
|
json[r'isBeacon'] = this.isBeacon;
|
||||||
|
} else {
|
||||||
|
json[r'isBeacon'] = null;
|
||||||
|
}
|
||||||
|
if (this.beaconId != null) {
|
||||||
|
json[r'beaconId'] = this.beaconId;
|
||||||
|
} else {
|
||||||
|
json[r'beaconId'] = null;
|
||||||
|
}
|
||||||
|
if (this.startDate != null) {
|
||||||
|
json[r'startDate'] = this.startDate!.toUtc().toIso8601String();
|
||||||
|
} else {
|
||||||
|
json[r'startDate'] = null;
|
||||||
|
}
|
||||||
|
if (this.endDate != null) {
|
||||||
|
json[r'endDate'] = this.endDate!.toUtc().toIso8601String();
|
||||||
|
} else {
|
||||||
|
json[r'endDate'] = null;
|
||||||
|
}
|
||||||
|
if (this.parcoursIds != null) {
|
||||||
|
json[r'parcoursIds'] = this.parcoursIds;
|
||||||
|
} else {
|
||||||
|
json[r'parcoursIds'] = null;
|
||||||
|
}
|
||||||
|
if (this.programme != null) {
|
||||||
|
json[r'programme'] = this.programme;
|
||||||
|
} else {
|
||||||
|
json[r'programme'] = null;
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns a new [ApplicationInstanceDTOSectionEventDTO] instance and imports its values from
|
||||||
|
/// [value] if it's a [Map], null otherwise.
|
||||||
|
// ignore: prefer_constructors_over_static_methods
|
||||||
|
static ApplicationInstanceDTOSectionEventDTO? fromJson(dynamic value) {
|
||||||
|
if (value is Map) {
|
||||||
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
requiredKeys.forEach((key) {
|
||||||
|
assert(json.containsKey(key),
|
||||||
|
'Required key "ApplicationInstanceDTOSectionEventDTO[$key]" is missing from JSON.');
|
||||||
|
assert(json[key] != null,
|
||||||
|
'Required key "ApplicationInstanceDTOSectionEventDTO[$key]" has a null value in JSON.');
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
|
return ApplicationInstanceDTOSectionEventDTO(
|
||||||
|
id: mapValueOfType<String>(json, r'id'),
|
||||||
|
label: mapValueOfType<String>(json, r'label'),
|
||||||
|
title: TranslationDTO.listFromJson(json[r'title']),
|
||||||
|
description: TranslationDTO.listFromJson(json[r'description']),
|
||||||
|
isActive: mapValueOfType<bool>(json, r'isActive'),
|
||||||
|
imageId: mapValueOfType<String>(json, r'imageId'),
|
||||||
|
imageSource: mapValueOfType<String>(json, r'imageSource'),
|
||||||
|
configurationId: mapValueOfType<String>(json, r'configurationId'),
|
||||||
|
isSubSection: mapValueOfType<bool>(json, r'isSubSection'),
|
||||||
|
parentId: mapValueOfType<String>(json, r'parentId'),
|
||||||
|
type: SectionType.fromJson(json[r'type']),
|
||||||
|
dateCreation: mapDateTime(json, r'dateCreation', r''),
|
||||||
|
order: mapValueOfType<int>(json, r'order'),
|
||||||
|
instanceId: mapValueOfType<String>(json, r'instanceId'),
|
||||||
|
latitude: mapValueOfType<String>(json, r'latitude'),
|
||||||
|
longitude: mapValueOfType<String>(json, r'longitude'),
|
||||||
|
meterZoneGPS: mapValueOfType<int>(json, r'meterZoneGPS'),
|
||||||
|
isBeacon: mapValueOfType<bool>(json, r'isBeacon'),
|
||||||
|
beaconId: mapValueOfType<int>(json, r'beaconId'),
|
||||||
|
startDate: mapDateTime(json, r'startDate', r''),
|
||||||
|
endDate: mapDateTime(json, r'endDate', r''),
|
||||||
|
parcoursIds: json[r'parcoursIds'] is Iterable
|
||||||
|
? (json[r'parcoursIds'] as Iterable)
|
||||||
|
.cast<String>()
|
||||||
|
.toList(growable: false)
|
||||||
|
: const [],
|
||||||
|
programme: ProgrammeBlock.listFromJson(json[r'programme']),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
static List<ApplicationInstanceDTOSectionEventDTO> listFromJson(
|
||||||
|
dynamic json, {
|
||||||
|
bool growable = false,
|
||||||
|
}) {
|
||||||
|
final result = <ApplicationInstanceDTOSectionEventDTO>[];
|
||||||
|
if (json is List && json.isNotEmpty) {
|
||||||
|
for (final row in json) {
|
||||||
|
final value = ApplicationInstanceDTOSectionEventDTO.fromJson(row);
|
||||||
|
if (value != null) {
|
||||||
|
result.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.toList(growable: growable);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Map<String, ApplicationInstanceDTOSectionEventDTO> mapFromJson(
|
||||||
|
dynamic json) {
|
||||||
|
final map = <String, ApplicationInstanceDTOSectionEventDTO>{};
|
||||||
|
if (json is Map && json.isNotEmpty) {
|
||||||
|
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||||
|
for (final entry in json.entries) {
|
||||||
|
final value =
|
||||||
|
ApplicationInstanceDTOSectionEventDTO.fromJson(entry.value);
|
||||||
|
if (value != null) {
|
||||||
|
map[entry.key] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
// maps a json object with a list of ApplicationInstanceDTOSectionEventDTO-objects as value to a dart map
|
||||||
|
static Map<String, List<ApplicationInstanceDTOSectionEventDTO>>
|
||||||
|
mapListFromJson(
|
||||||
|
dynamic json, {
|
||||||
|
bool growable = false,
|
||||||
|
}) {
|
||||||
|
final map = <String, List<ApplicationInstanceDTOSectionEventDTO>>{};
|
||||||
|
if (json is Map && json.isNotEmpty) {
|
||||||
|
// ignore: parameter_assignments
|
||||||
|
json = json.cast<String, dynamic>();
|
||||||
|
for (final entry in json.entries) {
|
||||||
|
map[entry.key] = ApplicationInstanceDTOSectionEventDTO.listFromJson(
|
||||||
|
entry.value,
|
||||||
|
growable: growable,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The list of required keys that must be present in a JSON.
|
||||||
|
static const requiredKeys = <String>{};
|
||||||
|
}
|
||||||
@ -0,0 +1,387 @@
|
|||||||
|
//
|
||||||
|
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||||
|
//
|
||||||
|
// @dart=2.18
|
||||||
|
|
||||||
|
// ignore_for_file: unused_element, unused_import
|
||||||
|
// ignore_for_file: always_put_required_named_parameters_first
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: lines_longer_than_80_chars
|
||||||
|
|
||||||
|
part of openapi.api;
|
||||||
|
|
||||||
|
class ApplicationInstanceSectionEvent {
|
||||||
|
/// Returns a new [ApplicationInstanceSectionEvent] instance.
|
||||||
|
ApplicationInstanceSectionEvent({
|
||||||
|
required this.id,
|
||||||
|
required this.label,
|
||||||
|
this.title = const [],
|
||||||
|
required this.configurationId,
|
||||||
|
required this.type,
|
||||||
|
required this.isSubSection,
|
||||||
|
required this.instanceId,
|
||||||
|
this.description = const [],
|
||||||
|
this.order,
|
||||||
|
this.imageId,
|
||||||
|
this.imageSource,
|
||||||
|
this.parentId,
|
||||||
|
this.dateCreation,
|
||||||
|
this.isBeacon,
|
||||||
|
this.beaconId,
|
||||||
|
this.latitude,
|
||||||
|
this.longitude,
|
||||||
|
this.meterZoneGPS,
|
||||||
|
this.isActive,
|
||||||
|
this.startDate,
|
||||||
|
this.endDate,
|
||||||
|
this.programme = const [],
|
||||||
|
this.parcoursIds = const [],
|
||||||
|
});
|
||||||
|
|
||||||
|
String id;
|
||||||
|
|
||||||
|
String label;
|
||||||
|
|
||||||
|
List<TranslationDTO> title;
|
||||||
|
|
||||||
|
String configurationId;
|
||||||
|
|
||||||
|
SectionType type;
|
||||||
|
|
||||||
|
bool isSubSection;
|
||||||
|
|
||||||
|
String instanceId;
|
||||||
|
|
||||||
|
List<TranslationDTO>? description;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
int? order;
|
||||||
|
|
||||||
|
String? imageId;
|
||||||
|
|
||||||
|
String? imageSource;
|
||||||
|
|
||||||
|
String? parentId;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
DateTime? dateCreation;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isBeacon;
|
||||||
|
|
||||||
|
int? beaconId;
|
||||||
|
|
||||||
|
String? latitude;
|
||||||
|
|
||||||
|
String? longitude;
|
||||||
|
|
||||||
|
int? meterZoneGPS;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isActive;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
DateTime? startDate;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
DateTime? endDate;
|
||||||
|
|
||||||
|
List<ProgrammeBlock>? programme;
|
||||||
|
|
||||||
|
List<String>? parcoursIds;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is ApplicationInstanceSectionEvent &&
|
||||||
|
other.id == id &&
|
||||||
|
other.label == label &&
|
||||||
|
_deepEquality.equals(other.title, title) &&
|
||||||
|
other.configurationId == configurationId &&
|
||||||
|
other.type == type &&
|
||||||
|
other.isSubSection == isSubSection &&
|
||||||
|
other.instanceId == instanceId &&
|
||||||
|
_deepEquality.equals(other.description, description) &&
|
||||||
|
other.order == order &&
|
||||||
|
other.imageId == imageId &&
|
||||||
|
other.imageSource == imageSource &&
|
||||||
|
other.parentId == parentId &&
|
||||||
|
other.dateCreation == dateCreation &&
|
||||||
|
other.isBeacon == isBeacon &&
|
||||||
|
other.beaconId == beaconId &&
|
||||||
|
other.latitude == latitude &&
|
||||||
|
other.longitude == longitude &&
|
||||||
|
other.meterZoneGPS == meterZoneGPS &&
|
||||||
|
other.isActive == isActive &&
|
||||||
|
other.startDate == startDate &&
|
||||||
|
other.endDate == endDate &&
|
||||||
|
_deepEquality.equals(other.programme, programme) &&
|
||||||
|
_deepEquality.equals(other.parcoursIds, parcoursIds);
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode =>
|
||||||
|
// ignore: unnecessary_parenthesis
|
||||||
|
(id.hashCode) +
|
||||||
|
(label.hashCode) +
|
||||||
|
(title.hashCode) +
|
||||||
|
(configurationId.hashCode) +
|
||||||
|
(type.hashCode) +
|
||||||
|
(isSubSection.hashCode) +
|
||||||
|
(instanceId.hashCode) +
|
||||||
|
(description == null ? 0 : description!.hashCode) +
|
||||||
|
(order == null ? 0 : order!.hashCode) +
|
||||||
|
(imageId == null ? 0 : imageId!.hashCode) +
|
||||||
|
(imageSource == null ? 0 : imageSource!.hashCode) +
|
||||||
|
(parentId == null ? 0 : parentId!.hashCode) +
|
||||||
|
(dateCreation == null ? 0 : dateCreation!.hashCode) +
|
||||||
|
(isBeacon == null ? 0 : isBeacon!.hashCode) +
|
||||||
|
(beaconId == null ? 0 : beaconId!.hashCode) +
|
||||||
|
(latitude == null ? 0 : latitude!.hashCode) +
|
||||||
|
(longitude == null ? 0 : longitude!.hashCode) +
|
||||||
|
(meterZoneGPS == null ? 0 : meterZoneGPS!.hashCode) +
|
||||||
|
(isActive == null ? 0 : isActive!.hashCode) +
|
||||||
|
(startDate == null ? 0 : startDate!.hashCode) +
|
||||||
|
(endDate == null ? 0 : endDate!.hashCode) +
|
||||||
|
(programme == null ? 0 : programme!.hashCode) +
|
||||||
|
(parcoursIds == null ? 0 : parcoursIds!.hashCode);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() =>
|
||||||
|
'ApplicationInstanceSectionEvent[id=$id, label=$label, title=$title, configurationId=$configurationId, type=$type, isSubSection=$isSubSection, instanceId=$instanceId, description=$description, order=$order, imageId=$imageId, imageSource=$imageSource, parentId=$parentId, dateCreation=$dateCreation, isBeacon=$isBeacon, beaconId=$beaconId, latitude=$latitude, longitude=$longitude, meterZoneGPS=$meterZoneGPS, isActive=$isActive, startDate=$startDate, endDate=$endDate, programme=$programme, parcoursIds=$parcoursIds]';
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final json = <String, dynamic>{};
|
||||||
|
json[r'id'] = this.id;
|
||||||
|
json[r'label'] = this.label;
|
||||||
|
json[r'title'] = this.title;
|
||||||
|
json[r'configurationId'] = this.configurationId;
|
||||||
|
json[r'type'] = this.type;
|
||||||
|
json[r'isSubSection'] = this.isSubSection;
|
||||||
|
json[r'instanceId'] = this.instanceId;
|
||||||
|
if (this.description != null) {
|
||||||
|
json[r'description'] = this.description;
|
||||||
|
} else {
|
||||||
|
json[r'description'] = null;
|
||||||
|
}
|
||||||
|
if (this.order != null) {
|
||||||
|
json[r'order'] = this.order;
|
||||||
|
} else {
|
||||||
|
json[r'order'] = null;
|
||||||
|
}
|
||||||
|
if (this.imageId != null) {
|
||||||
|
json[r'imageId'] = this.imageId;
|
||||||
|
} else {
|
||||||
|
json[r'imageId'] = null;
|
||||||
|
}
|
||||||
|
if (this.imageSource != null) {
|
||||||
|
json[r'imageSource'] = this.imageSource;
|
||||||
|
} else {
|
||||||
|
json[r'imageSource'] = null;
|
||||||
|
}
|
||||||
|
if (this.parentId != null) {
|
||||||
|
json[r'parentId'] = this.parentId;
|
||||||
|
} else {
|
||||||
|
json[r'parentId'] = null;
|
||||||
|
}
|
||||||
|
if (this.dateCreation != null) {
|
||||||
|
json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
|
||||||
|
} else {
|
||||||
|
json[r'dateCreation'] = null;
|
||||||
|
}
|
||||||
|
if (this.isBeacon != null) {
|
||||||
|
json[r'isBeacon'] = this.isBeacon;
|
||||||
|
} else {
|
||||||
|
json[r'isBeacon'] = null;
|
||||||
|
}
|
||||||
|
if (this.beaconId != null) {
|
||||||
|
json[r'beaconId'] = this.beaconId;
|
||||||
|
} else {
|
||||||
|
json[r'beaconId'] = null;
|
||||||
|
}
|
||||||
|
if (this.latitude != null) {
|
||||||
|
json[r'latitude'] = this.latitude;
|
||||||
|
} else {
|
||||||
|
json[r'latitude'] = null;
|
||||||
|
}
|
||||||
|
if (this.longitude != null) {
|
||||||
|
json[r'longitude'] = this.longitude;
|
||||||
|
} else {
|
||||||
|
json[r'longitude'] = null;
|
||||||
|
}
|
||||||
|
if (this.meterZoneGPS != null) {
|
||||||
|
json[r'meterZoneGPS'] = this.meterZoneGPS;
|
||||||
|
} else {
|
||||||
|
json[r'meterZoneGPS'] = null;
|
||||||
|
}
|
||||||
|
if (this.isActive != null) {
|
||||||
|
json[r'isActive'] = this.isActive;
|
||||||
|
} else {
|
||||||
|
json[r'isActive'] = null;
|
||||||
|
}
|
||||||
|
if (this.startDate != null) {
|
||||||
|
json[r'startDate'] = this.startDate!.toUtc().toIso8601String();
|
||||||
|
} else {
|
||||||
|
json[r'startDate'] = null;
|
||||||
|
}
|
||||||
|
if (this.endDate != null) {
|
||||||
|
json[r'endDate'] = this.endDate!.toUtc().toIso8601String();
|
||||||
|
} else {
|
||||||
|
json[r'endDate'] = null;
|
||||||
|
}
|
||||||
|
if (this.programme != null) {
|
||||||
|
json[r'programme'] = this.programme;
|
||||||
|
} else {
|
||||||
|
json[r'programme'] = null;
|
||||||
|
}
|
||||||
|
if (this.parcoursIds != null) {
|
||||||
|
json[r'parcoursIds'] = this.parcoursIds;
|
||||||
|
} else {
|
||||||
|
json[r'parcoursIds'] = null;
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns a new [ApplicationInstanceSectionEvent] instance and imports its values from
|
||||||
|
/// [value] if it's a [Map], null otherwise.
|
||||||
|
// ignore: prefer_constructors_over_static_methods
|
||||||
|
static ApplicationInstanceSectionEvent? fromJson(dynamic value) {
|
||||||
|
if (value is Map) {
|
||||||
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
requiredKeys.forEach((key) {
|
||||||
|
assert(json.containsKey(key),
|
||||||
|
'Required key "ApplicationInstanceSectionEvent[$key]" is missing from JSON.');
|
||||||
|
assert(json[key] != null,
|
||||||
|
'Required key "ApplicationInstanceSectionEvent[$key]" has a null value in JSON.');
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
|
return ApplicationInstanceSectionEvent(
|
||||||
|
id: mapValueOfType<String>(json, r'id')!,
|
||||||
|
label: mapValueOfType<String>(json, r'label')!,
|
||||||
|
title: TranslationDTO.listFromJson(json[r'title']),
|
||||||
|
configurationId: mapValueOfType<String>(json, r'configurationId')!,
|
||||||
|
type: SectionType.fromJson(json[r'type'])!,
|
||||||
|
isSubSection: mapValueOfType<bool>(json, r'isSubSection')!,
|
||||||
|
instanceId: mapValueOfType<String>(json, r'instanceId')!,
|
||||||
|
description: TranslationDTO.listFromJson(json[r'description']),
|
||||||
|
order: mapValueOfType<int>(json, r'order'),
|
||||||
|
imageId: mapValueOfType<String>(json, r'imageId'),
|
||||||
|
imageSource: mapValueOfType<String>(json, r'imageSource'),
|
||||||
|
parentId: mapValueOfType<String>(json, r'parentId'),
|
||||||
|
dateCreation: mapDateTime(json, r'dateCreation', r''),
|
||||||
|
isBeacon: mapValueOfType<bool>(json, r'isBeacon'),
|
||||||
|
beaconId: mapValueOfType<int>(json, r'beaconId'),
|
||||||
|
latitude: mapValueOfType<String>(json, r'latitude'),
|
||||||
|
longitude: mapValueOfType<String>(json, r'longitude'),
|
||||||
|
meterZoneGPS: mapValueOfType<int>(json, r'meterZoneGPS'),
|
||||||
|
isActive: mapValueOfType<bool>(json, r'isActive'),
|
||||||
|
startDate: mapDateTime(json, r'startDate', r''),
|
||||||
|
endDate: mapDateTime(json, r'endDate', r''),
|
||||||
|
programme: ProgrammeBlock.listFromJson(json[r'programme']),
|
||||||
|
parcoursIds: json[r'parcoursIds'] is Iterable
|
||||||
|
? (json[r'parcoursIds'] as Iterable)
|
||||||
|
.cast<String>()
|
||||||
|
.toList(growable: false)
|
||||||
|
: const [],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
static List<ApplicationInstanceSectionEvent> listFromJson(
|
||||||
|
dynamic json, {
|
||||||
|
bool growable = false,
|
||||||
|
}) {
|
||||||
|
final result = <ApplicationInstanceSectionEvent>[];
|
||||||
|
if (json is List && json.isNotEmpty) {
|
||||||
|
for (final row in json) {
|
||||||
|
final value = ApplicationInstanceSectionEvent.fromJson(row);
|
||||||
|
if (value != null) {
|
||||||
|
result.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.toList(growable: growable);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Map<String, ApplicationInstanceSectionEvent> mapFromJson(
|
||||||
|
dynamic json) {
|
||||||
|
final map = <String, ApplicationInstanceSectionEvent>{};
|
||||||
|
if (json is Map && json.isNotEmpty) {
|
||||||
|
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||||
|
for (final entry in json.entries) {
|
||||||
|
final value = ApplicationInstanceSectionEvent.fromJson(entry.value);
|
||||||
|
if (value != null) {
|
||||||
|
map[entry.key] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
// maps a json object with a list of ApplicationInstanceSectionEvent-objects as value to a dart map
|
||||||
|
static Map<String, List<ApplicationInstanceSectionEvent>> mapListFromJson(
|
||||||
|
dynamic json, {
|
||||||
|
bool growable = false,
|
||||||
|
}) {
|
||||||
|
final map = <String, List<ApplicationInstanceSectionEvent>>{};
|
||||||
|
if (json is Map && json.isNotEmpty) {
|
||||||
|
// ignore: parameter_assignments
|
||||||
|
json = json.cast<String, dynamic>();
|
||||||
|
for (final entry in json.entries) {
|
||||||
|
map[entry.key] = ApplicationInstanceSectionEvent.listFromJson(
|
||||||
|
entry.value,
|
||||||
|
growable: growable,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The list of required keys that must be present in a JSON.
|
||||||
|
static const requiredKeys = <String>{
|
||||||
|
'id',
|
||||||
|
'label',
|
||||||
|
'title',
|
||||||
|
'configurationId',
|
||||||
|
'type',
|
||||||
|
'isSubSection',
|
||||||
|
'instanceId',
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -17,6 +17,14 @@ class InstanceDTO {
|
|||||||
this.name,
|
this.name,
|
||||||
this.dateCreation,
|
this.dateCreation,
|
||||||
this.pinCode,
|
this.pinCode,
|
||||||
|
this.isPushNotification,
|
||||||
|
this.isStatistic,
|
||||||
|
this.isMobile,
|
||||||
|
this.isTablet,
|
||||||
|
this.isWeb,
|
||||||
|
this.isVR,
|
||||||
|
this.isAssistant,
|
||||||
|
this.applicationInstanceDTOs = const [],
|
||||||
});
|
});
|
||||||
|
|
||||||
String? id;
|
String? id;
|
||||||
@ -27,6 +35,58 @@ class InstanceDTO {
|
|||||||
|
|
||||||
String? pinCode;
|
String? pinCode;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isPushNotification;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isStatistic;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isMobile;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isTablet;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isWeb;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isVR;
|
||||||
|
|
||||||
|
bool? isAssistant;
|
||||||
|
|
||||||
|
List<ApplicationInstanceDTO>? applicationInstanceDTOs;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) =>
|
bool operator ==(Object other) =>
|
||||||
identical(this, other) ||
|
identical(this, other) ||
|
||||||
@ -34,7 +94,16 @@ class InstanceDTO {
|
|||||||
other.id == id &&
|
other.id == id &&
|
||||||
other.name == name &&
|
other.name == name &&
|
||||||
other.dateCreation == dateCreation &&
|
other.dateCreation == dateCreation &&
|
||||||
other.pinCode == pinCode;
|
other.pinCode == pinCode &&
|
||||||
|
other.isPushNotification == isPushNotification &&
|
||||||
|
other.isStatistic == isStatistic &&
|
||||||
|
other.isMobile == isMobile &&
|
||||||
|
other.isTablet == isTablet &&
|
||||||
|
other.isWeb == isWeb &&
|
||||||
|
other.isVR == isVR &&
|
||||||
|
other.isAssistant == isAssistant &&
|
||||||
|
_deepEquality.equals(
|
||||||
|
other.applicationInstanceDTOs, applicationInstanceDTOs);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode =>
|
int get hashCode =>
|
||||||
@ -42,11 +111,19 @@ class InstanceDTO {
|
|||||||
(id == null ? 0 : id!.hashCode) +
|
(id == null ? 0 : id!.hashCode) +
|
||||||
(name == null ? 0 : name!.hashCode) +
|
(name == null ? 0 : name!.hashCode) +
|
||||||
(dateCreation == null ? 0 : dateCreation!.hashCode) +
|
(dateCreation == null ? 0 : dateCreation!.hashCode) +
|
||||||
(pinCode == null ? 0 : pinCode!.hashCode);
|
(pinCode == null ? 0 : pinCode!.hashCode) +
|
||||||
|
(isPushNotification == null ? 0 : isPushNotification!.hashCode) +
|
||||||
|
(isStatistic == null ? 0 : isStatistic!.hashCode) +
|
||||||
|
(isMobile == null ? 0 : isMobile!.hashCode) +
|
||||||
|
(isTablet == null ? 0 : isTablet!.hashCode) +
|
||||||
|
(isWeb == null ? 0 : isWeb!.hashCode) +
|
||||||
|
(isVR == null ? 0 : isVR!.hashCode) +
|
||||||
|
(isAssistant == null ? 0 : isAssistant!.hashCode) +
|
||||||
|
(applicationInstanceDTOs == null ? 0 : applicationInstanceDTOs!.hashCode);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() =>
|
String toString() =>
|
||||||
'InstanceDTO[id=$id, name=$name, dateCreation=$dateCreation, pinCode=$pinCode]';
|
'InstanceDTO[id=$id, name=$name, dateCreation=$dateCreation, pinCode=$pinCode, isPushNotification=$isPushNotification, isStatistic=$isStatistic, isMobile=$isMobile, isTablet=$isTablet, isWeb=$isWeb, isVR=$isVR, isAssistant=$isAssistant, applicationInstanceDTOs=$applicationInstanceDTOs]';
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final json = <String, dynamic>{};
|
final json = <String, dynamic>{};
|
||||||
@ -70,6 +147,46 @@ class InstanceDTO {
|
|||||||
} else {
|
} else {
|
||||||
json[r'pinCode'] = null;
|
json[r'pinCode'] = null;
|
||||||
}
|
}
|
||||||
|
if (this.isPushNotification != null) {
|
||||||
|
json[r'isPushNotification'] = this.isPushNotification;
|
||||||
|
} else {
|
||||||
|
json[r'isPushNotification'] = null;
|
||||||
|
}
|
||||||
|
if (this.isStatistic != null) {
|
||||||
|
json[r'isStatistic'] = this.isStatistic;
|
||||||
|
} else {
|
||||||
|
json[r'isStatistic'] = null;
|
||||||
|
}
|
||||||
|
if (this.isMobile != null) {
|
||||||
|
json[r'isMobile'] = this.isMobile;
|
||||||
|
} else {
|
||||||
|
json[r'isMobile'] = null;
|
||||||
|
}
|
||||||
|
if (this.isTablet != null) {
|
||||||
|
json[r'isTablet'] = this.isTablet;
|
||||||
|
} else {
|
||||||
|
json[r'isTablet'] = null;
|
||||||
|
}
|
||||||
|
if (this.isWeb != null) {
|
||||||
|
json[r'isWeb'] = this.isWeb;
|
||||||
|
} else {
|
||||||
|
json[r'isWeb'] = null;
|
||||||
|
}
|
||||||
|
if (this.isVR != null) {
|
||||||
|
json[r'isVR'] = this.isVR;
|
||||||
|
} else {
|
||||||
|
json[r'isVR'] = null;
|
||||||
|
}
|
||||||
|
if (this.isAssistant != null) {
|
||||||
|
json[r'isAssistant'] = this.isAssistant;
|
||||||
|
} else {
|
||||||
|
json[r'isAssistant'] = null;
|
||||||
|
}
|
||||||
|
if (this.applicationInstanceDTOs != null) {
|
||||||
|
json[r'applicationInstanceDTOs'] = this.applicationInstanceDTOs;
|
||||||
|
} else {
|
||||||
|
json[r'applicationInstanceDTOs'] = null;
|
||||||
|
}
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,6 +215,15 @@ class InstanceDTO {
|
|||||||
name: mapValueOfType<String>(json, r'name'),
|
name: mapValueOfType<String>(json, r'name'),
|
||||||
dateCreation: mapDateTime(json, r'dateCreation', r''),
|
dateCreation: mapDateTime(json, r'dateCreation', r''),
|
||||||
pinCode: mapValueOfType<String>(json, r'pinCode'),
|
pinCode: mapValueOfType<String>(json, r'pinCode'),
|
||||||
|
isPushNotification: mapValueOfType<bool>(json, r'isPushNotification'),
|
||||||
|
isStatistic: mapValueOfType<bool>(json, r'isStatistic'),
|
||||||
|
isMobile: mapValueOfType<bool>(json, r'isMobile'),
|
||||||
|
isTablet: mapValueOfType<bool>(json, r'isTablet'),
|
||||||
|
isWeb: mapValueOfType<bool>(json, r'isWeb'),
|
||||||
|
isVR: mapValueOfType<bool>(json, r'isVR'),
|
||||||
|
isAssistant: mapValueOfType<bool>(json, r'isAssistant'),
|
||||||
|
applicationInstanceDTOs: ApplicationInstanceDTO.listFromJson(
|
||||||
|
json[r'applicationInstanceDTOs']),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
102
manager_api_new/lib/model/layout_main_page_type.dart
Normal file
102
manager_api_new/lib/model/layout_main_page_type.dart
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
//
|
||||||
|
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||||
|
//
|
||||||
|
// @dart=2.18
|
||||||
|
|
||||||
|
// ignore_for_file: unused_element, unused_import
|
||||||
|
// ignore_for_file: always_put_required_named_parameters_first
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: lines_longer_than_80_chars
|
||||||
|
|
||||||
|
part of openapi.api;
|
||||||
|
|
||||||
|
/// 0 = SimpleGrid 1 = MasonryGrid
|
||||||
|
class LayoutMainPageType {
|
||||||
|
/// Instantiate a new enum with the provided [value].
|
||||||
|
const LayoutMainPageType._(this.value);
|
||||||
|
|
||||||
|
/// The underlying value of this enum member.
|
||||||
|
final int value;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => value.toString();
|
||||||
|
|
||||||
|
int toJson() => value;
|
||||||
|
|
||||||
|
static const SimpleGrid = LayoutMainPageType._(0);
|
||||||
|
static const MasonryGrid = LayoutMainPageType._(1);
|
||||||
|
|
||||||
|
/// List of all possible values in this [enum][LayoutMainPageType].
|
||||||
|
static const values = <LayoutMainPageType>[
|
||||||
|
SimpleGrid,
|
||||||
|
MasonryGrid,
|
||||||
|
];
|
||||||
|
|
||||||
|
static LayoutMainPageType? fromJson(dynamic value) =>
|
||||||
|
LayoutMainPageTypeTypeTransformer().decode(value);
|
||||||
|
|
||||||
|
static List<LayoutMainPageType> listFromJson(
|
||||||
|
dynamic json, {
|
||||||
|
bool growable = false,
|
||||||
|
}) {
|
||||||
|
final result = <LayoutMainPageType>[];
|
||||||
|
if (json is List && json.isNotEmpty) {
|
||||||
|
for (final row in json) {
|
||||||
|
final value = LayoutMainPageType.fromJson(row);
|
||||||
|
if (value != null) {
|
||||||
|
result.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.toList(growable: growable);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Transformation class that can [encode] an instance of [LayoutMainPageType] to int,
|
||||||
|
/// and [decode] dynamic data back to [LayoutMainPageType].
|
||||||
|
class LayoutMainPageTypeTypeTransformer {
|
||||||
|
factory LayoutMainPageTypeTypeTransformer() =>
|
||||||
|
_instance ??= const LayoutMainPageTypeTypeTransformer._();
|
||||||
|
|
||||||
|
const LayoutMainPageTypeTypeTransformer._();
|
||||||
|
|
||||||
|
int encode(LayoutMainPageType data) => data.value;
|
||||||
|
|
||||||
|
/// Decodes a [dynamic value][data] to a LayoutMainPageType.
|
||||||
|
///
|
||||||
|
/// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
|
||||||
|
/// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
|
||||||
|
/// cannot be decoded successfully, then an [UnimplementedError] is thrown.
|
||||||
|
///
|
||||||
|
/// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
|
||||||
|
/// and users are still using an old app with the old code.
|
||||||
|
LayoutMainPageType? decode(dynamic data, {bool allowNull = true}) {
|
||||||
|
if (data != null) {
|
||||||
|
if(data.runtimeType == String) {
|
||||||
|
switch (data.toString()) {
|
||||||
|
case r'SimpleGrid': return LayoutMainPageType.SimpleGrid;
|
||||||
|
case r'MasonryGrid': return LayoutMainPageType.MasonryGrid;
|
||||||
|
default:
|
||||||
|
if (!allowNull) {
|
||||||
|
throw ArgumentError('Unknown enum value to decode: $data');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(data.runtimeType == int) {
|
||||||
|
switch (data) {
|
||||||
|
case 0: return LayoutMainPageType.SimpleGrid;
|
||||||
|
case 1: return LayoutMainPageType.MasonryGrid;
|
||||||
|
default:
|
||||||
|
if (!allowNull) {
|
||||||
|
throw ArgumentError('Unknown enum value to decode: $data');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Singleton [LayoutMainPageTypeTypeTransformer] instance.
|
||||||
|
static LayoutMainPageTypeTypeTransformer? _instance;
|
||||||
|
}
|
||||||
31
manager_api_new/lib/model/map_annotation.dart
Normal file
31
manager_api_new/lib/model/map_annotation.dart
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
//
|
||||||
|
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||||
|
//
|
||||||
|
// @dart=2.18
|
||||||
|
|
||||||
|
// ignore_for_file: unused_element, unused_import
|
||||||
|
// ignore_for_file: always_put_required_named_parameters_first
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: lines_longer_than_80_chars
|
||||||
|
|
||||||
|
part of openapi.api;
|
||||||
|
|
||||||
|
class MapAnnotation {
|
||||||
|
MapAnnotation({this.id});
|
||||||
|
String? id;
|
||||||
|
|
||||||
|
static MapAnnotation? fromJson(dynamic value) => value is Map ? MapAnnotation() : null;
|
||||||
|
|
||||||
|
static List<MapAnnotation> listFromJson(dynamic json, {bool growable = false}) {
|
||||||
|
final result = <MapAnnotation>[];
|
||||||
|
if (json is List && json.isNotEmpty) {
|
||||||
|
for (final row in json) {
|
||||||
|
final value = MapAnnotation.fromJson(row);
|
||||||
|
if (value != null) result.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.toList(growable: growable);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const requiredKeys = <String>{};
|
||||||
|
}
|
||||||
31
manager_api_new/lib/model/programme_block.dart
Normal file
31
manager_api_new/lib/model/programme_block.dart
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
//
|
||||||
|
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||||
|
//
|
||||||
|
// @dart=2.18
|
||||||
|
|
||||||
|
// ignore_for_file: unused_element, unused_import
|
||||||
|
// ignore_for_file: always_put_required_named_parameters_first
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: lines_longer_than_80_chars
|
||||||
|
|
||||||
|
part of openapi.api;
|
||||||
|
|
||||||
|
class ProgrammeBlock {
|
||||||
|
ProgrammeBlock({this.id});
|
||||||
|
String? id;
|
||||||
|
|
||||||
|
static ProgrammeBlock? fromJson(dynamic value) => value is Map ? ProgrammeBlock() : null;
|
||||||
|
|
||||||
|
static List<ProgrammeBlock> listFromJson(dynamic json, {bool growable = false}) {
|
||||||
|
final result = <ProgrammeBlock>[];
|
||||||
|
if (json is List && json.isNotEmpty) {
|
||||||
|
for (final row in json) {
|
||||||
|
final value = ProgrammeBlock.fromJson(row);
|
||||||
|
if (value != null) result.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.toList(growable: growable);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const requiredKeys = <String>{};
|
||||||
|
}
|
||||||
386
manager_api_new/lib/model/section_event.dart
Normal file
386
manager_api_new/lib/model/section_event.dart
Normal file
@ -0,0 +1,386 @@
|
|||||||
|
//
|
||||||
|
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||||
|
//
|
||||||
|
// @dart=2.18
|
||||||
|
|
||||||
|
// ignore_for_file: unused_element, unused_import
|
||||||
|
// ignore_for_file: always_put_required_named_parameters_first
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: lines_longer_than_80_chars
|
||||||
|
|
||||||
|
part of openapi.api;
|
||||||
|
|
||||||
|
class SectionEvent {
|
||||||
|
/// Returns a new [SectionEvent] instance.
|
||||||
|
SectionEvent({
|
||||||
|
required this.id,
|
||||||
|
required this.label,
|
||||||
|
this.title = const [],
|
||||||
|
required this.configurationId,
|
||||||
|
required this.type,
|
||||||
|
required this.isSubSection,
|
||||||
|
required this.instanceId,
|
||||||
|
this.description = const [],
|
||||||
|
this.order,
|
||||||
|
this.imageId,
|
||||||
|
this.imageSource,
|
||||||
|
this.parentId,
|
||||||
|
this.dateCreation,
|
||||||
|
this.isBeacon,
|
||||||
|
this.beaconId,
|
||||||
|
this.latitude,
|
||||||
|
this.longitude,
|
||||||
|
this.meterZoneGPS,
|
||||||
|
this.isActive,
|
||||||
|
this.startDate,
|
||||||
|
this.endDate,
|
||||||
|
this.programme = const [],
|
||||||
|
this.parcoursIds = const [],
|
||||||
|
});
|
||||||
|
|
||||||
|
String id;
|
||||||
|
|
||||||
|
String label;
|
||||||
|
|
||||||
|
List<TranslationDTO> title;
|
||||||
|
|
||||||
|
String configurationId;
|
||||||
|
|
||||||
|
SectionType type;
|
||||||
|
|
||||||
|
bool isSubSection;
|
||||||
|
|
||||||
|
String instanceId;
|
||||||
|
|
||||||
|
List<TranslationDTO>? description;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
int? order;
|
||||||
|
|
||||||
|
String? imageId;
|
||||||
|
|
||||||
|
String? imageSource;
|
||||||
|
|
||||||
|
String? parentId;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
DateTime? dateCreation;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isBeacon;
|
||||||
|
|
||||||
|
int? beaconId;
|
||||||
|
|
||||||
|
String? latitude;
|
||||||
|
|
||||||
|
String? longitude;
|
||||||
|
|
||||||
|
int? meterZoneGPS;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isActive;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
DateTime? startDate;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
DateTime? endDate;
|
||||||
|
|
||||||
|
List<ProgrammeBlock>? programme;
|
||||||
|
|
||||||
|
List<String>? parcoursIds;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is SectionEvent &&
|
||||||
|
other.id == id &&
|
||||||
|
other.label == label &&
|
||||||
|
_deepEquality.equals(other.title, title) &&
|
||||||
|
other.configurationId == configurationId &&
|
||||||
|
other.type == type &&
|
||||||
|
other.isSubSection == isSubSection &&
|
||||||
|
other.instanceId == instanceId &&
|
||||||
|
_deepEquality.equals(other.description, description) &&
|
||||||
|
other.order == order &&
|
||||||
|
other.imageId == imageId &&
|
||||||
|
other.imageSource == imageSource &&
|
||||||
|
other.parentId == parentId &&
|
||||||
|
other.dateCreation == dateCreation &&
|
||||||
|
other.isBeacon == isBeacon &&
|
||||||
|
other.beaconId == beaconId &&
|
||||||
|
other.latitude == latitude &&
|
||||||
|
other.longitude == longitude &&
|
||||||
|
other.meterZoneGPS == meterZoneGPS &&
|
||||||
|
other.isActive == isActive &&
|
||||||
|
other.startDate == startDate &&
|
||||||
|
other.endDate == endDate &&
|
||||||
|
_deepEquality.equals(other.programme, programme) &&
|
||||||
|
_deepEquality.equals(other.parcoursIds, parcoursIds);
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode =>
|
||||||
|
// ignore: unnecessary_parenthesis
|
||||||
|
(id.hashCode) +
|
||||||
|
(label.hashCode) +
|
||||||
|
(title.hashCode) +
|
||||||
|
(configurationId.hashCode) +
|
||||||
|
(type.hashCode) +
|
||||||
|
(isSubSection.hashCode) +
|
||||||
|
(instanceId.hashCode) +
|
||||||
|
(description == null ? 0 : description!.hashCode) +
|
||||||
|
(order == null ? 0 : order!.hashCode) +
|
||||||
|
(imageId == null ? 0 : imageId!.hashCode) +
|
||||||
|
(imageSource == null ? 0 : imageSource!.hashCode) +
|
||||||
|
(parentId == null ? 0 : parentId!.hashCode) +
|
||||||
|
(dateCreation == null ? 0 : dateCreation!.hashCode) +
|
||||||
|
(isBeacon == null ? 0 : isBeacon!.hashCode) +
|
||||||
|
(beaconId == null ? 0 : beaconId!.hashCode) +
|
||||||
|
(latitude == null ? 0 : latitude!.hashCode) +
|
||||||
|
(longitude == null ? 0 : longitude!.hashCode) +
|
||||||
|
(meterZoneGPS == null ? 0 : meterZoneGPS!.hashCode) +
|
||||||
|
(isActive == null ? 0 : isActive!.hashCode) +
|
||||||
|
(startDate == null ? 0 : startDate!.hashCode) +
|
||||||
|
(endDate == null ? 0 : endDate!.hashCode) +
|
||||||
|
(programme == null ? 0 : programme!.hashCode) +
|
||||||
|
(parcoursIds == null ? 0 : parcoursIds!.hashCode);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() =>
|
||||||
|
'SectionEvent[id=$id, label=$label, title=$title, configurationId=$configurationId, type=$type, isSubSection=$isSubSection, instanceId=$instanceId, description=$description, order=$order, imageId=$imageId, imageSource=$imageSource, parentId=$parentId, dateCreation=$dateCreation, isBeacon=$isBeacon, beaconId=$beaconId, latitude=$latitude, longitude=$longitude, meterZoneGPS=$meterZoneGPS, isActive=$isActive, startDate=$startDate, endDate=$endDate, programme=$programme, parcoursIds=$parcoursIds]';
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final json = <String, dynamic>{};
|
||||||
|
json[r'id'] = this.id;
|
||||||
|
json[r'label'] = this.label;
|
||||||
|
json[r'title'] = this.title;
|
||||||
|
json[r'configurationId'] = this.configurationId;
|
||||||
|
json[r'type'] = this.type;
|
||||||
|
json[r'isSubSection'] = this.isSubSection;
|
||||||
|
json[r'instanceId'] = this.instanceId;
|
||||||
|
if (this.description != null) {
|
||||||
|
json[r'description'] = this.description;
|
||||||
|
} else {
|
||||||
|
json[r'description'] = null;
|
||||||
|
}
|
||||||
|
if (this.order != null) {
|
||||||
|
json[r'order'] = this.order;
|
||||||
|
} else {
|
||||||
|
json[r'order'] = null;
|
||||||
|
}
|
||||||
|
if (this.imageId != null) {
|
||||||
|
json[r'imageId'] = this.imageId;
|
||||||
|
} else {
|
||||||
|
json[r'imageId'] = null;
|
||||||
|
}
|
||||||
|
if (this.imageSource != null) {
|
||||||
|
json[r'imageSource'] = this.imageSource;
|
||||||
|
} else {
|
||||||
|
json[r'imageSource'] = null;
|
||||||
|
}
|
||||||
|
if (this.parentId != null) {
|
||||||
|
json[r'parentId'] = this.parentId;
|
||||||
|
} else {
|
||||||
|
json[r'parentId'] = null;
|
||||||
|
}
|
||||||
|
if (this.dateCreation != null) {
|
||||||
|
json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
|
||||||
|
} else {
|
||||||
|
json[r'dateCreation'] = null;
|
||||||
|
}
|
||||||
|
if (this.isBeacon != null) {
|
||||||
|
json[r'isBeacon'] = this.isBeacon;
|
||||||
|
} else {
|
||||||
|
json[r'isBeacon'] = null;
|
||||||
|
}
|
||||||
|
if (this.beaconId != null) {
|
||||||
|
json[r'beaconId'] = this.beaconId;
|
||||||
|
} else {
|
||||||
|
json[r'beaconId'] = null;
|
||||||
|
}
|
||||||
|
if (this.latitude != null) {
|
||||||
|
json[r'latitude'] = this.latitude;
|
||||||
|
} else {
|
||||||
|
json[r'latitude'] = null;
|
||||||
|
}
|
||||||
|
if (this.longitude != null) {
|
||||||
|
json[r'longitude'] = this.longitude;
|
||||||
|
} else {
|
||||||
|
json[r'longitude'] = null;
|
||||||
|
}
|
||||||
|
if (this.meterZoneGPS != null) {
|
||||||
|
json[r'meterZoneGPS'] = this.meterZoneGPS;
|
||||||
|
} else {
|
||||||
|
json[r'meterZoneGPS'] = null;
|
||||||
|
}
|
||||||
|
if (this.isActive != null) {
|
||||||
|
json[r'isActive'] = this.isActive;
|
||||||
|
} else {
|
||||||
|
json[r'isActive'] = null;
|
||||||
|
}
|
||||||
|
if (this.startDate != null) {
|
||||||
|
json[r'startDate'] = this.startDate!.toUtc().toIso8601String();
|
||||||
|
} else {
|
||||||
|
json[r'startDate'] = null;
|
||||||
|
}
|
||||||
|
if (this.endDate != null) {
|
||||||
|
json[r'endDate'] = this.endDate!.toUtc().toIso8601String();
|
||||||
|
} else {
|
||||||
|
json[r'endDate'] = null;
|
||||||
|
}
|
||||||
|
if (this.programme != null) {
|
||||||
|
json[r'programme'] = this.programme;
|
||||||
|
} else {
|
||||||
|
json[r'programme'] = null;
|
||||||
|
}
|
||||||
|
if (this.parcoursIds != null) {
|
||||||
|
json[r'parcoursIds'] = this.parcoursIds;
|
||||||
|
} else {
|
||||||
|
json[r'parcoursIds'] = null;
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns a new [SectionEvent] instance and imports its values from
|
||||||
|
/// [value] if it's a [Map], null otherwise.
|
||||||
|
// ignore: prefer_constructors_over_static_methods
|
||||||
|
static SectionEvent? fromJson(dynamic value) {
|
||||||
|
if (value is Map) {
|
||||||
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
requiredKeys.forEach((key) {
|
||||||
|
assert(json.containsKey(key),
|
||||||
|
'Required key "SectionEvent[$key]" is missing from JSON.');
|
||||||
|
assert(json[key] != null,
|
||||||
|
'Required key "SectionEvent[$key]" has a null value in JSON.');
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
|
return SectionEvent(
|
||||||
|
id: mapValueOfType<String>(json, r'id')!,
|
||||||
|
label: mapValueOfType<String>(json, r'label')!,
|
||||||
|
title: TranslationDTO.listFromJson(json[r'title']),
|
||||||
|
configurationId: mapValueOfType<String>(json, r'configurationId')!,
|
||||||
|
type: SectionType.fromJson(json[r'type'])!,
|
||||||
|
isSubSection: mapValueOfType<bool>(json, r'isSubSection')!,
|
||||||
|
instanceId: mapValueOfType<String>(json, r'instanceId')!,
|
||||||
|
description: TranslationDTO.listFromJson(json[r'description']),
|
||||||
|
order: mapValueOfType<int>(json, r'order'),
|
||||||
|
imageId: mapValueOfType<String>(json, r'imageId'),
|
||||||
|
imageSource: mapValueOfType<String>(json, r'imageSource'),
|
||||||
|
parentId: mapValueOfType<String>(json, r'parentId'),
|
||||||
|
dateCreation: mapDateTime(json, r'dateCreation', r''),
|
||||||
|
isBeacon: mapValueOfType<bool>(json, r'isBeacon'),
|
||||||
|
beaconId: mapValueOfType<int>(json, r'beaconId'),
|
||||||
|
latitude: mapValueOfType<String>(json, r'latitude'),
|
||||||
|
longitude: mapValueOfType<String>(json, r'longitude'),
|
||||||
|
meterZoneGPS: mapValueOfType<int>(json, r'meterZoneGPS'),
|
||||||
|
isActive: mapValueOfType<bool>(json, r'isActive'),
|
||||||
|
startDate: mapDateTime(json, r'startDate', r''),
|
||||||
|
endDate: mapDateTime(json, r'endDate', r''),
|
||||||
|
programme: ProgrammeBlock.listFromJson(json[r'programme']),
|
||||||
|
parcoursIds: json[r'parcoursIds'] is Iterable
|
||||||
|
? (json[r'parcoursIds'] as Iterable)
|
||||||
|
.cast<String>()
|
||||||
|
.toList(growable: false)
|
||||||
|
: const [],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
static List<SectionEvent> listFromJson(
|
||||||
|
dynamic json, {
|
||||||
|
bool growable = false,
|
||||||
|
}) {
|
||||||
|
final result = <SectionEvent>[];
|
||||||
|
if (json is List && json.isNotEmpty) {
|
||||||
|
for (final row in json) {
|
||||||
|
final value = SectionEvent.fromJson(row);
|
||||||
|
if (value != null) {
|
||||||
|
result.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.toList(growable: growable);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Map<String, SectionEvent> mapFromJson(dynamic json) {
|
||||||
|
final map = <String, SectionEvent>{};
|
||||||
|
if (json is Map && json.isNotEmpty) {
|
||||||
|
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||||
|
for (final entry in json.entries) {
|
||||||
|
final value = SectionEvent.fromJson(entry.value);
|
||||||
|
if (value != null) {
|
||||||
|
map[entry.key] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
// maps a json object with a list of SectionEvent-objects as value to a dart map
|
||||||
|
static Map<String, List<SectionEvent>> mapListFromJson(
|
||||||
|
dynamic json, {
|
||||||
|
bool growable = false,
|
||||||
|
}) {
|
||||||
|
final map = <String, List<SectionEvent>>{};
|
||||||
|
if (json is Map && json.isNotEmpty) {
|
||||||
|
// ignore: parameter_assignments
|
||||||
|
json = json.cast<String, dynamic>();
|
||||||
|
for (final entry in json.entries) {
|
||||||
|
map[entry.key] = SectionEvent.listFromJson(
|
||||||
|
entry.value,
|
||||||
|
growable: growable,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The list of required keys that must be present in a JSON.
|
||||||
|
static const requiredKeys = <String>{
|
||||||
|
'id',
|
||||||
|
'label',
|
||||||
|
'title',
|
||||||
|
'configurationId',
|
||||||
|
'type',
|
||||||
|
'isSubSection',
|
||||||
|
'instanceId',
|
||||||
|
};
|
||||||
|
}
|
||||||
406
manager_api_new/lib/model/section_event_dto.dart
Normal file
406
manager_api_new/lib/model/section_event_dto.dart
Normal file
@ -0,0 +1,406 @@
|
|||||||
|
//
|
||||||
|
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||||
|
//
|
||||||
|
// @dart=2.18
|
||||||
|
|
||||||
|
// ignore_for_file: unused_element, unused_import
|
||||||
|
// ignore_for_file: always_put_required_named_parameters_first
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: lines_longer_than_80_chars
|
||||||
|
|
||||||
|
part of openapi.api;
|
||||||
|
|
||||||
|
class SectionEventDTO {
|
||||||
|
/// Returns a new [SectionEventDTO] instance.
|
||||||
|
SectionEventDTO({
|
||||||
|
this.id,
|
||||||
|
this.label,
|
||||||
|
this.title = const [],
|
||||||
|
this.description = const [],
|
||||||
|
this.isActive,
|
||||||
|
this.imageId,
|
||||||
|
this.imageSource,
|
||||||
|
this.configurationId,
|
||||||
|
this.isSubSection,
|
||||||
|
this.parentId,
|
||||||
|
this.type,
|
||||||
|
this.dateCreation,
|
||||||
|
this.order,
|
||||||
|
this.instanceId,
|
||||||
|
this.latitude,
|
||||||
|
this.longitude,
|
||||||
|
this.meterZoneGPS,
|
||||||
|
this.isBeacon,
|
||||||
|
this.beaconId,
|
||||||
|
this.startDate,
|
||||||
|
this.endDate,
|
||||||
|
this.parcoursIds = const [],
|
||||||
|
this.programme = const [],
|
||||||
|
});
|
||||||
|
|
||||||
|
String? id;
|
||||||
|
|
||||||
|
String? label;
|
||||||
|
|
||||||
|
List<TranslationDTO>? title;
|
||||||
|
|
||||||
|
List<TranslationDTO>? description;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isActive;
|
||||||
|
|
||||||
|
String? imageId;
|
||||||
|
|
||||||
|
String? imageSource;
|
||||||
|
|
||||||
|
String? configurationId;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isSubSection;
|
||||||
|
|
||||||
|
String? parentId;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
SectionType? type;
|
||||||
|
|
||||||
|
DateTime? dateCreation;
|
||||||
|
|
||||||
|
int? order;
|
||||||
|
|
||||||
|
String? instanceId;
|
||||||
|
|
||||||
|
String? latitude;
|
||||||
|
|
||||||
|
String? longitude;
|
||||||
|
|
||||||
|
int? meterZoneGPS;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isBeacon;
|
||||||
|
|
||||||
|
int? beaconId;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
DateTime? startDate;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
DateTime? endDate;
|
||||||
|
|
||||||
|
List<String>? parcoursIds;
|
||||||
|
|
||||||
|
List<ProgrammeBlock>? programme;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is SectionEventDTO &&
|
||||||
|
other.id == id &&
|
||||||
|
other.label == label &&
|
||||||
|
_deepEquality.equals(other.title, title) &&
|
||||||
|
_deepEquality.equals(other.description, description) &&
|
||||||
|
other.isActive == isActive &&
|
||||||
|
other.imageId == imageId &&
|
||||||
|
other.imageSource == imageSource &&
|
||||||
|
other.configurationId == configurationId &&
|
||||||
|
other.isSubSection == isSubSection &&
|
||||||
|
other.parentId == parentId &&
|
||||||
|
other.type == type &&
|
||||||
|
other.dateCreation == dateCreation &&
|
||||||
|
other.order == order &&
|
||||||
|
other.instanceId == instanceId &&
|
||||||
|
other.latitude == latitude &&
|
||||||
|
other.longitude == longitude &&
|
||||||
|
other.meterZoneGPS == meterZoneGPS &&
|
||||||
|
other.isBeacon == isBeacon &&
|
||||||
|
other.beaconId == beaconId &&
|
||||||
|
other.startDate == startDate &&
|
||||||
|
other.endDate == endDate &&
|
||||||
|
_deepEquality.equals(other.parcoursIds, parcoursIds) &&
|
||||||
|
_deepEquality.equals(other.programme, programme);
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode =>
|
||||||
|
// ignore: unnecessary_parenthesis
|
||||||
|
(id == null ? 0 : id!.hashCode) +
|
||||||
|
(label == null ? 0 : label!.hashCode) +
|
||||||
|
(title == null ? 0 : title!.hashCode) +
|
||||||
|
(description == null ? 0 : description!.hashCode) +
|
||||||
|
(isActive == null ? 0 : isActive!.hashCode) +
|
||||||
|
(imageId == null ? 0 : imageId!.hashCode) +
|
||||||
|
(imageSource == null ? 0 : imageSource!.hashCode) +
|
||||||
|
(configurationId == null ? 0 : configurationId!.hashCode) +
|
||||||
|
(isSubSection == null ? 0 : isSubSection!.hashCode) +
|
||||||
|
(parentId == null ? 0 : parentId!.hashCode) +
|
||||||
|
(type == null ? 0 : type!.hashCode) +
|
||||||
|
(dateCreation == null ? 0 : dateCreation!.hashCode) +
|
||||||
|
(order == null ? 0 : order!.hashCode) +
|
||||||
|
(instanceId == null ? 0 : instanceId!.hashCode) +
|
||||||
|
(latitude == null ? 0 : latitude!.hashCode) +
|
||||||
|
(longitude == null ? 0 : longitude!.hashCode) +
|
||||||
|
(meterZoneGPS == null ? 0 : meterZoneGPS!.hashCode) +
|
||||||
|
(isBeacon == null ? 0 : isBeacon!.hashCode) +
|
||||||
|
(beaconId == null ? 0 : beaconId!.hashCode) +
|
||||||
|
(startDate == null ? 0 : startDate!.hashCode) +
|
||||||
|
(endDate == null ? 0 : endDate!.hashCode) +
|
||||||
|
(parcoursIds == null ? 0 : parcoursIds!.hashCode) +
|
||||||
|
(programme == null ? 0 : programme!.hashCode);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() =>
|
||||||
|
'SectionEventDTO[id=$id, label=$label, title=$title, description=$description, isActive=$isActive, imageId=$imageId, imageSource=$imageSource, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, dateCreation=$dateCreation, order=$order, instanceId=$instanceId, latitude=$latitude, longitude=$longitude, meterZoneGPS=$meterZoneGPS, isBeacon=$isBeacon, beaconId=$beaconId, startDate=$startDate, endDate=$endDate, parcoursIds=$parcoursIds, programme=$programme]';
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final json = <String, dynamic>{};
|
||||||
|
if (this.id != null) {
|
||||||
|
json[r'id'] = this.id;
|
||||||
|
} else {
|
||||||
|
json[r'id'] = null;
|
||||||
|
}
|
||||||
|
if (this.label != null) {
|
||||||
|
json[r'label'] = this.label;
|
||||||
|
} else {
|
||||||
|
json[r'label'] = null;
|
||||||
|
}
|
||||||
|
if (this.title != null) {
|
||||||
|
json[r'title'] = this.title;
|
||||||
|
} else {
|
||||||
|
json[r'title'] = null;
|
||||||
|
}
|
||||||
|
if (this.description != null) {
|
||||||
|
json[r'description'] = this.description;
|
||||||
|
} else {
|
||||||
|
json[r'description'] = null;
|
||||||
|
}
|
||||||
|
if (this.isActive != null) {
|
||||||
|
json[r'isActive'] = this.isActive;
|
||||||
|
} else {
|
||||||
|
json[r'isActive'] = null;
|
||||||
|
}
|
||||||
|
if (this.imageId != null) {
|
||||||
|
json[r'imageId'] = this.imageId;
|
||||||
|
} else {
|
||||||
|
json[r'imageId'] = null;
|
||||||
|
}
|
||||||
|
if (this.imageSource != null) {
|
||||||
|
json[r'imageSource'] = this.imageSource;
|
||||||
|
} else {
|
||||||
|
json[r'imageSource'] = null;
|
||||||
|
}
|
||||||
|
if (this.configurationId != null) {
|
||||||
|
json[r'configurationId'] = this.configurationId;
|
||||||
|
} else {
|
||||||
|
json[r'configurationId'] = null;
|
||||||
|
}
|
||||||
|
if (this.isSubSection != null) {
|
||||||
|
json[r'isSubSection'] = this.isSubSection;
|
||||||
|
} else {
|
||||||
|
json[r'isSubSection'] = null;
|
||||||
|
}
|
||||||
|
if (this.parentId != null) {
|
||||||
|
json[r'parentId'] = this.parentId;
|
||||||
|
} else {
|
||||||
|
json[r'parentId'] = null;
|
||||||
|
}
|
||||||
|
if (this.type != null) {
|
||||||
|
json[r'type'] = this.type;
|
||||||
|
} else {
|
||||||
|
json[r'type'] = null;
|
||||||
|
}
|
||||||
|
if (this.dateCreation != null) {
|
||||||
|
json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
|
||||||
|
} else {
|
||||||
|
json[r'dateCreation'] = null;
|
||||||
|
}
|
||||||
|
if (this.order != null) {
|
||||||
|
json[r'order'] = this.order;
|
||||||
|
} else {
|
||||||
|
json[r'order'] = null;
|
||||||
|
}
|
||||||
|
if (this.instanceId != null) {
|
||||||
|
json[r'instanceId'] = this.instanceId;
|
||||||
|
} else {
|
||||||
|
json[r'instanceId'] = null;
|
||||||
|
}
|
||||||
|
if (this.latitude != null) {
|
||||||
|
json[r'latitude'] = this.latitude;
|
||||||
|
} else {
|
||||||
|
json[r'latitude'] = null;
|
||||||
|
}
|
||||||
|
if (this.longitude != null) {
|
||||||
|
json[r'longitude'] = this.longitude;
|
||||||
|
} else {
|
||||||
|
json[r'longitude'] = null;
|
||||||
|
}
|
||||||
|
if (this.meterZoneGPS != null) {
|
||||||
|
json[r'meterZoneGPS'] = this.meterZoneGPS;
|
||||||
|
} else {
|
||||||
|
json[r'meterZoneGPS'] = null;
|
||||||
|
}
|
||||||
|
if (this.isBeacon != null) {
|
||||||
|
json[r'isBeacon'] = this.isBeacon;
|
||||||
|
} else {
|
||||||
|
json[r'isBeacon'] = null;
|
||||||
|
}
|
||||||
|
if (this.beaconId != null) {
|
||||||
|
json[r'beaconId'] = this.beaconId;
|
||||||
|
} else {
|
||||||
|
json[r'beaconId'] = null;
|
||||||
|
}
|
||||||
|
if (this.startDate != null) {
|
||||||
|
json[r'startDate'] = this.startDate!.toUtc().toIso8601String();
|
||||||
|
} else {
|
||||||
|
json[r'startDate'] = null;
|
||||||
|
}
|
||||||
|
if (this.endDate != null) {
|
||||||
|
json[r'endDate'] = this.endDate!.toUtc().toIso8601String();
|
||||||
|
} else {
|
||||||
|
json[r'endDate'] = null;
|
||||||
|
}
|
||||||
|
if (this.parcoursIds != null) {
|
||||||
|
json[r'parcoursIds'] = this.parcoursIds;
|
||||||
|
} else {
|
||||||
|
json[r'parcoursIds'] = null;
|
||||||
|
}
|
||||||
|
if (this.programme != null) {
|
||||||
|
json[r'programme'] = this.programme;
|
||||||
|
} else {
|
||||||
|
json[r'programme'] = null;
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns a new [SectionEventDTO] instance and imports its values from
|
||||||
|
/// [value] if it's a [Map], null otherwise.
|
||||||
|
// ignore: prefer_constructors_over_static_methods
|
||||||
|
static SectionEventDTO? fromJson(dynamic value) {
|
||||||
|
if (value is Map) {
|
||||||
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
requiredKeys.forEach((key) {
|
||||||
|
assert(json.containsKey(key),
|
||||||
|
'Required key "SectionEventDTO[$key]" is missing from JSON.');
|
||||||
|
assert(json[key] != null,
|
||||||
|
'Required key "SectionEventDTO[$key]" has a null value in JSON.');
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
|
return SectionEventDTO(
|
||||||
|
id: mapValueOfType<String>(json, r'id'),
|
||||||
|
label: mapValueOfType<String>(json, r'label'),
|
||||||
|
title: TranslationDTO.listFromJson(json[r'title']),
|
||||||
|
description: TranslationDTO.listFromJson(json[r'description']),
|
||||||
|
isActive: mapValueOfType<bool>(json, r'isActive'),
|
||||||
|
imageId: mapValueOfType<String>(json, r'imageId'),
|
||||||
|
imageSource: mapValueOfType<String>(json, r'imageSource'),
|
||||||
|
configurationId: mapValueOfType<String>(json, r'configurationId'),
|
||||||
|
isSubSection: mapValueOfType<bool>(json, r'isSubSection'),
|
||||||
|
parentId: mapValueOfType<String>(json, r'parentId'),
|
||||||
|
type: SectionType.fromJson(json[r'type']),
|
||||||
|
dateCreation: mapDateTime(json, r'dateCreation', r''),
|
||||||
|
order: mapValueOfType<int>(json, r'order'),
|
||||||
|
instanceId: mapValueOfType<String>(json, r'instanceId'),
|
||||||
|
latitude: mapValueOfType<String>(json, r'latitude'),
|
||||||
|
longitude: mapValueOfType<String>(json, r'longitude'),
|
||||||
|
meterZoneGPS: mapValueOfType<int>(json, r'meterZoneGPS'),
|
||||||
|
isBeacon: mapValueOfType<bool>(json, r'isBeacon'),
|
||||||
|
beaconId: mapValueOfType<int>(json, r'beaconId'),
|
||||||
|
startDate: mapDateTime(json, r'startDate', r''),
|
||||||
|
endDate: mapDateTime(json, r'endDate', r''),
|
||||||
|
parcoursIds: json[r'parcoursIds'] is Iterable
|
||||||
|
? (json[r'parcoursIds'] as Iterable)
|
||||||
|
.cast<String>()
|
||||||
|
.toList(growable: false)
|
||||||
|
: const [],
|
||||||
|
programme: ProgrammeBlock.listFromJson(json[r'programme']),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
static List<SectionEventDTO> listFromJson(
|
||||||
|
dynamic json, {
|
||||||
|
bool growable = false,
|
||||||
|
}) {
|
||||||
|
final result = <SectionEventDTO>[];
|
||||||
|
if (json is List && json.isNotEmpty) {
|
||||||
|
for (final row in json) {
|
||||||
|
final value = SectionEventDTO.fromJson(row);
|
||||||
|
if (value != null) {
|
||||||
|
result.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.toList(growable: growable);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Map<String, SectionEventDTO> mapFromJson(dynamic json) {
|
||||||
|
final map = <String, SectionEventDTO>{};
|
||||||
|
if (json is Map && json.isNotEmpty) {
|
||||||
|
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||||
|
for (final entry in json.entries) {
|
||||||
|
final value = SectionEventDTO.fromJson(entry.value);
|
||||||
|
if (value != null) {
|
||||||
|
map[entry.key] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
// maps a json object with a list of SectionEventDTO-objects as value to a dart map
|
||||||
|
static Map<String, List<SectionEventDTO>> mapListFromJson(
|
||||||
|
dynamic json, {
|
||||||
|
bool growable = false,
|
||||||
|
}) {
|
||||||
|
final map = <String, List<SectionEventDTO>>{};
|
||||||
|
if (json is Map && json.isNotEmpty) {
|
||||||
|
// ignore: parameter_assignments
|
||||||
|
json = json.cast<String, dynamic>();
|
||||||
|
for (final entry in json.entries) {
|
||||||
|
map[entry.key] = SectionEventDTO.listFromJson(
|
||||||
|
entry.value,
|
||||||
|
growable: growable,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The list of required keys that must be present in a JSON.
|
||||||
|
static const requiredKeys = <String>{};
|
||||||
|
}
|
||||||
@ -630,7 +630,7 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "0.15.4"
|
version: "0.15.4"
|
||||||
http:
|
http:
|
||||||
dependency: transitive
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: http
|
name: http
|
||||||
sha256: "2c11f3f94c687ee9bad77c171151672986360b2b001d109814ee7140b2cf261b"
|
sha256: "2c11f3f94c687ee9bad77c171151672986360b2b001d109814ee7140b2cf261b"
|
||||||
|
|||||||
@ -58,6 +58,7 @@ dependencies:
|
|||||||
#qr_code_scanner: ^1.0.1 #not in web
|
#qr_code_scanner: ^1.0.1 #not in web
|
||||||
mobile_scanner: ^4.0.0 # that replace qr_code_scanner..
|
mobile_scanner: ^4.0.0 # that replace qr_code_scanner..
|
||||||
|
|
||||||
|
http: ^1.2.0
|
||||||
sqflite: #not in web
|
sqflite: #not in web
|
||||||
just_audio_cache: ^0.1.2 #not in web
|
just_audio_cache: ^0.1.2 #not in web
|
||||||
#flutter_beacon: ^0.5.1 #not in web
|
#flutter_beacon: ^0.5.1 #not in web
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user