diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index efca82f..20a02d9 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -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"} \ No newline at end of file +{"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"} \ No newline at end of file diff --git a/lib/Components/ScannerBouton.dart b/lib/Components/ScannerBouton.dart index f08de93..a96bdf6 100644 --- a/lib/Components/ScannerBouton.dart +++ b/lib/Components/ScannerBouton.dart @@ -38,7 +38,7 @@ class _ScannerBoutonState extends State { child: FloatingActionButton( onPressed: _onItemTapped, tooltip: 'Scanner', - backgroundColor: kMainColor, + backgroundColor: kBlue1, child: const Icon(Icons.qr_code_scanner), ), ), diff --git a/lib/Components/SearchBox.dart b/lib/Components/SearchBox.dart index e5ce61e..9748fb5 100644 --- a/lib/Components/SearchBox.dart +++ b/lib/Components/SearchBox.dart @@ -14,7 +14,7 @@ class SearchBox extends StatefulWidget { } class _SearchBoxState extends State { - TextEditingController _controller = new TextEditingController(); + final TextEditingController _controller = TextEditingController(); @override Widget build(BuildContext context) { diff --git a/lib/Screens/Home/home.dart b/lib/Screens/Home/home.dart index f61cd80..d2bb073 100644 --- a/lib/Screens/Home/home.dart +++ b/lib/Screens/Home/home.dart @@ -88,32 +88,32 @@ class _HomePageState extends State { ), ), ), - if(configurations[index].isOffline! && !alreadyDownloaded.any((c) => c == configurations[index].id)) - Positioned( - bottom: 0, - right: 0, - child: Container( - width: 45, - height: 45, - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: kMainColor, - borderRadius: BorderRadius.circular(20.0), - ), - margin: const EdgeInsets.all(8), - child: InkWell( - onTap: () async { - downloadClicked(appContext, configurations[index]); - }, - child: const Icon(Icons.download_outlined, color: Colors.white), - ), - /*AutoSizeText( - configurations[index].isOffline.toString(), - style: const TextStyle(fontSize: kMenuDescriptionDetailSize, fontFamily: ""), - maxLines: 1, - ),*/ - ) - ) + Positioned( + bottom: 0, + right: 0, + child: Container( + width: 45, + height: 45, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: kMainColor, + borderRadius: BorderRadius.circular(20.0), + ), + margin: const EdgeInsets.all(8), + child: InkWell( + onTap: () async { + downloadClicked(appContext, configurations[index]); + }, + 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(), + style: const TextStyle(fontSize: kMenuDescriptionDetailSize, fontFamily: ""), + maxLines: 1, + ),*/ + ) + ) ], ), ), @@ -229,9 +229,10 @@ class _HomePageState extends State { 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!)); diff --git a/lib/Screens/Visit/components/body.dart b/lib/Screens/Visit/components/body.dart index bdc9b5e..847549a 100644 --- a/lib/Screens/Visit/components/body.dart +++ b/lib/Screens/Visit/components/body.dart @@ -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 { Navigator.push( context, MaterialPageRoute( - builder: (context) => DetailsScreen( - product: products[index], + builder: (context) => ArticlePage( + articleId: sectionsToDisplay[index].id!, ), ), ); diff --git a/lib/Screens/Visit/components/section_card.dart b/lib/Screens/Visit/components/section_card.dart index 807f7ba..fd3bda5 100644 --- a/lib/Screens/Visit/components/section_card.dart +++ b/lib/Screens/Visit/components/section_card.dart @@ -113,8 +113,7 @@ class SectionCard extends StatelessWidget { children: [ 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) ),