Update layout + remove Devices in menu

This commit is contained in:
Fransolet Thomas 2022-10-13 17:30:37 +02:00
parent 24ab7796e2
commit 164f904f13
15 changed files with 332 additions and 244 deletions

View File

@ -1,3 +1,4 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import '../constants.dart';
@ -7,12 +8,14 @@ class CheckInputContainer extends StatefulWidget {
final IconData icon;
final String label;
final ValueChanged<bool> onChanged;
final double fontSize;
const CheckInputContainer({
Key key,
this.isChecked,
this.icon,
this.label,
this.onChanged,
this.fontSize = 20
}) : super(key: key);
@override
@ -49,7 +52,13 @@ class _CheckInputContainerState extends State<CheckInputContainer> {
),
),
if(widget.label != null)
Text(widget.label, style: TextStyle(fontSize: 25, fontWeight: FontWeight.w300)),
AutoSizeText(
widget.label,
style: new TextStyle(fontSize: widget.fontSize, fontWeight: FontWeight.w300),
maxLines: 2,
maxFontSize: widget.fontSize,
textAlign: TextAlign.center,
),
],
)
),

View File

@ -1,14 +1,17 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:manager_app/Components/color_picker.dart';
class ColorPickerInputContainer extends StatefulWidget {
final String color;
final String label;
final double fontSize;
final ValueChanged<String> onChanged;
const ColorPickerInputContainer({
Key key,
this.color,
this.label,
this.fontSize = 25,
this.onChanged,
}) : super(key: key);
@ -34,7 +37,13 @@ class _ColorPickerInputContainerState extends State<ColorPickerInputContainer> {
children: [
Align(
alignment: AlignmentDirectional.centerStart,
child: Text(widget.label, style: TextStyle(fontSize: 25, fontWeight: FontWeight.w300))
child: AutoSizeText(
widget.label,
style: TextStyle(fontSize: widget.fontSize, fontWeight: FontWeight.w300),
maxLines: 2,
maxFontSize: widget.fontSize,
textAlign: TextAlign.center,
)
),
Padding(
padding: const EdgeInsets.all(10.0),

View File

@ -14,6 +14,7 @@ class ImageInputContainer extends StatefulWidget {
final ValueChanged<ResourceDTO> onChanged;
final BoxFit imageFit;
final bool isSmall;
final double fontSize;
const ImageInputContainer({
Key key,
this.color = kSecond,
@ -22,6 +23,7 @@ class ImageInputContainer extends StatefulWidget {
this.onChanged,
this.imageFit = BoxFit.cover,
this.isSmall = false,
this.fontSize = 25
}) : super(key: key);
@override
@ -45,30 +47,39 @@ class _ImageInputContainerState extends State<ImageInputContainer> {
children: [
Align(
alignment: AlignmentDirectional.centerStart,
child: Text(widget.label, style: TextStyle(fontSize: 25, fontWeight: FontWeight.w300))
child: AutoSizeText(
widget.label,
style: TextStyle(fontSize: widget.fontSize, fontWeight: FontWeight.w300),
maxLines: 2,
maxFontSize: widget.fontSize,
textAlign: TextAlign.center,
)
),
Padding(
padding: EdgeInsets.only(left: widget.isSmall ? 15 : 70, top: 10, bottom: 10),
child: Container(
width: size.width *0.08,
height: size.height *0.08,
child: InkWell(
onTap: () async {
var result = await showSelectResourceModal(
"Sélectionner une ressource",
1,
true,
context
);
Container(
//color: widget.isSmall ? Colors.cyanAccent: Colors.red,
child: Padding(
padding: EdgeInsets.only(left: widget.isSmall ? 5 : 10, top: 10, bottom: 10),
child: Container(
width: size.width *0.08,
height: size.width *0.08,
child: InkWell(
onTap: () async {
var result = await showSelectResourceModal(
"Sélectionner une ressource",
1,
true,
context
);
if (result != null) {
setState(() {
resourceIdToShow = result.id;
});
widget.onChanged(result);
}
},
child: getElement(widget.initialValue, context, widget.isSmall),
if (result != null) {
setState(() {
resourceIdToShow = result.id;
});
widget.onChanged(result);
}
},
child: getElement(widget.initialValue, context, widget.isSmall),
),
),
),
),
@ -86,14 +97,8 @@ class _ImageInputContainerState extends State<ImageInputContainer> {
builder: (context, AsyncSnapshot<dynamic> snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.data != null) {
return Transform.scale(
scale: isSmall ? size.aspectRatio * 0.5: size.aspectRatio * 0.9,
child: AspectRatio(
aspectRatio: 4/4,
child: Container(
decoration: boxDecoration(snapshot.data, appContext),
),
),
return Container(
decoration: boxDecoration(snapshot.data, appContext),
);
} else {
return Text("No data");
@ -115,7 +120,7 @@ class _ImageInputContainerState extends State<ImageInputContainer> {
return Container(
decoration: BoxDecoration(
color: widget.color,
borderRadius: BorderRadius.circular(50),
borderRadius: BorderRadius.circular(20),
),
child: Padding(
padding: const EdgeInsets.only(left: 5, right: 5, top: 15, bottom: 15),

View File

@ -1,3 +1,4 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:manager_app/constants.dart';
import 'package:multi_select_flutter/chip_display/multi_select_chip_display.dart';
@ -12,6 +13,7 @@ class MultiSelectDropdownContainer extends StatelessWidget {
final List<String> initialValue;
final bool isMultiple;
final bool isAtLeastOne;
final double fontSize;
final ValueChanged<List<dynamic>> onChanged;
const MultiSelectDropdownContainer({
Key key,
@ -21,6 +23,7 @@ class MultiSelectDropdownContainer extends StatelessWidget {
this.initialValue,
this.isMultiple,
this.isAtLeastOne = false,
this.fontSize = 25,
this.onChanged,
}) : super(key: key);
@ -32,7 +35,13 @@ class MultiSelectDropdownContainer extends StatelessWidget {
children: [
Align(
alignment: AlignmentDirectional.centerStart,
child: Text(label, style: TextStyle(fontSize: 25, fontWeight: FontWeight.w300))
child: AutoSizeText(
label,
style: TextStyle(fontSize: fontSize, fontWeight: FontWeight.w300),
maxLines: 2,
maxFontSize: fontSize,
textAlign: TextAlign.center,
)
),
Padding(
padding: const EdgeInsets.all(10.0),

View File

@ -14,6 +14,7 @@ class MultiStringContainer extends StatelessWidget {
final Function onGetResult;
final int maxLines;
final bool isTitle;
final double fontSize;
const MultiStringContainer({
Key key,
this.color = kSecond,
@ -23,6 +24,7 @@ class MultiStringContainer extends StatelessWidget {
this.onGetResult,
this.maxLines,
this.isTitle,
this.fontSize = 25,
}) : super(key: key);
@override
@ -34,7 +36,13 @@ class MultiStringContainer extends StatelessWidget {
children: [
Align(
alignment: AlignmentDirectional.centerStart,
child: Text(label, style: TextStyle(fontSize: 25, fontWeight: FontWeight.w300))
child: AutoSizeText(
label,
style: TextStyle(fontSize: fontSize, fontWeight: FontWeight.w300),
maxLines: 2,
maxFontSize: fontSize,
textAlign: TextAlign.center,
)
),
Padding(
padding: const EdgeInsets.all(10.0),

View File

@ -1,3 +1,4 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:manager_app/constants.dart';
@ -7,8 +8,8 @@ class RoundedButton extends StatelessWidget {
final IconData icon;
final Color color, textColor;
final double fontSize;
final int vertical;
final int horizontal;
final double vertical;
final double horizontal;
const RoundedButton({
Key key,
@ -49,10 +50,13 @@ class RoundedButton extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Center(
child: Text(
text,
style: new TextStyle(color: textColor, fontSize: fontSize, fontWeight: FontWeight.w400),
),
child: AutoSizeText(
text,
style: new TextStyle(color: textColor, fontSize: fontSize, fontWeight: FontWeight.w400),
maxLines: 2,
maxFontSize: fontSize,
textAlign: TextAlign.center,
),
),
SizedBox(
width: 10
@ -65,10 +69,12 @@ class RoundedButton extends StatelessWidget {
],
);
} else {
return Text(
text,
style: new TextStyle(color: textColor, fontSize: fontSize, fontWeight: FontWeight.w400),
);
return AutoSizeText(
text,
style: new TextStyle(color: textColor, fontSize: fontSize, fontWeight: FontWeight.w400),
maxLines: 2,
textAlign: TextAlign.center,
);
}
}
}

View File

@ -1,3 +1,4 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:manager_app/Components/rounded_input_field.dart';
import 'package:manager_app/constants.dart';
@ -33,7 +34,13 @@ class StringInputContainer extends StatelessWidget {
children: [
Align(
alignment: AlignmentDirectional.centerStart,
child: Text(label, style: TextStyle(fontSize: fontSize, fontWeight: FontWeight.w300))
child: AutoSizeText(
label,
style: TextStyle(fontSize: fontSize, fontWeight: FontWeight.w300),
maxLines: 2,
maxFontSize: fontSize,
textAlign: TextAlign.center,
),
),
Padding(
padding: const EdgeInsets.all(10.0),

View File

@ -70,174 +70,173 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
}
Widget bodySection(SectionDTO sectionDTO, Size size, AppContext appContext, BuildContext context) {
return Column(
//mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Container(
//color: Colors.orangeAccent,
height: 75,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Align(
alignment: AlignmentDirectional.bottomStart,
child: Padding(
padding: const EdgeInsets.all(3.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(
sectionDTO != null ? getSectionIcon(sectionDTO.type) : Icons.add,
color: kPrimaryColor,
size: 25,
return SingleChildScrollView(
child: Column(
//mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Container(
//color: Colors.orangeAccent,
height: 75,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Align(
alignment: AlignmentDirectional.bottomStart,
child: Padding(
padding: const EdgeInsets.all(3.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(
sectionDTO != null ? getSectionIcon(sectionDTO.type) : Icons.add,
color: kPrimaryColor,
size: 25,
),
),
Text(sectionDTO != null ? sectionDTO.label : "", style: TextStyle(fontSize: 30, fontWeight: FontWeight.w400)),
if(sectionDTO.type == SectionType.article)
DownloadPDF(sections: [sectionDTO]),
],
),
Padding(
padding: const EdgeInsets.all(5.0),
child: Text(sectionDTO != null ? DateFormat('dd/MM/yyyy').format(sectionDTO.dateCreation) : "", style: TextStyle(fontSize: 15, fontWeight: FontWeight.w200)),
),
],
),
)
),
Padding(
padding: const EdgeInsets.all(5.0),
child: Align(
alignment: AlignmentDirectional.centerEnd,
child: InkWell(
onTap: () {
ManagerAppContext managerAppContext = appContext.getContext();
managerAppContext.selectedSection = null;
appContext.setContext(managerAppContext);
},
child: Container(
child: Icon(
Icons.arrow_back,
color: kPrimaryColor,
size: 50.0,
)
)
),
),
)
],
),
), // TITLE
Container(
//color: Colors.blue,
child: Padding(
padding: const EdgeInsets.all(5.0),
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
if(sectionDTO.type == SectionType.article)
Container(
width: size.width *0.1,
height: 125,
child: QrImage(
data: sectionDTO.id,
version: QrVersions.auto,
size: 50.0,
),
),
Text(sectionDTO != null ? sectionDTO.label : "", style: TextStyle(fontSize: 30, fontWeight: FontWeight.w400)),
if(sectionDTO.type == SectionType.article)
DownloadPDF(sections: [sectionDTO]),
],
),
Padding(
padding: const EdgeInsets.all(5.0),
child: Text(sectionDTO != null ? DateFormat('dd/MM/yyyy').format(sectionDTO.dateCreation) : "", style: TextStyle(fontSize: 15, fontWeight: FontWeight.w200)),
),
],
),
)
),
Padding(
padding: const EdgeInsets.all(5.0),
child: Align(
alignment: AlignmentDirectional.centerEnd,
child: InkWell(
onTap: () {
ManagerAppContext managerAppContext = appContext.getContext();
managerAppContext.selectedSection = null;
appContext.setContext(managerAppContext);
},
child: Container(
child: Icon(
Icons.arrow_back,
color: kPrimaryColor,
size: 50.0,
)
)
),
),
)
],
),
), // TITLE
Container(
//color: Colors.blue,
child: Padding(
padding: const EdgeInsets.all(5.0),
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
if(sectionDTO.type == SectionType.article)
Container(
width: size.width *0.1,
height: 125,
child: QrImage(
data: sectionDTO.id,
version: QrVersions.auto,
size: 50.0,
),
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
StringInputContainer(
label: "Nom :",
initialValue: sectionDTO != null ? sectionDTO.label : "",
onChanged: (value) {
sectionDTO.label = value;
},
),
MultiStringContainer(
label: "Titre affiché:",
modalLabel: "Titre",
color: kPrimaryColor,
initialValue: sectionDTO != null ? sectionDTO.title : [],
onGetResult: (value) {
if (sectionDTO.title != value) {
sectionDTO.title = value;
save(true, sectionDTO, appContext);
}
},
maxLines: 1,
isTitle: true,
),
if(sectionDTO.type != SectionType.article)
Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
StringInputContainer(
label: "Nom :",
initialValue: sectionDTO != null ? sectionDTO.label : "",
onChanged: (value) {
sectionDTO.label = value;
},
),
MultiStringContainer(
label: "Description affichée:",
modalLabel: "Description",
label: "Titre affiché:",
modalLabel: "Titre",
color: kPrimaryColor,
initialValue: sectionDTO != null ? sectionDTO.description : [],
initialValue: sectionDTO != null ? sectionDTO.title : [],
onGetResult: (value) {
if (sectionDTO.description != value) {
sectionDTO.description = value;
if (sectionDTO.title != value) {
sectionDTO.title = value;
save(true, sectionDTO, appContext);
}
},
maxLines: 2,
maxLines: 1,
isTitle: true,
),
],
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ImageInputContainer(
label: "Image :",
initialValue: sectionDTO != null ? sectionDTO.imageId : "",
color: kPrimaryColor,
onChanged: (ResourceDTO resource) {
sectionDTO.imageId = resource.id;
sectionDTO.imageSource = resource.type == ResourceType.imageUrl ? resource.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resource.id;
},
),
],
)
],
if(sectionDTO.type != SectionType.article)
MultiStringContainer(
label: "Description affichée:",
modalLabel: "Description",
color: kPrimaryColor,
initialValue: sectionDTO != null ? sectionDTO.description : [],
onGetResult: (value) {
if (sectionDTO.description != value) {
sectionDTO.description = value;
save(true, sectionDTO, appContext);
}
},
maxLines: 2,
isTitle: true,
),
],
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ImageInputContainer(
label: "Image :",
initialValue: sectionDTO != null ? sectionDTO.imageId : "",
color: kPrimaryColor,
onChanged: (ResourceDTO resource) {
sectionDTO.imageId = resource.id;
sectionDTO.imageSource = resource.type == ResourceType.imageUrl ? resource.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resource.id;
},
),
],
)
],
),
),
),
],
],
),
),
),
),// FIELDS SECTION
Container(
//width: size.width * 0.8,
height: size.height * 0.5,
child: Padding(
padding: const EdgeInsets.all(10.0),
child: sectionDTO != null ? getSpecificData(sectionDTO, appContext) : null,
),
decoration: BoxDecoration(
//color: Colors.lightGreen,
borderRadius: BorderRadius.circular(30),
border: Border.all(width: 1.5, color: kSecond)
),
),
),// FIELDS SECTION
Container(
//width: size.width * 0.8,
height: size.height * 0.45,
child: Padding(
padding: const EdgeInsets.all(10.0),
child: sectionDTO != null ? getSpecificData(sectionDTO, appContext) : null,
),
decoration: BoxDecoration(
//color: Colors.lightGreen,
borderRadius: BorderRadius.circular(30),
border: Border.all(width: 1.5, color: kSecond)
),
),
SizedBox(
height: size.height*0.05,
)
],
],
),
);
}

View File

@ -26,7 +26,6 @@ import 'package:provider/provider.dart';
import 'package:intl/intl.dart';
import 'dart:html' as html;
class ConfigurationDetailScreen extends StatefulWidget {
final String id;
ConfigurationDetailScreen({Key key, @required this.id}) : super(key: key);
@ -65,10 +64,11 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
Widget bodyConfiguration(ConfigurationDTO configurationDTO, Size size, AppContext appContext, BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
//mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Container(
height: size.height *0.11,
//color: Colors.cyanAccent,
height: size.height *0.1,
child: SingleChildScrollView(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -145,7 +145,8 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
),
), // TITLE
Container(
//height: size.height *0.76,
height: size.height *0.78,
//color: Colors.red,
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(10.0),
@ -164,6 +165,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
children: [
StringInputContainer(
label: "Nom :",
fontSize: 20,
initialValue: configurationDTO.label,
onChanged: (value) {
configurationDTO.label = value;
@ -174,6 +176,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
initialValue: configurationDTO.languages != null ? configurationDTO.languages: [],
values: languages,
isMultiple: true,
fontSize: 20,
isAtLeastOne: true,
onChanged: (value) {
var tempOutput = new List<String>.from(value);
@ -209,6 +212,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
CheckInputContainer(
icon: Icons.signal_wifi_off,
label: "Hors ligne :",
fontSize: 20,
isChecked: configurationDTO.isOffline,
onChanged: (value) {
configurationDTO.isOffline = value;
@ -217,6 +221,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
CheckInputContainer(
icon: Icons.tablet,
label: "Tablette :",
fontSize: 20,
isChecked: configurationDTO.isTablet,
onChanged: (value) {
configurationDTO.isTablet = value;
@ -225,6 +230,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
CheckInputContainer(
icon: Icons.phone_android,
label: "MyVisit :",
fontSize: 20,
isChecked: configurationDTO.isMobile,
onChanged: (value) {
configurationDTO.isMobile = value;
@ -233,7 +239,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
if(configurationDTO.isMobile)
RoundedButton(
text: "Télécharger les QRCodes",
icon: Icons.download_outlined,
icon: Icons.qr_code,
color: Colors.grey,
textColor: Colors.white,
fontSize: 15,
@ -250,6 +256,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
if(!configurationDTO.isMobile)
ColorPickerInputContainer(
label: "Couleur fond d'écran :",
fontSize: 20,
color: configurationDTO.secondaryColor,
onChanged: (value) {
configurationDTO.secondaryColor = value;
@ -261,6 +268,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
child: MultiStringContainer(
label: "Titre affiché:",
modalLabel: "Titre",
fontSize: 20,
color: kPrimaryColor,
initialValue: configurationDTO != null ? configurationDTO.title : [],
onGetResult: (value) {
@ -274,6 +282,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
),
ImageInputContainer(
label: "Image :",
fontSize: 20,
initialValue: configurationDTO != null ? configurationDTO.imageId : "",
color: kPrimaryColor,
onChanged: (ResourceDTO resource) {
@ -320,7 +329,8 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
),
),// FIELDS SECTION
Container(
//height: size.height *0.09,
height: size.height *0.08,
//color: Colors.greenAccent,
child: SingleChildScrollView(
child: getButtons(configurationDTO, appContext)
)
@ -336,7 +346,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
mainAxisAlignment: MainAxisAlignment.end,
children: [
Padding(
padding: const EdgeInsets.all(10.0),
padding: const EdgeInsets.all(5.0),
child: RoundedButton(
text: "Annuler",
icon: Icons.undo,
@ -349,7 +359,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
),
),
Padding(
padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.all(5.0),
child: RoundedButton(
text: "Supprimer",
icon: Icons.delete,
@ -362,7 +372,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
),
),
Padding(
padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.all(5.0),
child: RoundedButton(
text: "Sauvegarder",
icon: Icons.done,

View File

@ -127,7 +127,7 @@ class _ConfigurationsScreenState extends State<ConfigurationsScreen> {
return Icon(
Icons.add,
color: kTextLightColor,
size: 100.0,
size: size.height*0.1,
);
}
}

View File

@ -117,17 +117,20 @@ class _SectionReorderListState extends State<SectionReorderList> {
Positioned(
bottom: -20,
left: 10,
child: StringInputContainer(
label: "Recherche:",
isSmall: true,
fontSize: 15,
fontSizeText: 15,
onChanged: (String value) {
setState(() {
filterSearch = value;
filterResource();
});
},
child: Container(
height: size.height*0.1,
child: StringInputContainer(
label: "Recherche test:",
isSmall: true,
fontSize: 15,
fontSizeText: 15,
onChanged: (String value) {
setState(() {
filterSearch = value;
filterResource();
});
},
),
),
),
Positioned(

View File

@ -26,9 +26,9 @@ class _BodyState extends State<Body> {
int currentPosition = 0;
var selectedElement;
MenuSection devices = new MenuSection(name: "Tablettes", type: "devices", order: 0);
MenuSection configurations = new MenuSection(name: "Configurations", type: "configurations", order: 1);
MenuSection resources = new MenuSection(name: "Ressources", type: "resources", order: 2);
//MenuSection devices = new MenuSection(name: "Test", type: "devices", order: 0);
MenuSection configurations = new MenuSection(name: "Configurations", type: "configurations", order: 0);
MenuSection resources = new MenuSection(name: "Ressources", type: "resources", order: 1);
Menu menu = new Menu(title: "MyMuseum");
@ -38,7 +38,7 @@ class _BodyState extends State<Body> {
Size size = MediaQuery.of(context).size;
menu.sections = <MenuSection>[];
menu.sections.add(devices);
//menu.sections.add(devices);
menu.sections.add(configurations);
menu.sections.add(resources);

View File

@ -1,3 +1,6 @@
import 'dart:html';
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:manager_app/Components/loading_common.dart';
import 'package:manager_app/Components/message_notification.dart';
@ -30,6 +33,7 @@ class _LoginScreenState extends State<LoginScreen> {
Client clientAPI;
bool isLoading = false;
bool isRememberMe = false;
String pageTitle = "MyMuseum";
void authenticateTRY(dynamic appContext) async {
//print("try auth.. ");
@ -113,8 +117,12 @@ class _LoginScreenState extends State<LoginScreen> {
@override
void initState() {
var url = window.location.href;
if(url.contains("fortsaintheribert")) {
this.pageTitle = "Fort de Saint Héribert";
}
this.isRememberMe = widget.session.rememberMe;
this.host = "http://localhost:5000"; // "http://localhost:5000" //widget.session.host; // MDLF "http://192.168.1.19:8089" // "https://api.mymuseum.be"
this.host = "https://api.mymuseum.be"; // "http://localhost:5000" //widget.session.host; // MDLF "http://192.168.1.19:8089" // "https://api.mymuseum.be"
//this.email = "test@email.be"; //widget.session.email;
//this.password = "kljqsdkljqsd"; //widget.session.password;
super.initState();
@ -130,7 +138,7 @@ class _LoginScreenState extends State<LoginScreen> {
child: SingleChildScrollView(
child: Container(
height: size.height *0.65,
width: size.width *0.5,
width: size.width *0.4,
decoration: BoxDecoration(
color: kWhite,
borderRadius: BorderRadius.circular(8.0),
@ -157,7 +165,14 @@ class _LoginScreenState extends State<LoginScreen> {
padding: const EdgeInsets.all(8.0),
child: Icon(Icons.museum_outlined, color: kPrimaryColor, size: size.height*0.08),
),
Text("MyMuseum", style: TextStyle(color: kPrimaryColor, fontSize: 45, fontFamily: "Helvetica")),
Center(
child: AutoSizeText(
pageTitle,
style: new TextStyle(color: kPrimaryColor, fontSize: 45, fontFamily: "Helvetica"),
maxLines: 2,
textAlign: TextAlign.center,
),
)
],
),
),
@ -169,20 +184,26 @@ class _LoginScreenState extends State<LoginScreen> {
initialValue: host,
icon: Icons.home
),*/
RoundedInputField(
hintText: "Email",
onChanged: (value) {
email = value;
},
icon: Icons.person,
initialValue: email,
isEmail: true,
SizedBox(
width: size.width*0.2,
child: RoundedInputField(
hintText: "Email",
onChanged: (value) {
email = value;
},
icon: Icons.person,
initialValue: email,
isEmail: true,
),
),
RoundedPasswordField(
initialValue: password,
onChanged: (value) {
password = value;
},
SizedBox(
width: size.width *0.2,
child: RoundedPasswordField(
initialValue: password,
onChanged: (value) {
password = value;
},
),
),
if(!kIsWeb) Padding(
padding: const EdgeInsets.all(8.0),
@ -210,6 +231,8 @@ class _LoginScreenState extends State<LoginScreen> {
!isLoading ? RoundedButton(
text: "LOGIN",
fontSize: 25,
vertical: 25,
horizontal: 45,
press: () {
authenticateTRY(appContext);
},

View File

@ -48,7 +48,7 @@ class _MyAppState extends State<MyApp> {
child: MaterialApp(
scrollBehavior: MyCustomScrollBehavior(),
debugShowCheckedModeBanner: false,
title: 'MyMuseum manager',
title: 'MyMuseum - Manager',
initialRoute: widget.initialRoute,
/*supportedLocales: [
const Locale('en', 'US'),

View File

@ -40,7 +40,7 @@
<meta name="msapplication-TileImage" content="icons/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<title>manager_app</title>
<title>MyMuseum - Manager</title>
<link rel="manifest" href="manifest.json">
</head>
<body>