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(
|
||||
onPressed: _onItemTapped,
|
||||
tooltip: 'Scanner',
|
||||
backgroundColor: kMainColor,
|
||||
backgroundColor: kBlue1,
|
||||
child: const Icon(Icons.qr_code_scanner),
|
||||
),
|
||||
),
|
||||
|
||||
@ -14,7 +14,7 @@ class SearchBox extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _SearchBoxState extends State<SearchBox> {
|
||||
TextEditingController _controller = new TextEditingController();
|
||||
final TextEditingController _controller = TextEditingController();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@ -88,7 +88,6 @@ class _HomePageState extends State<HomePage> {
|
||||
),
|
||||
),
|
||||
),
|
||||
if(configurations[index].isOffline! && !alreadyDownloaded.any((c) => c == configurations[index].id))
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
@ -105,7 +104,8 @@ class _HomePageState extends State<HomePage> {
|
||||
onTap: () async {
|
||||
downloadClicked(appContext, configurations[index]);
|
||||
},
|
||||
child: const Icon(Icons.download_outlined, color: Colors.white),
|
||||
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),
|
||||
),
|
||||
/*AutoSizeText(
|
||||
configurations[index].isOffline.toString(),
|
||||
@ -229,9 +229,10 @@ class _HomePageState extends State<HomePage> {
|
||||
if(sections!.isNotEmpty) {
|
||||
// Update local DB - Sections
|
||||
for(var section in sections) {
|
||||
await DatabaseHelper.instance.insert(DatabaseTableType.sections, sectionToMap(section));
|
||||
// TODO handle other type of section
|
||||
if(section.type == SectionType.Article) {
|
||||
await DatabaseHelper.instance.insert(DatabaseTableType.sections, sectionToMap(section));
|
||||
|
||||
// Download all images..
|
||||
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/Helpers/DatabaseHelper.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/product.dart';
|
||||
import 'package:mymuseum_visitapp/app_context.dart';
|
||||
@ -70,8 +71,8 @@ class _BodyState extends State<Body> {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => DetailsScreen(
|
||||
product: products[index],
|
||||
builder: (context) => ArticlePage(
|
||||
articleId: sectionsToDisplay[index].id!,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@ -113,8 +113,7 @@ class SectionCard extends StatelessWidget {
|
||||
children: <Widget>[
|
||||
const Spacer(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: kDefaultPadding),
|
||||
padding: const EdgeInsets.symmetric(horizontal: kDefaultPadding),
|
||||
child: Text(
|
||||
sectionDTO != null ? TranslationHelper.get(sectionDTO!.title, appContext) : "",
|
||||
style: Theme.of(context).textTheme.button,
|
||||
@ -135,7 +134,7 @@ class SectionCard extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
"${sectionDTO.order!+1}",
|
||||
"${itemIndex+1}",
|
||||
//style: Theme.of(context).textTheme.button,
|
||||
style: TextStyle(color: Colors.white)
|
||||
),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user