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 'package:flutter/material.dart';
import '../constants.dart'; import '../constants.dart';
@ -7,12 +8,14 @@ class CheckInputContainer extends StatefulWidget {
final IconData icon; final IconData icon;
final String label; final String label;
final ValueChanged<bool> onChanged; final ValueChanged<bool> onChanged;
final double fontSize;
const CheckInputContainer({ const CheckInputContainer({
Key key, Key key,
this.isChecked, this.isChecked,
this.icon, this.icon,
this.label, this.label,
this.onChanged, this.onChanged,
this.fontSize = 20
}) : super(key: key); }) : super(key: key);
@override @override
@ -49,7 +52,13 @@ class _CheckInputContainerState extends State<CheckInputContainer> {
), ),
), ),
if(widget.label != null) 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:flutter/material.dart';
import 'package:manager_app/Components/color_picker.dart'; import 'package:manager_app/Components/color_picker.dart';
class ColorPickerInputContainer extends StatefulWidget { class ColorPickerInputContainer extends StatefulWidget {
final String color; final String color;
final String label; final String label;
final double fontSize;
final ValueChanged<String> onChanged; final ValueChanged<String> onChanged;
const ColorPickerInputContainer({ const ColorPickerInputContainer({
Key key, Key key,
this.color, this.color,
this.label, this.label,
this.fontSize = 25,
this.onChanged, this.onChanged,
}) : super(key: key); }) : super(key: key);
@ -34,7 +37,13 @@ class _ColorPickerInputContainerState extends State<ColorPickerInputContainer> {
children: [ children: [
Align( Align(
alignment: AlignmentDirectional.centerStart, 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(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),

View File

@ -14,6 +14,7 @@ class ImageInputContainer extends StatefulWidget {
final ValueChanged<ResourceDTO> onChanged; final ValueChanged<ResourceDTO> onChanged;
final BoxFit imageFit; final BoxFit imageFit;
final bool isSmall; final bool isSmall;
final double fontSize;
const ImageInputContainer({ const ImageInputContainer({
Key key, Key key,
this.color = kSecond, this.color = kSecond,
@ -22,6 +23,7 @@ class ImageInputContainer extends StatefulWidget {
this.onChanged, this.onChanged,
this.imageFit = BoxFit.cover, this.imageFit = BoxFit.cover,
this.isSmall = false, this.isSmall = false,
this.fontSize = 25
}) : super(key: key); }) : super(key: key);
@override @override
@ -45,13 +47,21 @@ class _ImageInputContainerState extends State<ImageInputContainer> {
children: [ children: [
Align( Align(
alignment: AlignmentDirectional.centerStart, 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( Container(
padding: EdgeInsets.only(left: widget.isSmall ? 15 : 70, top: 10, bottom: 10), //color: widget.isSmall ? Colors.cyanAccent: Colors.red,
child: Padding(
padding: EdgeInsets.only(left: widget.isSmall ? 5 : 10, top: 10, bottom: 10),
child: Container( child: Container(
width: size.width *0.08, width: size.width *0.08,
height: size.height *0.08, height: size.width *0.08,
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
var result = await showSelectResourceModal( var result = await showSelectResourceModal(
@ -72,6 +82,7 @@ class _ImageInputContainerState extends State<ImageInputContainer> {
), ),
), ),
), ),
),
], ],
), ),
); );
@ -86,14 +97,8 @@ class _ImageInputContainerState extends State<ImageInputContainer> {
builder: (context, AsyncSnapshot<dynamic> snapshot) { builder: (context, AsyncSnapshot<dynamic> snapshot) {
if (snapshot.connectionState == ConnectionState.done) { if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.data != null) { if (snapshot.data != null) {
return Transform.scale( return Container(
scale: isSmall ? size.aspectRatio * 0.5: size.aspectRatio * 0.9,
child: AspectRatio(
aspectRatio: 4/4,
child: Container(
decoration: boxDecoration(snapshot.data, appContext), decoration: boxDecoration(snapshot.data, appContext),
),
),
); );
} else { } else {
return Text("No data"); return Text("No data");
@ -115,7 +120,7 @@ class _ImageInputContainerState extends State<ImageInputContainer> {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: widget.color, color: widget.color,
borderRadius: BorderRadius.circular(50), borderRadius: BorderRadius.circular(20),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.only(left: 5, right: 5, top: 15, bottom: 15), 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:flutter/material.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
import 'package:multi_select_flutter/chip_display/multi_select_chip_display.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 List<String> initialValue;
final bool isMultiple; final bool isMultiple;
final bool isAtLeastOne; final bool isAtLeastOne;
final double fontSize;
final ValueChanged<List<dynamic>> onChanged; final ValueChanged<List<dynamic>> onChanged;
const MultiSelectDropdownContainer({ const MultiSelectDropdownContainer({
Key key, Key key,
@ -21,6 +23,7 @@ class MultiSelectDropdownContainer extends StatelessWidget {
this.initialValue, this.initialValue,
this.isMultiple, this.isMultiple,
this.isAtLeastOne = false, this.isAtLeastOne = false,
this.fontSize = 25,
this.onChanged, this.onChanged,
}) : super(key: key); }) : super(key: key);
@ -32,7 +35,13 @@ class MultiSelectDropdownContainer extends StatelessWidget {
children: [ children: [
Align( Align(
alignment: AlignmentDirectional.centerStart, 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(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),

View File

@ -14,6 +14,7 @@ class MultiStringContainer extends StatelessWidget {
final Function onGetResult; final Function onGetResult;
final int maxLines; final int maxLines;
final bool isTitle; final bool isTitle;
final double fontSize;
const MultiStringContainer({ const MultiStringContainer({
Key key, Key key,
this.color = kSecond, this.color = kSecond,
@ -23,6 +24,7 @@ class MultiStringContainer extends StatelessWidget {
this.onGetResult, this.onGetResult,
this.maxLines, this.maxLines,
this.isTitle, this.isTitle,
this.fontSize = 25,
}) : super(key: key); }) : super(key: key);
@override @override
@ -34,7 +36,13 @@ class MultiStringContainer extends StatelessWidget {
children: [ children: [
Align( Align(
alignment: AlignmentDirectional.centerStart, 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(
padding: const EdgeInsets.all(10.0), 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:flutter/material.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
@ -7,8 +8,8 @@ class RoundedButton extends StatelessWidget {
final IconData icon; final IconData icon;
final Color color, textColor; final Color color, textColor;
final double fontSize; final double fontSize;
final int vertical; final double vertical;
final int horizontal; final double horizontal;
const RoundedButton({ const RoundedButton({
Key key, Key key,
@ -49,9 +50,12 @@ class RoundedButton extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
Center( Center(
child: Text( child: AutoSizeText(
text, text,
style: new TextStyle(color: textColor, fontSize: fontSize, fontWeight: FontWeight.w400), style: new TextStyle(color: textColor, fontSize: fontSize, fontWeight: FontWeight.w400),
maxLines: 2,
maxFontSize: fontSize,
textAlign: TextAlign.center,
), ),
), ),
SizedBox( SizedBox(
@ -65,9 +69,11 @@ class RoundedButton extends StatelessWidget {
], ],
); );
} else { } else {
return Text( return AutoSizeText(
text, text,
style: new TextStyle(color: textColor, fontSize: fontSize, fontWeight: FontWeight.w400), 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:flutter/material.dart';
import 'package:manager_app/Components/rounded_input_field.dart'; import 'package:manager_app/Components/rounded_input_field.dart';
import 'package:manager_app/constants.dart'; import 'package:manager_app/constants.dart';
@ -33,7 +34,13 @@ class StringInputContainer extends StatelessWidget {
children: [ children: [
Align( Align(
alignment: AlignmentDirectional.centerStart, 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(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),

View File

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

View File

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

View File

@ -117,8 +117,10 @@ class _SectionReorderListState extends State<SectionReorderList> {
Positioned( Positioned(
bottom: -20, bottom: -20,
left: 10, left: 10,
child: Container(
height: size.height*0.1,
child: StringInputContainer( child: StringInputContainer(
label: "Recherche:", label: "Recherche test:",
isSmall: true, isSmall: true,
fontSize: 15, fontSize: 15,
fontSizeText: 15, fontSizeText: 15,
@ -130,6 +132,7 @@ class _SectionReorderListState extends State<SectionReorderList> {
}, },
), ),
), ),
),
Positioned( Positioned(
bottom: 10, bottom: 10,
right: 10, right: 10,

View File

@ -26,9 +26,9 @@ class _BodyState extends State<Body> {
int currentPosition = 0; int currentPosition = 0;
var selectedElement; var selectedElement;
MenuSection devices = new MenuSection(name: "Tablettes", type: "devices", order: 0); //MenuSection devices = new MenuSection(name: "Test", type: "devices", order: 0);
MenuSection configurations = new MenuSection(name: "Configurations", type: "configurations", order: 1); MenuSection configurations = new MenuSection(name: "Configurations", type: "configurations", order: 0);
MenuSection resources = new MenuSection(name: "Ressources", type: "resources", order: 2); MenuSection resources = new MenuSection(name: "Ressources", type: "resources", order: 1);
Menu menu = new Menu(title: "MyMuseum"); Menu menu = new Menu(title: "MyMuseum");
@ -38,7 +38,7 @@ class _BodyState extends State<Body> {
Size size = MediaQuery.of(context).size; Size size = MediaQuery.of(context).size;
menu.sections = <MenuSection>[]; menu.sections = <MenuSection>[];
menu.sections.add(devices); //menu.sections.add(devices);
menu.sections.add(configurations); menu.sections.add(configurations);
menu.sections.add(resources); 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:flutter/material.dart';
import 'package:manager_app/Components/loading_common.dart'; import 'package:manager_app/Components/loading_common.dart';
import 'package:manager_app/Components/message_notification.dart'; import 'package:manager_app/Components/message_notification.dart';
@ -30,6 +33,7 @@ class _LoginScreenState extends State<LoginScreen> {
Client clientAPI; Client clientAPI;
bool isLoading = false; bool isLoading = false;
bool isRememberMe = false; bool isRememberMe = false;
String pageTitle = "MyMuseum";
void authenticateTRY(dynamic appContext) async { void authenticateTRY(dynamic appContext) async {
//print("try auth.. "); //print("try auth.. ");
@ -113,8 +117,12 @@ class _LoginScreenState extends State<LoginScreen> {
@override @override
void initState() { void initState() {
var url = window.location.href;
if(url.contains("fortsaintheribert")) {
this.pageTitle = "Fort de Saint Héribert";
}
this.isRememberMe = widget.session.rememberMe; 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.email = "test@email.be"; //widget.session.email;
//this.password = "kljqsdkljqsd"; //widget.session.password; //this.password = "kljqsdkljqsd"; //widget.session.password;
super.initState(); super.initState();
@ -130,7 +138,7 @@ class _LoginScreenState extends State<LoginScreen> {
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
height: size.height *0.65, height: size.height *0.65,
width: size.width *0.5, width: size.width *0.4,
decoration: BoxDecoration( decoration: BoxDecoration(
color: kWhite, color: kWhite,
borderRadius: BorderRadius.circular(8.0), borderRadius: BorderRadius.circular(8.0),
@ -157,7 +165,14 @@ class _LoginScreenState extends State<LoginScreen> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Icon(Icons.museum_outlined, color: kPrimaryColor, size: size.height*0.08), 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,7 +184,9 @@ class _LoginScreenState extends State<LoginScreen> {
initialValue: host, initialValue: host,
icon: Icons.home icon: Icons.home
),*/ ),*/
RoundedInputField( SizedBox(
width: size.width*0.2,
child: RoundedInputField(
hintText: "Email", hintText: "Email",
onChanged: (value) { onChanged: (value) {
email = value; email = value;
@ -178,12 +195,16 @@ class _LoginScreenState extends State<LoginScreen> {
initialValue: email, initialValue: email,
isEmail: true, isEmail: true,
), ),
RoundedPasswordField( ),
SizedBox(
width: size.width *0.2,
child: RoundedPasswordField(
initialValue: password, initialValue: password,
onChanged: (value) { onChanged: (value) {
password = value; password = value;
}, },
), ),
),
if(!kIsWeb) Padding( if(!kIsWeb) Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Row( child: Row(
@ -210,6 +231,8 @@ class _LoginScreenState extends State<LoginScreen> {
!isLoading ? RoundedButton( !isLoading ? RoundedButton(
text: "LOGIN", text: "LOGIN",
fontSize: 25, fontSize: 25,
vertical: 25,
horizontal: 45,
press: () { press: () {
authenticateTRY(appContext); authenticateTRY(appContext);
}, },

View File

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

View File

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