Update menu to support drawer for mobile and added new submenu (application)
This commit is contained in:
parent
edd34ae849
commit
dc2ef710f8
@ -1,15 +1,17 @@
|
|||||||
class MenuSection {
|
class MenuSection {
|
||||||
String name;
|
String name;
|
||||||
String type;
|
String type;
|
||||||
int order;
|
int menuId;
|
||||||
|
List<MenuSection> subMenu;
|
||||||
|
|
||||||
MenuSection({required this.name, required this.type, required this.order});
|
MenuSection({required this.name, required this.type, required this.menuId, required this.subMenu});
|
||||||
|
|
||||||
factory MenuSection.fromJson(Map<String, dynamic> json) {
|
factory MenuSection.fromJson(Map<String, dynamic> json) {
|
||||||
return new MenuSection(
|
return new MenuSection(
|
||||||
name: json['name'] as String,
|
name: json['name'] as String,
|
||||||
type: json['type'] as String,
|
type: json['type'] as String,
|
||||||
order: json['order'] as int,
|
menuId: json['menuId'] as int,
|
||||||
|
subMenu: json['subMenu'] as List<MenuSection>,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17,12 +19,13 @@ class MenuSection {
|
|||||||
return {
|
return {
|
||||||
'name': name,
|
'name': name,
|
||||||
'type': type,
|
'type': type,
|
||||||
'order': order
|
'menuId': menuId,
|
||||||
|
'subMenu': subMenu
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return '{name: $name, type: $type, order: $order}';
|
return '{name: $name, type: $type, menuId: $menuId, subMenu: $subMenu}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
import 'dart:html';
|
import 'dart:html';
|
||||||
|
|
||||||
import 'package:auto_size_text/auto_size_text.dart';
|
import 'package:auto_size_text/auto_size_text.dart';
|
||||||
|
import 'package:collection/collection.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:manager_app/Models/managerContext.dart';
|
import 'package:manager_app/Models/managerContext.dart';
|
||||||
import 'package:manager_app/Models/menu.dart';
|
import 'package:manager_app/Models/menu.dart';
|
||||||
@ -16,201 +17,215 @@ import 'package:manager_app/main.dart';
|
|||||||
import 'package:manager_api_new/api.dart';
|
import 'package:manager_api_new/api.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
|
||||||
class Body extends StatefulWidget {
|
class Body extends StatefulWidget {
|
||||||
final bool showDevice;
|
final InstanceDTO instance;
|
||||||
Body({
|
Body({Key? key, required this.instance}) : super(key: key);
|
||||||
Key? key,
|
|
||||||
required this.showDevice
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_BodyState createState() => _BodyState();
|
_BodyState createState() => _BodyState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _BodyState extends State<Body> {
|
class _BodyState extends State<Body> {
|
||||||
bool isChecked = false;
|
late int currentPosition;
|
||||||
int currentPosition = 0;
|
|
||||||
var selectedElement;
|
|
||||||
late MenuSection devices;
|
late MenuSection devices;
|
||||||
late MenuSection configurations;
|
late MenuSection configurations;
|
||||||
late MenuSection resources;
|
late MenuSection resources;
|
||||||
|
|
||||||
Menu menu = new Menu(title: "MyInfoMate");
|
Menu menu = Menu(title: "MyInfoMate");
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
devices = new MenuSection(name: "Tablettes", type: "devices", order: 0);
|
|
||||||
configurations = new MenuSection(name: "Configurations", type: "configurations", order: widget.showDevice ? 1 : 0); // TODO Renommer spécifiquement en Visites pour St Heribert
|
|
||||||
resources = new MenuSection(name: "Ressources", type: "resources", order: widget.showDevice ? 2 : 1);
|
|
||||||
//tabsToShow.add(new Tab(text: "Vidéo en ligne"));
|
|
||||||
|
|
||||||
super.initState();
|
super.initState();
|
||||||
|
devices = MenuSection(name: "Applications", type: "devices", menuId: 0, subMenu: []);
|
||||||
|
if (widget.instance.isMobile!) devices.subMenu.add(MenuSection(name: "Mobile", type: "mobile", menuId: 1, subMenu: []));
|
||||||
|
if (widget.instance.isTablet!) devices.subMenu.add(MenuSection(name: "Kiosk", type: "kiosk", menuId: 2, subMenu: []));
|
||||||
|
if (widget.instance.isWeb!) devices.subMenu.add(MenuSection(name: "Web", type: "web", menuId: 3, subMenu: []));
|
||||||
|
if (widget.instance.isVR!) devices.subMenu.add(MenuSection(name: "VR", type: "vr", menuId: 4, subMenu: []));
|
||||||
|
|
||||||
|
configurations = MenuSection(name: "Configurations", type: "configurations", menuId: 5, subMenu: []);
|
||||||
|
resources = MenuSection(name: "Ressources", type: "resources", menuId: 6, subMenu: []);
|
||||||
|
|
||||||
|
menu.sections = [devices, configurations, resources];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget buildMenu(BuildContext context, AppContext appContext, ManagerAppContext managerAppContext, bool isDrawer) {
|
||||||
|
return Container(
|
||||||
|
width: isDrawer ? null : 250, // fixed width on sidebar, null on drawer for full width
|
||||||
|
color: kSecond,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
DrawerHeader(
|
||||||
|
child: Text(
|
||||||
|
menu.title,
|
||||||
|
style: TextStyle(color: kPrimaryColor, fontSize: 30, fontWeight: FontWeight.w400, fontFamily: "Helvetica"),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: ListView(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
children: menu.sections!.map((section) {
|
||||||
|
if (section.subMenu.isEmpty) {
|
||||||
|
return ListTile(
|
||||||
|
title: Text(section.name, style: TextStyle(color: section.menuId == currentPosition ? kPrimaryColor : kBodyTextColor, fontSize: 20)),
|
||||||
|
selected: currentPosition == section.menuId,
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
currentPosition = section.menuId;
|
||||||
|
selectedElement = initElementToShow(currentPosition, menu);
|
||||||
|
managerAppContext.currentPositionMenu = currentPosition;
|
||||||
|
appContext.setContext(managerAppContext);
|
||||||
|
});
|
||||||
|
if (isDrawer) Navigator.of(context).pop(); // Close drawer on mobile
|
||||||
|
},
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return ExpansionTile(
|
||||||
|
iconColor: currentPosition >= 1 && currentPosition <= 4 ? kPrimaryColor : kBodyTextColor,
|
||||||
|
collapsedIconColor: currentPosition >= 1 && currentPosition <= 4 ? kPrimaryColor : kBodyTextColor,
|
||||||
|
title: Text(section.name, style: TextStyle(color: currentPosition >= 1 && currentPosition <= 4 ? kPrimaryColor : kBodyTextColor, fontSize: 20)),
|
||||||
|
children: section.subMenu.map((subSection) {
|
||||||
|
return ListTile(
|
||||||
|
title: Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 16.0),
|
||||||
|
child: Text(subSection.name, style: TextStyle(color: subSection.menuId == currentPosition ? kPrimaryColor : kBodyTextColor, fontSize: 18)),
|
||||||
|
),
|
||||||
|
selected: currentPosition == subSection.menuId,
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
currentPosition = subSection.menuId;
|
||||||
|
selectedElement = initElementToShow(currentPosition, menu);
|
||||||
|
managerAppContext.currentPositionMenu = currentPosition;
|
||||||
|
appContext.setContext(managerAppContext);
|
||||||
|
});
|
||||||
|
if (isDrawer) Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}).toList(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// Footer: Email + Logout button
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
AutoSizeText(
|
||||||
|
(appContext.getContext() as ManagerAppContext).email ?? "",
|
||||||
|
style: TextStyle(color: kBodyTextColor, fontSize: 16, fontWeight: FontWeight.w300, fontFamily: "Helvetica"),
|
||||||
|
maxLines: 1,
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(Icons.logout, color: kPrimaryColor),
|
||||||
|
onPressed: () async {
|
||||||
|
var session = await loadJsonSessionFile();
|
||||||
|
setState(() {
|
||||||
|
Storage localStorage = window.localStorage;
|
||||||
|
localStorage.clear();
|
||||||
|
ManagerAppContext managerAppContext = appContext.getContext();
|
||||||
|
managerAppContext.accessToken = null;
|
||||||
|
appContext.setContext(managerAppContext);
|
||||||
|
Navigator.pushAndRemoveUntil(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (context) => LoginScreen(session: session)),
|
||||||
|
(route) => false,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
late Widget selectedElement;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final appContext = Provider.of<AppContext>(context);
|
final appContext = Provider.of<AppContext>(context);
|
||||||
Size size = MediaQuery.of(context).size;
|
|
||||||
|
|
||||||
menu.sections = <MenuSection>[];
|
|
||||||
|
|
||||||
if(widget.showDevice) // pour ne pas perturber francoise
|
|
||||||
{
|
|
||||||
menu.sections!.add(devices);
|
|
||||||
}
|
|
||||||
|
|
||||||
menu.sections!.add(configurations);
|
|
||||||
menu.sections!.add(resources);
|
|
||||||
|
|
||||||
ManagerAppContext managerAppContext = appContext.getContext();
|
ManagerAppContext managerAppContext = appContext.getContext();
|
||||||
|
|
||||||
currentPosition = managerAppContext.currentPositionMenu ?? currentPosition;
|
if(managerAppContext.currentPositionMenu == null) {
|
||||||
|
if (widget.instance.isMobile!) {
|
||||||
|
currentPosition = 1;
|
||||||
|
} else if (widget.instance.isTablet!) {
|
||||||
|
currentPosition = 2;
|
||||||
|
} else if (widget.instance.isWeb!) {
|
||||||
|
currentPosition = 3;
|
||||||
|
} else {
|
||||||
|
currentPosition = 4;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
currentPosition = managerAppContext.currentPositionMenu!;
|
||||||
|
}
|
||||||
|
|
||||||
selectedElement = initElementToShow(currentPosition, menu);
|
selectedElement = initElementToShow(currentPosition, menu);
|
||||||
|
|
||||||
|
Size size = MediaQuery.of(context).size;
|
||||||
|
bool isMobile = size.width < 700;
|
||||||
|
|
||||||
return Background(
|
return Scaffold(
|
||||||
child: Row(
|
appBar: isMobile
|
||||||
children: [
|
? AppBar(
|
||||||
if(true) //!ResponsiveBreakpoints.of(context).equals(TABLET)
|
title: Text(menu.title, style: TextStyle(color: kPrimaryColor)),
|
||||||
// MENU
|
backgroundColor: kSecond,
|
||||||
Container(
|
leading: Builder(
|
||||||
width: size.width * 0.15,
|
builder: (context) => IconButton(
|
||||||
decoration: BoxDecoration(
|
icon: Icon(Icons.menu, color: kPrimaryColor),
|
||||||
color: kSecond,
|
onPressed: () => Scaffold.of(context).openDrawer(),
|
||||||
borderRadius: BorderRadius.only(topRight: Radius.circular(20), bottomRight: Radius.circular(20)),
|
),
|
||||||
boxShadow: [
|
),
|
||||||
BoxShadow(
|
)
|
||||||
color: kSecond.withOpacity(0.3),
|
: null,
|
||||||
spreadRadius: 0.5,
|
drawer: isMobile ? Drawer(child: buildMenu(context, appContext, managerAppContext, true)) : null,
|
||||||
blurRadius: 0.5,
|
body: Row(
|
||||||
offset: Offset(0, 1.5), // changes position of shadow
|
children: [
|
||||||
),
|
if (!isMobile)
|
||||||
],
|
buildMenu(context, appContext, managerAppContext, false),
|
||||||
),
|
Expanded(
|
||||||
child: Column(
|
child: Padding(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
padding: const EdgeInsets.all(8.0),
|
||||||
children: <Widget>[
|
child: selectedElement,
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Container(
|
|
||||||
alignment: AlignmentDirectional.bottomStart,
|
|
||||||
child: AutoSizeText(
|
|
||||||
menu.title,
|
|
||||||
style: new TextStyle(color: kPrimaryColor, fontSize: 30, fontWeight: FontWeight.w400, fontFamily: "Helvetica"),
|
|
||||||
maxLines: 1,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
height: size.height * 0.2,
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
for (var section in menu.sections!)
|
|
||||||
InkWell(
|
|
||||||
onTap: () => {
|
|
||||||
setState(() {
|
|
||||||
currentPosition = section.order;
|
|
||||||
selectedElement = initElementToShow(currentPosition, menu);
|
|
||||||
managerAppContext.currentPositionMenu = currentPosition;
|
|
||||||
appContext.setContext(managerAppContext);
|
|
||||||
})
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
alignment: AlignmentDirectional.bottomStart,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: currentPosition == section.order ? Border(
|
|
||||||
right: BorderSide(
|
|
||||||
color: kPrimaryColor,
|
|
||||||
width: 4,
|
|
||||||
),
|
|
||||||
): null,
|
|
||||||
),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 10),
|
|
||||||
child: AutoSizeText(
|
|
||||||
section.name,
|
|
||||||
style: new TextStyle(color: kBodyTextColor, fontSize: 25, fontWeight: FontWeight.w300, fontFamily: "Helvetica"),
|
|
||||||
maxLines: 1,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: size.height * 0.35,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
AutoSizeText(
|
|
||||||
(appContext.getContext() as ManagerAppContext).email!,
|
|
||||||
style: new TextStyle(color: kBodyTextColor, fontSize: 20, fontWeight: FontWeight.w300, fontFamily: "Helvetica"),
|
|
||||||
maxLines: 1,
|
|
||||||
),
|
|
||||||
IconButton(
|
|
||||||
icon: Icon(Icons.logout),
|
|
||||||
onPressed: () async {
|
|
||||||
var session = await loadJsonSessionFile();
|
|
||||||
|
|
||||||
setState(() {
|
|
||||||
print("Logout");
|
|
||||||
Storage localStorage = window.localStorage;
|
|
||||||
localStorage.clear();
|
|
||||||
ManagerAppContext managerAppContext = appContext.getContext();
|
|
||||||
managerAppContext.accessToken = null;
|
|
||||||
appContext.setContext(managerAppContext);
|
|
||||||
|
|
||||||
Navigator.pushAndRemoveUntil(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (context) {
|
|
||||||
return LoginScreen(session: session);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
(Route<dynamic> route) => false // For pushAndRemoveUntil
|
|
||||||
);
|
|
||||||
|
|
||||||
});
|
|
||||||
},
|
|
||||||
color: kPrimaryColor,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
// Main Container
|
|
||||||
Container(
|
|
||||||
width: size.width * 0.85,//!ResponsiveBreakpoints.of(context).equals(TABLET) ? size.width * 0.85 : size.width,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(0.0),
|
|
||||||
child: selectedElement),
|
|
||||||
),
|
),
|
||||||
]
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
initElementToShow(int currentPosition, Menu menu) {
|
initElementToShow(int currentPosition, Menu menu) {
|
||||||
MenuSection elementToShow = menu.sections!.where((s) => s.order == currentPosition).first;
|
MenuSection? elementToShow = menu.sections!.firstWhereOrNull((s) => s.menuId == currentPosition);
|
||||||
|
|
||||||
|
if(elementToShow == null) {
|
||||||
|
elementToShow = menu.sections![0].subMenu.where((s) => s.menuId == currentPosition).first;
|
||||||
|
}
|
||||||
|
|
||||||
switch (elementToShow.type) {
|
switch (elementToShow.type) {
|
||||||
case 'devices' :
|
case 'mobile' :
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Text("TODO mobile")
|
||||||
|
);
|
||||||
|
case 'kiosk' :
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: DevicesScreen()
|
child: DevicesScreen()
|
||||||
);
|
);
|
||||||
|
case 'web' :
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Text("TODO web")
|
||||||
|
);
|
||||||
|
case 'vr' :
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Text("TODO vr")
|
||||||
|
);
|
||||||
case 'configurations' :
|
case 'configurations' :
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:manager_api_new/api.dart';
|
||||||
|
import 'package:manager_app/Components/common_loader.dart';
|
||||||
import 'package:manager_app/Models/managerContext.dart';
|
import 'package:manager_app/Models/managerContext.dart';
|
||||||
import 'package:manager_app/Models/menu.dart';
|
import 'package:manager_app/Models/menu.dart';
|
||||||
import 'package:manager_app/Models/menuSection.dart';
|
import 'package:manager_app/Models/menuSection.dart';
|
||||||
@ -19,66 +21,43 @@ class _MainScreenState extends State<MainScreen> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final GlobalKey<_MainScreenState> key = GlobalKey();
|
final GlobalKey<_MainScreenState> key = GlobalKey();
|
||||||
|
|
||||||
final appContext = Provider.of<AppContext>(context);
|
final appContext = Provider.of<AppContext>(context);
|
||||||
|
Size size = MediaQuery.of(context).size;
|
||||||
ManagerAppContext managerAppContext = appContext.getContext();
|
ManagerAppContext managerAppContext = appContext.getContext();
|
||||||
|
|
||||||
var isFortSt = managerAppContext.instanceId == "633ee379d9405f32f166f047";
|
//var isFortSt = managerAppContext.instanceId == "633ee379d9405f32f166f047";
|
||||||
|
|
||||||
if(!ResponsiveBreakpoints.of(context).equals(TABLET) || isFortSt) {
|
return FutureBuilder(
|
||||||
return Scaffold(
|
future: getInstanceInfo(managerAppContext),
|
||||||
key: key,
|
builder: (context, AsyncSnapshot<InstanceDTO?> snapshot) {
|
||||||
body: Body(showDevice: !isFortSt),
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
);
|
if (snapshot.data != null) {
|
||||||
} else {
|
var instanceDTO = snapshot.data;
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
key: key,
|
key: key,
|
||||||
appBar: AppBar(title: Text("MyInfoMate", style: new TextStyle(color: kPrimaryColor, fontSize: 30, fontWeight: FontWeight.w400, fontFamily: "Helvetica")), backgroundColor: kSecond.withOpacity(0.3), iconTheme: IconThemeData(color: kPrimaryColor)),
|
body: Body(instance: instanceDTO!),
|
||||||
drawer: Drawer(
|
);
|
||||||
child: getMenu()
|
} else {
|
||||||
),
|
return Text("No data");
|
||||||
body: Body(showDevice: isFortSt),
|
}
|
||||||
);
|
} else if (snapshot.connectionState == ConnectionState.none) {
|
||||||
}
|
return Text("No data");
|
||||||
|
} else {
|
||||||
}
|
return Center(
|
||||||
|
child: Container(
|
||||||
getMenu() {
|
height: size.height * 0.1,
|
||||||
MenuSection devices = new MenuSection(name: "Tablettes", type: "devices", order: 0);
|
child: CommonLoader()
|
||||||
MenuSection configurations = new MenuSection(name: "Configurations", type: "configurations", order: 1); // TODO Visites pour Fort St Héribert
|
)
|
||||||
MenuSection resources = new MenuSection(name: "Ressources", type: "resources", order: 2);
|
);
|
||||||
|
}
|
||||||
Menu menu = new Menu(title: "MyInfoMate");
|
}
|
||||||
|
|
||||||
return ListView(
|
|
||||||
// Important: Remove any padding from the ListView.
|
|
||||||
padding: EdgeInsets.zero,
|
|
||||||
children: [
|
|
||||||
DrawerHeader(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: kPrimaryColor,
|
|
||||||
),
|
|
||||||
child: Text(menu.title),
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
title: Text(devices.name),
|
|
||||||
onTap: () {
|
|
||||||
// TODO Navigate to configurations screen (by route if possible)
|
|
||||||
},
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
title: Text(configurations.name),
|
|
||||||
onTap: () {
|
|
||||||
// TODO Navigate to configurations screen (by route if possible)
|
|
||||||
},
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
title: Text(resources.name),
|
|
||||||
onTap: () {
|
|
||||||
// TODO Navigate to resources screen (by route if possible)
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<InstanceDTO?> getInstanceInfo(ManagerAppContext managerAppContext) async {
|
||||||
|
InstanceDTO? instance = await managerAppContext.clientAPI!.instanceApi!.instanceGetDetail(managerAppContext.instanceId!);
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -254,7 +254,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: kWhite.withOpacity(0.3),
|
color: kWhite.withValues(alpha: 0.3),
|
||||||
spreadRadius: 0.5,
|
spreadRadius: 0.5,
|
||||||
blurRadius: 0.5,
|
blurRadius: 0.5,
|
||||||
offset: Offset(0, 1.5), // changes position of shadow
|
offset: Offset(0, 1.5), // changes position of shadow
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
// Openapi Generator last run: : 2025-07-17T12:00:29.078649
|
// Openapi Generator last run: : 2025-08-01T15:25:28.408371
|
||||||
import 'package:openapi_generator_annotations/openapi_generator_annotations.dart';
|
import 'package:openapi_generator_annotations/openapi_generator_annotations.dart';
|
||||||
|
|
||||||
@Openapi(
|
@Openapi(
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
"info": {
|
"info": {
|
||||||
"title": "Manager Service",
|
"title": "Manager Service",
|
||||||
"description": "API Manager Service",
|
"description": "API Manager Service",
|
||||||
"version": "Version Alpha 0.1"
|
"version": "Version Alpha"
|
||||||
},
|
},
|
||||||
"servers": [
|
"servers": [
|
||||||
{
|
{
|
||||||
@ -7078,6 +7078,9 @@
|
|||||||
"isTablet": {
|
"isTablet": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
"isWeb": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"isVR": {
|
"isVR": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
@ -7116,6 +7119,9 @@
|
|||||||
"isTablet": {
|
"isTablet": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
"isWeb": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"isVR": {
|
"isVR": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,6 +11,9 @@ class Client {
|
|||||||
UserApi? _userApi;
|
UserApi? _userApi;
|
||||||
UserApi? get userApi => _userApi;
|
UserApi? get userApi => _userApi;
|
||||||
|
|
||||||
|
InstanceApi? _instanceApi;
|
||||||
|
InstanceApi? get instanceApi => _instanceApi;
|
||||||
|
|
||||||
ConfigurationApi? _configurationApi;
|
ConfigurationApi? _configurationApi;
|
||||||
ConfigurationApi? get configurationApi => _configurationApi;
|
ConfigurationApi? get configurationApi => _configurationApi;
|
||||||
|
|
||||||
@ -36,6 +39,7 @@ class Client {
|
|||||||
//basePath: "https://localhost:44339");
|
//basePath: "https://localhost:44339");
|
||||||
_apiClient!.addDefaultHeader("Access-Control_Allow_Origin", "*");
|
_apiClient!.addDefaultHeader("Access-Control_Allow_Origin", "*");
|
||||||
_authenticationApi = AuthenticationApi(_apiClient);
|
_authenticationApi = AuthenticationApi(_apiClient);
|
||||||
|
_instanceApi = InstanceApi(_apiClient);
|
||||||
_userApi = UserApi(_apiClient);
|
_userApi = UserApi(_apiClient);
|
||||||
_configurationApi = ConfigurationApi(_apiClient);
|
_configurationApi = ConfigurationApi(_apiClient);
|
||||||
_sectionApi = SectionApi(_apiClient);
|
_sectionApi = SectionApi(_apiClient);
|
||||||
|
|||||||
@ -261,64 +261,3 @@ lib/model/video_dto.dart
|
|||||||
lib/model/weather_dto.dart
|
lib/model/weather_dto.dart
|
||||||
lib/model/web_dto.dart
|
lib/model/web_dto.dart
|
||||||
pubspec.yaml
|
pubspec.yaml
|
||||||
test/app_configuration_link_application_instance_test.dart
|
|
||||||
test/app_configuration_link_configuration_test.dart
|
|
||||||
test/app_configuration_link_dto_test.dart
|
|
||||||
test/app_configuration_link_test.dart
|
|
||||||
test/app_type_test.dart
|
|
||||||
test/application_instance_dto_test.dart
|
|
||||||
test/application_instance_section_event_test.dart
|
|
||||||
test/application_instance_test.dart
|
|
||||||
test/configuration_test.dart
|
|
||||||
test/coordinate_equality_comparer_test.dart
|
|
||||||
test/coordinate_sequence_factory_test.dart
|
|
||||||
test/coordinate_sequence_test.dart
|
|
||||||
test/coordinate_test.dart
|
|
||||||
test/dimension_test.dart
|
|
||||||
test/envelope_test.dart
|
|
||||||
test/event_address_dto_geometry_test.dart
|
|
||||||
test/event_address_dto_test.dart
|
|
||||||
test/event_agenda_dto_address_test.dart
|
|
||||||
test/event_agenda_dto_resource_test.dart
|
|
||||||
test/event_agenda_dto_test.dart
|
|
||||||
test/geometry_centroid_test.dart
|
|
||||||
test/geometry_dto_test.dart
|
|
||||||
test/geometry_envelope_internal_test.dart
|
|
||||||
test/geometry_factory_coordinate_sequence_factory_test.dart
|
|
||||||
test/geometry_factory_geometry_services_test.dart
|
|
||||||
test/geometry_factory_test.dart
|
|
||||||
test/geometry_precision_model_test.dart
|
|
||||||
test/geometry_test.dart
|
|
||||||
test/geometry_type_test.dart
|
|
||||||
test/guided_path_dto_test.dart
|
|
||||||
test/guided_path_section_map_test.dart
|
|
||||||
test/guided_path_test.dart
|
|
||||||
test/guided_step_dto_test.dart
|
|
||||||
test/guided_step_dto_trigger_geo_point_test.dart
|
|
||||||
test/guided_step_guided_path_test.dart
|
|
||||||
test/guided_step_test.dart
|
|
||||||
test/guided_step_trigger_geo_point_test.dart
|
|
||||||
test/layout_main_page_type_test.dart
|
|
||||||
test/map_annotation_dto_test.dart
|
|
||||||
test/map_annotation_geometry_test.dart
|
|
||||||
test/map_annotation_icon_resource_test.dart
|
|
||||||
test/map_annotation_test.dart
|
|
||||||
test/nts_geometry_services_coordinate_equality_comparer_test.dart
|
|
||||||
test/nts_geometry_services_geometry_overlay_test.dart
|
|
||||||
test/nts_geometry_services_test.dart
|
|
||||||
test/ogc_geometry_type_test.dart
|
|
||||||
test/ordinates_test.dart
|
|
||||||
test/point_all_of_boundary_test.dart
|
|
||||||
test/point_all_of_coordinate_sequence_test.dart
|
|
||||||
test/point_all_of_coordinate_test.dart
|
|
||||||
test/point_test.dart
|
|
||||||
test/precision_model_test.dart
|
|
||||||
test/precision_models_test.dart
|
|
||||||
test/programme_block_dto_test.dart
|
|
||||||
test/programme_block_test.dart
|
|
||||||
test/question_type_test.dart
|
|
||||||
test/quiz_question_guided_step_test.dart
|
|
||||||
test/section_agenda_api_test.dart
|
|
||||||
test/section_event_api_test.dart
|
|
||||||
test/section_event_dto_test.dart
|
|
||||||
test/section_event_test.dart
|
|
||||||
|
|||||||
@ -16,6 +16,7 @@ Name | Type | Description | Notes
|
|||||||
**isStatistic** | **bool** | | [optional]
|
**isStatistic** | **bool** | | [optional]
|
||||||
**isMobile** | **bool** | | [optional]
|
**isMobile** | **bool** | | [optional]
|
||||||
**isTablet** | **bool** | | [optional]
|
**isTablet** | **bool** | | [optional]
|
||||||
|
**isWeb** | **bool** | | [optional]
|
||||||
**isVR** | **bool** | | [optional]
|
**isVR** | **bool** | | [optional]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|||||||
@ -16,6 +16,7 @@ Name | Type | Description | Notes
|
|||||||
**isStatistic** | **bool** | | [optional]
|
**isStatistic** | **bool** | | [optional]
|
||||||
**isMobile** | **bool** | | [optional]
|
**isMobile** | **bool** | | [optional]
|
||||||
**isTablet** | **bool** | | [optional]
|
**isTablet** | **bool** | | [optional]
|
||||||
|
**isWeb** | **bool** | | [optional]
|
||||||
**isVR** | **bool** | | [optional]
|
**isVR** | **bool** | | [optional]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|||||||
@ -21,6 +21,7 @@ class Instance {
|
|||||||
this.isStatistic,
|
this.isStatistic,
|
||||||
this.isMobile,
|
this.isMobile,
|
||||||
this.isTablet,
|
this.isTablet,
|
||||||
|
this.isWeb,
|
||||||
this.isVR,
|
this.isVR,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -70,6 +71,14 @@ class Instance {
|
|||||||
///
|
///
|
||||||
bool? isTablet;
|
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
|
/// 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
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
@ -90,6 +99,7 @@ class Instance {
|
|||||||
other.isStatistic == isStatistic &&
|
other.isStatistic == isStatistic &&
|
||||||
other.isMobile == isMobile &&
|
other.isMobile == isMobile &&
|
||||||
other.isTablet == isTablet &&
|
other.isTablet == isTablet &&
|
||||||
|
other.isWeb == isWeb &&
|
||||||
other.isVR == isVR;
|
other.isVR == isVR;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -103,11 +113,12 @@ class Instance {
|
|||||||
(isStatistic == null ? 0 : isStatistic!.hashCode) +
|
(isStatistic == null ? 0 : isStatistic!.hashCode) +
|
||||||
(isMobile == null ? 0 : isMobile!.hashCode) +
|
(isMobile == null ? 0 : isMobile!.hashCode) +
|
||||||
(isTablet == null ? 0 : isTablet!.hashCode) +
|
(isTablet == null ? 0 : isTablet!.hashCode) +
|
||||||
|
(isWeb == null ? 0 : isWeb!.hashCode) +
|
||||||
(isVR == null ? 0 : isVR!.hashCode);
|
(isVR == null ? 0 : isVR!.hashCode);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() =>
|
String toString() =>
|
||||||
'Instance[id=$id, name=$name, dateCreation=$dateCreation, pinCode=$pinCode, isPushNotification=$isPushNotification, isStatistic=$isStatistic, isMobile=$isMobile, isTablet=$isTablet, isVR=$isVR]';
|
'Instance[id=$id, name=$name, dateCreation=$dateCreation, pinCode=$pinCode, isPushNotification=$isPushNotification, isStatistic=$isStatistic, isMobile=$isMobile, isTablet=$isTablet, isWeb=$isWeb, isVR=$isVR]';
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final json = <String, dynamic>{};
|
final json = <String, dynamic>{};
|
||||||
@ -143,6 +154,11 @@ class Instance {
|
|||||||
} else {
|
} else {
|
||||||
json[r'isTablet'] = null;
|
json[r'isTablet'] = null;
|
||||||
}
|
}
|
||||||
|
if (this.isWeb != null) {
|
||||||
|
json[r'isWeb'] = this.isWeb;
|
||||||
|
} else {
|
||||||
|
json[r'isWeb'] = null;
|
||||||
|
}
|
||||||
if (this.isVR != null) {
|
if (this.isVR != null) {
|
||||||
json[r'isVR'] = this.isVR;
|
json[r'isVR'] = this.isVR;
|
||||||
} else {
|
} else {
|
||||||
@ -180,6 +196,7 @@ class Instance {
|
|||||||
isStatistic: mapValueOfType<bool>(json, r'isStatistic'),
|
isStatistic: mapValueOfType<bool>(json, r'isStatistic'),
|
||||||
isMobile: mapValueOfType<bool>(json, r'isMobile'),
|
isMobile: mapValueOfType<bool>(json, r'isMobile'),
|
||||||
isTablet: mapValueOfType<bool>(json, r'isTablet'),
|
isTablet: mapValueOfType<bool>(json, r'isTablet'),
|
||||||
|
isWeb: mapValueOfType<bool>(json, r'isWeb'),
|
||||||
isVR: mapValueOfType<bool>(json, r'isVR'),
|
isVR: mapValueOfType<bool>(json, r'isVR'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,6 +21,7 @@ class InstanceDTO {
|
|||||||
this.isStatistic,
|
this.isStatistic,
|
||||||
this.isMobile,
|
this.isMobile,
|
||||||
this.isTablet,
|
this.isTablet,
|
||||||
|
this.isWeb,
|
||||||
this.isVR,
|
this.isVR,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -64,6 +65,14 @@ class InstanceDTO {
|
|||||||
///
|
///
|
||||||
bool? isTablet;
|
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
|
/// 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
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
@ -84,6 +93,7 @@ class InstanceDTO {
|
|||||||
other.isStatistic == isStatistic &&
|
other.isStatistic == isStatistic &&
|
||||||
other.isMobile == isMobile &&
|
other.isMobile == isMobile &&
|
||||||
other.isTablet == isTablet &&
|
other.isTablet == isTablet &&
|
||||||
|
other.isWeb == isWeb &&
|
||||||
other.isVR == isVR;
|
other.isVR == isVR;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -97,11 +107,12 @@ class InstanceDTO {
|
|||||||
(isStatistic == null ? 0 : isStatistic!.hashCode) +
|
(isStatistic == null ? 0 : isStatistic!.hashCode) +
|
||||||
(isMobile == null ? 0 : isMobile!.hashCode) +
|
(isMobile == null ? 0 : isMobile!.hashCode) +
|
||||||
(isTablet == null ? 0 : isTablet!.hashCode) +
|
(isTablet == null ? 0 : isTablet!.hashCode) +
|
||||||
|
(isWeb == null ? 0 : isWeb!.hashCode) +
|
||||||
(isVR == null ? 0 : isVR!.hashCode);
|
(isVR == null ? 0 : isVR!.hashCode);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() =>
|
String toString() =>
|
||||||
'InstanceDTO[id=$id, name=$name, dateCreation=$dateCreation, pinCode=$pinCode, isPushNotification=$isPushNotification, isStatistic=$isStatistic, isMobile=$isMobile, isTablet=$isTablet, isVR=$isVR]';
|
'InstanceDTO[id=$id, name=$name, dateCreation=$dateCreation, pinCode=$pinCode, isPushNotification=$isPushNotification, isStatistic=$isStatistic, isMobile=$isMobile, isTablet=$isTablet, isWeb=$isWeb, isVR=$isVR]';
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final json = <String, dynamic>{};
|
final json = <String, dynamic>{};
|
||||||
@ -145,6 +156,11 @@ class InstanceDTO {
|
|||||||
} else {
|
} else {
|
||||||
json[r'isTablet'] = null;
|
json[r'isTablet'] = null;
|
||||||
}
|
}
|
||||||
|
if (this.isWeb != null) {
|
||||||
|
json[r'isWeb'] = this.isWeb;
|
||||||
|
} else {
|
||||||
|
json[r'isWeb'] = null;
|
||||||
|
}
|
||||||
if (this.isVR != null) {
|
if (this.isVR != null) {
|
||||||
json[r'isVR'] = this.isVR;
|
json[r'isVR'] = this.isVR;
|
||||||
} else {
|
} else {
|
||||||
@ -182,6 +198,7 @@ class InstanceDTO {
|
|||||||
isStatistic: mapValueOfType<bool>(json, r'isStatistic'),
|
isStatistic: mapValueOfType<bool>(json, r'isStatistic'),
|
||||||
isMobile: mapValueOfType<bool>(json, r'isMobile'),
|
isMobile: mapValueOfType<bool>(json, r'isMobile'),
|
||||||
isTablet: mapValueOfType<bool>(json, r'isTablet'),
|
isTablet: mapValueOfType<bool>(json, r'isTablet'),
|
||||||
|
isWeb: mapValueOfType<bool>(json, r'isWeb'),
|
||||||
isVR: mapValueOfType<bool>(json, r'isVR'),
|
isVR: mapValueOfType<bool>(json, r'isVR'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user