Update order + fix only article stock in app
This commit is contained in:
parent
8a06e69630
commit
140dcad823
@ -1 +1 @@
|
|||||||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.0\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.0\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"qr_code_scanner","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2022-09-09 17:24:19.203221","version":"3.0.3"}
|
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.0\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.0\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"qr_code_scanner","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2022-09-09 17:59:27.780324","version":"3.0.3"}
|
||||||
@ -38,7 +38,7 @@ class _ScannerBoutonState extends State<ScannerBouton> {
|
|||||||
child: FloatingActionButton(
|
child: FloatingActionButton(
|
||||||
onPressed: _onItemTapped,
|
onPressed: _onItemTapped,
|
||||||
tooltip: 'Scanner',
|
tooltip: 'Scanner',
|
||||||
backgroundColor: kMainColor,
|
backgroundColor: kBlue1,
|
||||||
child: const Icon(Icons.qr_code_scanner),
|
child: const Icon(Icons.qr_code_scanner),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -14,7 +14,7 @@ class SearchBox extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _SearchBoxState extends State<SearchBox> {
|
class _SearchBoxState extends State<SearchBox> {
|
||||||
TextEditingController _controller = new TextEditingController();
|
final TextEditingController _controller = TextEditingController();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|||||||
@ -88,32 +88,32 @@ class _HomePageState extends State<HomePage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if(configurations[index].isOffline! && !alreadyDownloaded.any((c) => c == configurations[index].id))
|
Positioned(
|
||||||
Positioned(
|
bottom: 0,
|
||||||
bottom: 0,
|
right: 0,
|
||||||
right: 0,
|
child: Container(
|
||||||
child: Container(
|
width: 45,
|
||||||
width: 45,
|
height: 45,
|
||||||
height: 45,
|
decoration: BoxDecoration(
|
||||||
decoration: BoxDecoration(
|
shape: BoxShape.rectangle,
|
||||||
shape: BoxShape.rectangle,
|
color: kMainColor,
|
||||||
color: kMainColor,
|
borderRadius: BorderRadius.circular(20.0),
|
||||||
borderRadius: BorderRadius.circular(20.0),
|
),
|
||||||
),
|
margin: const EdgeInsets.all(8),
|
||||||
margin: const EdgeInsets.all(8),
|
child: InkWell(
|
||||||
child: InkWell(
|
onTap: () async {
|
||||||
onTap: () async {
|
downloadClicked(appContext, configurations[index]);
|
||||||
downloadClicked(appContext, configurations[index]);
|
},
|
||||||
},
|
child: configurations[index].isOffline! && !alreadyDownloaded.any((c) => c == configurations[index].id) ?
|
||||||
child: const Icon(Icons.download_outlined, color: Colors.white),
|
const Icon(Icons.download, color: Colors.white) : const Icon(Icons.refresh, color: Colors.white),
|
||||||
),
|
),
|
||||||
/*AutoSizeText(
|
/*AutoSizeText(
|
||||||
configurations[index].isOffline.toString(),
|
configurations[index].isOffline.toString(),
|
||||||
style: const TextStyle(fontSize: kMenuDescriptionDetailSize, fontFamily: ""),
|
style: const TextStyle(fontSize: kMenuDescriptionDetailSize, fontFamily: ""),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
),*/
|
),*/
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -229,9 +229,10 @@ class _HomePageState extends State<HomePage> {
|
|||||||
if(sections!.isNotEmpty) {
|
if(sections!.isNotEmpty) {
|
||||||
// Update local DB - Sections
|
// Update local DB - Sections
|
||||||
for(var section in sections) {
|
for(var section in sections) {
|
||||||
await DatabaseHelper.instance.insert(DatabaseTableType.sections, sectionToMap(section));
|
|
||||||
// TODO handle other type of section
|
// TODO handle other type of section
|
||||||
if(section.type == SectionType.Article) {
|
if(section.type == SectionType.Article) {
|
||||||
|
await DatabaseHelper.instance.insert(DatabaseTableType.sections, sectionToMap(section));
|
||||||
|
|
||||||
// Download all images..
|
// Download all images..
|
||||||
ArticleDTO? articleDTO = ArticleDTO.fromJson(jsonDecode(section.data!));
|
ArticleDTO? articleDTO = ArticleDTO.fromJson(jsonDecode(section.data!));
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import 'package:mymuseum_visitapp/Components/Loading.dart';
|
|||||||
import 'package:mymuseum_visitapp/Components/SearchBox.dart';
|
import 'package:mymuseum_visitapp/Components/SearchBox.dart';
|
||||||
import 'package:mymuseum_visitapp/Helpers/DatabaseHelper.dart';
|
import 'package:mymuseum_visitapp/Helpers/DatabaseHelper.dart';
|
||||||
import 'package:mymuseum_visitapp/Helpers/translationHelper.dart';
|
import 'package:mymuseum_visitapp/Helpers/translationHelper.dart';
|
||||||
|
import 'package:mymuseum_visitapp/Screens/Article/article.dart';
|
||||||
import 'package:mymuseum_visitapp/Screens/Visit/details/details_screen.dart';
|
import 'package:mymuseum_visitapp/Screens/Visit/details/details_screen.dart';
|
||||||
import 'package:mymuseum_visitapp/Screens/Visit/product.dart';
|
import 'package:mymuseum_visitapp/Screens/Visit/product.dart';
|
||||||
import 'package:mymuseum_visitapp/app_context.dart';
|
import 'package:mymuseum_visitapp/app_context.dart';
|
||||||
@ -70,8 +71,8 @@ class _BodyState extends State<Body> {
|
|||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) => DetailsScreen(
|
builder: (context) => ArticlePage(
|
||||||
product: products[index],
|
articleId: sectionsToDisplay[index].id!,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -113,8 +113,7 @@ class SectionCard extends StatelessWidget {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(horizontal: kDefaultPadding),
|
||||||
horizontal: kDefaultPadding),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
sectionDTO != null ? TranslationHelper.get(sectionDTO!.title, appContext) : "",
|
sectionDTO != null ? TranslationHelper.get(sectionDTO!.title, appContext) : "",
|
||||||
style: Theme.of(context).textTheme.button,
|
style: Theme.of(context).textTheme.button,
|
||||||
@ -135,7 +134,7 @@ class SectionCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
"${sectionDTO.order!+1}",
|
"${itemIndex+1}",
|
||||||
//style: Theme.of(context).textTheme.button,
|
//style: Theme.of(context).textTheme.button,
|
||||||
style: TextStyle(color: Colors.white)
|
style: TextStyle(color: Colors.white)
|
||||||
),
|
),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user