Add loading
This commit is contained in:
parent
ec4f9160ce
commit
6a31a039a0
@ -1,16 +1,51 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mymuseum_visitapp/constants.dart';
|
import 'package:mymuseum_visitapp/constants.dart';
|
||||||
|
|
||||||
class Loading extends StatelessWidget {
|
class Loading extends StatefulWidget {
|
||||||
const Loading({Key? key}) : super(key: key);
|
const Loading({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<Loading> createState() => _LoadingState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _LoadingState extends State<Loading> with TickerProviderStateMixin {
|
||||||
|
late AnimationController _controller;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
_controller = AnimationController(
|
||||||
|
duration: const Duration(milliseconds: 5000),
|
||||||
|
vsync: this,
|
||||||
|
)..repeat();
|
||||||
|
/*_controller = widget.tween.animate(
|
||||||
|
CurvedAnimation(parent: _controller, curve: Curves.easeIn));*/
|
||||||
|
|
||||||
|
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_controller.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
Size size = MediaQuery.of(context).size;
|
||||||
height: 85.0,
|
_controller.forward(from: 0.0);
|
||||||
width: 85.0,
|
_controller.addListener(() {
|
||||||
child: const Center(
|
if (_controller.isCompleted) {
|
||||||
child: Text("Loading.."),
|
_controller.reverse();
|
||||||
|
}
|
||||||
|
if(_controller.isDismissed){
|
||||||
|
_controller.forward();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return Center(
|
||||||
|
child: RotationTransition(
|
||||||
|
turns: Tween(begin: 0.0, end: 3.0).animate(_controller),
|
||||||
|
child: Icon(Icons.museum_outlined, color: kBlue2, size: size.height*0.05),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,15 +17,6 @@ class _ScannerBoutonState extends State<ScannerBouton> {
|
|||||||
void _onItemTapped() {
|
void _onItemTapped() {
|
||||||
setState(() {
|
setState(() {
|
||||||
showScannerDialog(context);
|
showScannerDialog(context);
|
||||||
/*if(widget.isReplacement) {
|
|
||||||
Navigator.of(context).pushReplacement(MaterialPageRoute(
|
|
||||||
builder: (context) => const ScannerPage(),
|
|
||||||
));
|
|
||||||
} else {
|
|
||||||
Navigator.of(context).push(MaterialPageRoute(
|
|
||||||
builder: (context) => const ScannerPage(),
|
|
||||||
));
|
|
||||||
}*/
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -52,7 +52,7 @@ class _ScannerTESTState extends State<ScannerTEST> {
|
|||||||
height: 45,
|
height: 45,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
color: kMainColor,
|
color: kBlue1,
|
||||||
borderRadius: BorderRadius.circular(20.0),
|
borderRadius: BorderRadius.circular(20.0),
|
||||||
),
|
),
|
||||||
margin: const EdgeInsets.all(8),
|
margin: const EdgeInsets.all(8),
|
||||||
@ -77,7 +77,7 @@ class _ScannerTESTState extends State<ScannerTEST> {
|
|||||||
height: 45,
|
height: 45,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
color: kMainColor,
|
color: kBlue1,
|
||||||
borderRadius: BorderRadius.circular(20.0),
|
borderRadius: BorderRadius.circular(20.0),
|
||||||
),
|
),
|
||||||
margin: const EdgeInsets.all(8),
|
margin: const EdgeInsets.all(8),
|
||||||
@ -198,7 +198,7 @@ class _ScannerTESTState extends State<ScannerTEST> {
|
|||||||
key: qrKey,
|
key: qrKey,
|
||||||
onQRViewCreated: _onQRViewCreated,
|
onQRViewCreated: _onQRViewCreated,
|
||||||
overlay: QrScannerOverlayShape(
|
overlay: QrScannerOverlayShape(
|
||||||
borderColor: kMainColor,
|
borderColor: kBlue1,
|
||||||
borderRadius: 10,
|
borderRadius: 10,
|
||||||
borderLength: 25,
|
borderLength: 25,
|
||||||
borderWidth: 5,
|
borderWidth: 5,
|
||||||
|
|||||||
@ -1,11 +1,8 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:carousel_slider/carousel_slider.dart';
|
import 'package:carousel_slider/carousel_slider.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mymuseum_visitapp/Models/resourceModel.dart';
|
import 'package:mymuseum_visitapp/Models/resourceModel.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';
|
|
||||||
|
|
||||||
class SliderImagesWidget extends StatefulWidget {
|
class SliderImagesWidget extends StatefulWidget {
|
||||||
final List<ResourceModel?> resources;
|
final List<ResourceModel?> resources;
|
||||||
@ -34,7 +31,6 @@ class _SliderImagesWidget extends State<SliderImagesWidget> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final appContext = Provider.of<AppContext>(context);
|
|
||||||
Size size = MediaQuery.of(context).size;
|
Size size = MediaQuery.of(context).size;
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
@ -51,7 +47,7 @@ class _SliderImagesWidget extends State<SliderImagesWidget> {
|
|||||||
currentIndex = index + 1;
|
currentIndex = index + 1;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
height: widget.height * 0.95,
|
// height: widget.height * 0.95,
|
||||||
enlargeCenterPage: true,
|
enlargeCenterPage: true,
|
||||||
reverse: false,
|
reverse: false,
|
||||||
),
|
),
|
||||||
@ -59,70 +55,22 @@ class _SliderImagesWidget extends State<SliderImagesWidget> {
|
|||||||
return Builder(
|
return Builder(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
width: size.width,
|
//color: Colors.red,
|
||||||
height: widget.height,
|
//height: widget.height * 1,
|
||||||
/*decoration: BoxDecoration(
|
//width: size.width * 0.95,
|
||||||
//color: appContext.getContext().configuration == null ? kBackgroundGrey : appContext.getContext().configuration.secondaryColor != null ? new Color(int.parse(appContext.getContext().configuration.secondaryColor.split('(0x')[1].split(')')[0], radix: 16)): kBackgroundGrey,
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(5.0),
|
borderRadius: BorderRadius.circular(15.0),
|
||||||
//border: Border.all(width: 0.3, color: kSecondGrey),
|
child: Image.memory(base64Decode(i!.data!))/*PhotoView(
|
||||||
),*/
|
imageProvider: Image.memory(base64Decode(i!.data!)).image,
|
||||||
child: Container(
|
minScale: PhotoViewComputedScale.contained * 0.8,
|
||||||
height: widget.height * 1,
|
maxScale: PhotoViewComputedScale.contained * 3.0,
|
||||||
width: size.width * 0.95,
|
backgroundDecoration: BoxDecoration(
|
||||||
child: AspectRatio(
|
color: Colors.transparent,
|
||||||
aspectRatio: 16 / 9,
|
/*shape: BoxShape.rectangle,
|
||||||
child: ClipRRect(
|
borderRadius: BorderRadius.circular(15.0),*/
|
||||||
borderRadius: BorderRadius.circular(35.0),
|
|
||||||
child: Image.memory(base64Decode(i!.data!))/*PhotoView(
|
|
||||||
imageProvider: Image.memory(base64Decode(i!.data!)).image,
|
|
||||||
minScale: PhotoViewComputedScale.contained * 0.8,
|
|
||||||
maxScale: PhotoViewComputedScale.contained * 3.0,
|
|
||||||
backgroundDecoration: BoxDecoration(
|
|
||||||
color: Colors.transparent,
|
|
||||||
/*shape: BoxShape.rectangle,
|
|
||||||
borderRadius: BorderRadius.circular(15.0),*/
|
|
||||||
),
|
|
||||||
)*/,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),/*Column(
|
)*/,
|
||||||
//crossAxisAlignment: CrossAxisAlignment.center,
|
),
|
||||||
//mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(10.0),
|
|
||||||
child: Container(
|
|
||||||
height: widget.height * 0.5,
|
|
||||||
width: size.width * 1,
|
|
||||||
child: Stack(
|
|
||||||
children: [
|
|
||||||
Center(
|
|
||||||
child: /*Container(
|
|
||||||
height: widget.height * 1,
|
|
||||||
width: size.width * 0.95,
|
|
||||||
child: AspectRatio(
|
|
||||||
aspectRatio: 16 / 9,
|
|
||||||
child: ClipRect(
|
|
||||||
child: PhotoView(
|
|
||||||
imageProvider: Image.memory(base64Decode(i!.data!)).image,
|
|
||||||
minScale: PhotoViewComputedScale.contained * 0.8,
|
|
||||||
maxScale: PhotoViewComputedScale.contained * 3.0,
|
|
||||||
backgroundDecoration: BoxDecoration(
|
|
||||||
color: kBackgroundSecondGrey,
|
|
||||||
shape: BoxShape.rectangle,
|
|
||||||
borderRadius: BorderRadius.circular(15.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),*/
|
|
||||||
),
|
|
||||||
]
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)*/
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -141,7 +89,7 @@ class _SliderImagesWidget extends State<SliderImagesWidget> {
|
|||||||
child: const Icon(
|
child: const Icon(
|
||||||
Icons.chevron_right,
|
Icons.chevron_right,
|
||||||
size: 45,
|
size: 45,
|
||||||
color: kMainColor,
|
color: kBlue2,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
@ -158,7 +106,7 @@ class _SliderImagesWidget extends State<SliderImagesWidget> {
|
|||||||
child: const Icon(
|
child: const Icon(
|
||||||
Icons.chevron_left,
|
Icons.chevron_left,
|
||||||
size: 45,
|
size: 45,
|
||||||
color: kMainColor,
|
color: kBlue2,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
@ -173,7 +121,7 @@ class _SliderImagesWidget extends State<SliderImagesWidget> {
|
|||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
currentIndex.toString()+'/'+widget.resources.length.toString(),
|
currentIndex.toString()+'/'+widget.resources.length.toString(),
|
||||||
style: const TextStyle(fontSize: kArticleContentSize, fontWeight: FontWeight.w500, color: kMainColor),
|
style: const TextStyle(fontSize: kArticleContentSize, fontWeight: FontWeight.w500, color: kBlue2),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|||||||
@ -28,7 +28,6 @@ class ArticlePage extends StatefulWidget {
|
|||||||
class _ArticlePageState extends State<ArticlePage> {
|
class _ArticlePageState extends State<ArticlePage> {
|
||||||
SectionDTO? sectionDTO;
|
SectionDTO? sectionDTO;
|
||||||
ArticleDTO? articleDTO;
|
ArticleDTO? articleDTO;
|
||||||
ResourceModel? mainResource;
|
|
||||||
List<ResourceModel?> resourcesModel = <ResourceModel?>[];
|
List<ResourceModel?> resourcesModel = <ResourceModel?>[];
|
||||||
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
|
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
|
|
||||||
@ -132,11 +131,11 @@ class _ArticlePageState extends State<ArticlePage> {
|
|||||||
|
|
||||||
if(articleDTO!.isContentTop!)
|
if(articleDTO!.isContentTop!)
|
||||||
getContent(size, appContext),
|
getContent(size, appContext),
|
||||||
if(articleDTO!.isContentTop!)
|
if(articleDTO!.isContentTop! && resourcesModel.isNotEmpty)
|
||||||
getImages(size),
|
getImages(size, articleDTO!.isContentTop!),
|
||||||
|
|
||||||
if(!articleDTO!.isContentTop!)
|
if(!articleDTO!.isContentTop! && resourcesModel.isNotEmpty)
|
||||||
getImages(size),
|
getImages(size, articleDTO!.isContentTop!),
|
||||||
if(!articleDTO!.isContentTop!)
|
if(!articleDTO!.isContentTop!)
|
||||||
getContent(size, appContext),
|
getContent(size, appContext),
|
||||||
|
|
||||||
@ -154,25 +153,22 @@ class _ArticlePageState extends State<ArticlePage> {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Widget getImages(Size size) {
|
Widget getImages(Size size, bool isContentTop) {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: size.width,
|
width: size.width,
|
||||||
height: size.height * 0.3,
|
height: size.height * 0.3,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: isContentTop ? const EdgeInsets.only(left: 8.0, right: 8.0, bottom: 8.0): const EdgeInsets.only(left: 8.0, right: 8.0, top: 8.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: kBackgroundGrey,
|
border: Border.all(
|
||||||
|
color: kBlue2,
|
||||||
|
width: 0.5,
|
||||||
|
),
|
||||||
|
color: Colors.white,
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(5.0),
|
borderRadius: BorderRadius.circular(5.0),
|
||||||
boxShadow: const [
|
boxShadow: const [kDefaultShadow],
|
||||||
BoxShadow(
|
|
||||||
color: kBackgroundGrey,
|
|
||||||
spreadRadius: 0.15,
|
|
||||||
blurRadius: 3.5,
|
|
||||||
offset: Offset(0, 1), // changes position of shadow
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
child: SliderImagesWidget(resources: resourcesModel, height: size.height * 0.29)
|
child: SliderImagesWidget(resources: resourcesModel, height: size.height * 0.29)
|
||||||
)
|
)
|
||||||
@ -181,37 +177,37 @@ class _ArticlePageState extends State<ArticlePage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget getContent(Size size, AppContext appContext) {
|
Widget getContent(Size size, AppContext appContext) {
|
||||||
return SizedBox(
|
return Expanded(
|
||||||
width: size.width,
|
child: Container(
|
||||||
height: size.height * 0.49,
|
width: size.width,
|
||||||
child: Padding(
|
//height: size.height * 0.65,
|
||||||
padding: const EdgeInsets.only(left: 8.0, right: 8.0, top: 8.0),
|
//color: Colors.blueAccent,
|
||||||
child: Container(
|
child: Padding(
|
||||||
decoration: BoxDecoration(
|
padding: const EdgeInsets.only(left: 8.0, right: 8.0, top: 8.0, bottom: 8.0),
|
||||||
color: kBackgroundGrey,
|
child: Container(
|
||||||
shape: BoxShape.rectangle,
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(5.0),
|
border: Border.all(
|
||||||
boxShadow: const [
|
color: kBlue2,
|
||||||
BoxShadow(
|
width: 0.5,
|
||||||
color: kBackgroundGrey,
|
|
||||||
spreadRadius: 0.15,
|
|
||||||
blurRadius: 3.5,
|
|
||||||
offset: Offset(0, 1), // changes position of shadow
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Text(
|
|
||||||
TranslationHelper.get(articleDTO!.content, appContext),
|
|
||||||
textAlign: TextAlign.left,
|
|
||||||
style: const TextStyle(fontSize: kArticleContentSize)
|
|
||||||
),
|
),
|
||||||
|
color: Colors.white,
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
borderRadius: BorderRadius.circular(5.0),
|
||||||
|
boxShadow: const [kDefaultShadow],
|
||||||
),
|
),
|
||||||
)
|
child: SingleChildScrollView(
|
||||||
)
|
child: Padding(
|
||||||
)
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Text(
|
||||||
|
TranslationHelper.get(articleDTO!.content, appContext),
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
style: const TextStyle(fontSize: kArticleContentSize)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,20 +224,24 @@ class _ArticlePageState extends State<ArticlePage> {
|
|||||||
});
|
});
|
||||||
if(sectionDTO!.imageId != null) {
|
if(sectionDTO!.imageId != null) {
|
||||||
await DatabaseHelper.instance.queryWithId(DatabaseTableType.resources, sectionDTO!.imageId!).then((value) {
|
await DatabaseHelper.instance.queryWithId(DatabaseTableType.resources, sectionDTO!.imageId!).then((value) {
|
||||||
mainResource = DatabaseHelper.instance.getResourceFromDB(value.first);
|
resourcesModel.add(DatabaseHelper.instance.getResourceFromDB(value.first));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(articleDTO!.images!.isNotEmpty) {
|
if(articleDTO!.images!.isNotEmpty) {
|
||||||
|
print(articleDTO!.images!.length);
|
||||||
|
print("LOADING IMAGES !!!");
|
||||||
|
|
||||||
for (var image in articleDTO!.images!) {
|
for (var image in articleDTO!.images!) {
|
||||||
print(image);
|
|
||||||
await DatabaseHelper.instance.queryWithId(DatabaseTableType.resources, image.resourceId!).then((value) {
|
await DatabaseHelper.instance.queryWithId(DatabaseTableType.resources, image.resourceId!).then((value) {
|
||||||
resourcesModel.add(DatabaseHelper.instance.getResourceFromDB(value.first));
|
resourcesModel.add(DatabaseHelper.instance.getResourceFromDB(value.first));
|
||||||
});
|
});
|
||||||
|
print("LOADING DONEOJNEONEONONDONEONE !!!");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mainResource == null && resourcesModel.isNotEmpty) {
|
/*if(mainResource == null && resourcesModel.isNotEmpty) {
|
||||||
mainResource = resourcesModel.first;
|
mainResource = resourcesModel.first;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -35,11 +35,11 @@ class _HomePageState extends State<HomePage> {
|
|||||||
final appContext = Provider.of<AppContext>(context);
|
final appContext = Provider.of<AppContext>(context);
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: CustomAppBar(
|
appBar: CustomAppBar(
|
||||||
title: "Home page - liste parcours",
|
title: "Liste des visites", // Todo translate
|
||||||
isHomeButton: false,
|
isHomeButton: false,
|
||||||
),
|
),
|
||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: size.width,
|
width: size.width,
|
||||||
height: size.height,
|
height: size.height,
|
||||||
child: FutureBuilder(
|
child: FutureBuilder(
|
||||||
@ -96,7 +96,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
height: 45,
|
height: 45,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
color: kMainColor,
|
color: kBlue1,
|
||||||
borderRadius: BorderRadius.circular(20.0),
|
borderRadius: BorderRadius.circular(20.0),
|
||||||
),
|
),
|
||||||
margin: const EdgeInsets.all(8),
|
margin: const EdgeInsets.all(8),
|
||||||
@ -107,11 +107,6 @@ class _HomePageState extends State<HomePage> {
|
|||||||
child: configurations[index].isOffline! && !alreadyDownloaded.any((c) => c == configurations[index].id) ?
|
child: configurations[index].isOffline! && !alreadyDownloaded.any((c) => c == configurations[index].id) ?
|
||||||
const Icon(Icons.download, color: Colors.white) : const Icon(Icons.refresh, color: Colors.white),
|
const Icon(Icons.download, color: Colors.white) : const Icon(Icons.refresh, color: Colors.white),
|
||||||
),
|
),
|
||||||
/*AutoSizeText(
|
|
||||||
configurations[index].isOffline.toString(),
|
|
||||||
style: const TextStyle(fontSize: kMenuDescriptionDetailSize, fontFamily: ""),
|
|
||||||
maxLines: 1,
|
|
||||||
),*/
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@ -149,11 +144,10 @@ class _HomePageState extends State<HomePage> {
|
|||||||
alreadyDownloaded = configurations.map((c) => c.id).toList();
|
alreadyDownloaded = configurations.map((c) => c.id).toList();
|
||||||
|
|
||||||
if(isOnline) {
|
if(isOnline) {
|
||||||
//var client = new Client("http://192.168.31.140:8089"); // TODO REMOVE
|
|
||||||
configurations = await client.configurationApi!.configurationGet();
|
configurations = await client.configurationApi!.configurationGet();
|
||||||
return configurations ?? [];
|
return configurations ?? [];
|
||||||
} else {
|
} else {
|
||||||
return configurations ?? []; // TODO return local list..
|
return configurations ?? [];
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
@ -269,17 +263,21 @@ class _HomePageState extends State<HomePage> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boxDecoration(ConfigurationDTO configuration, bool isSelected) { // TODO to change
|
boxDecoration(ConfigurationDTO configuration, bool isSelected) {
|
||||||
return BoxDecoration(
|
return BoxDecoration(
|
||||||
color: kSecondColor,
|
color: Colors.white,
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(20.0),
|
borderRadius: BorderRadius.circular(20.0),
|
||||||
boxShadow: const [
|
border: Border.all(
|
||||||
|
color: kBlue0.withOpacity(0.35),
|
||||||
|
width: 0.2,
|
||||||
|
),
|
||||||
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: kSecondColor,
|
color: kBlue0.withOpacity(0.35),
|
||||||
spreadRadius: 0.15,
|
//spreadRadius: 0.15,
|
||||||
blurRadius: 3.5,
|
blurRadius: 27,
|
||||||
offset: Offset(0, 1), // changes position of shadow
|
offset: const Offset(0, 15), // changes position of shadow
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
@ -81,7 +81,7 @@ class _BodyState extends State<Body> {
|
|||||||
builder: (context, AsyncSnapshot<dynamic> snapshot) {
|
builder: (context, AsyncSnapshot<dynamic> snapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(top: 15),
|
padding: const EdgeInsets.only(top: 0),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
itemCount: sectionsToDisplay.length,
|
itemCount: sectionsToDisplay.length,
|
||||||
itemBuilder: (context, index) => SectionCard(
|
itemBuilder: (context, index) => SectionCard(
|
||||||
|
|||||||
@ -40,8 +40,10 @@ class SectionCard extends StatelessWidget {
|
|||||||
horizontal: kDefaultPadding,
|
horizontal: kDefaultPadding,
|
||||||
vertical: 0,
|
vertical: 0,
|
||||||
),
|
),
|
||||||
// color: Colors.blueAccent,
|
|
||||||
height: 160,
|
height: 160,
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
boxShadow: [kDefaultShadow],
|
||||||
|
),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: press,
|
onTap: press,
|
||||||
child: Stack(
|
child: Stack(
|
||||||
@ -53,7 +55,6 @@ class SectionCard extends StatelessWidget {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(22),
|
borderRadius: BorderRadius.circular(22),
|
||||||
color: itemIndex.isEven ? kBlue0 : kBlue1,
|
color: itemIndex.isEven ? kBlue0 : kBlue1,
|
||||||
//boxShadow: const [kDefaultShadow],
|
|
||||||
),
|
),
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.only(right: 10),
|
margin: const EdgeInsets.only(right: 10),
|
||||||
@ -65,7 +66,6 @@ class SectionCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(22),
|
borderRadius: BorderRadius.circular(22),
|
||||||
),
|
),
|
||||||
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// section main image
|
// section main image
|
||||||
@ -103,10 +103,7 @@ class SectionCard extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)/*Image.asset(
|
)
|
||||||
section.image,
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
),*/
|
|
||||||
),
|
),
|
||||||
//),
|
//),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -51,7 +51,7 @@ const kNoneInfoOrIncorrect = 35.0;
|
|||||||
const kDefaultShadow = BoxShadow(
|
const kDefaultShadow = BoxShadow(
|
||||||
offset: Offset(0, 15),
|
offset: Offset(0, 15),
|
||||||
blurRadius: 27,
|
blurRadius: 27,
|
||||||
color: Colors.black12, // Black color with 12% opacity
|
color: kBackgroundGrey, // Black color with 12% opacity
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user