From e0d66ce3b10102da52a1c06e3557c861bc9cc252 Mon Sep 17 00:00:00 2001 From: Sven Carstensen Date: Tue, 16 Jan 2024 12:23:52 +0100 Subject: [PATCH] Erweiterungen --- lib/content_views/main_page.dart | 7 ++-- lib/content_views/task_list_page.dart | 16 +++++---- lib/content_views/tour_list_page.dart | 25 ++++++++------ lib/main.dart | 6 ++-- lib/model/tour_task.g.dart | 48 ++++++++++++++++++++++----- pubspec.lock | 26 +++++++-------- 6 files changed, 84 insertions(+), 44 deletions(-) diff --git a/lib/content_views/main_page.dart b/lib/content_views/main_page.dart index 82c6e3f..a147f1a 100644 --- a/lib/content_views/main_page.dart +++ b/lib/content_views/main_page.dart @@ -38,7 +38,8 @@ class MainPage extends ContentViewWidget { Future getHeaderInfo(BuildContext context) async { return HeaderInfo( titleWidget: Container( - padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 3), + height: 100, + padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 0), child: Column(children: [ ValueListenableBuilder( valueListenable: _zipValueNotifier, @@ -47,7 +48,7 @@ class MainPage extends ContentViewWidget { value, style: const TextStyle( color: Colors.white, - fontSize: 18.0, + fontSize: 25.0, ), ); }, @@ -60,7 +61,7 @@ class MainPage extends ContentViewWidget { value, style: const TextStyle( color: Colors.white, - fontSize: 18.0, + fontSize: 25.0, ), ); }, diff --git a/lib/content_views/task_list_page.dart b/lib/content_views/task_list_page.dart index 645af7a..27f312f 100644 --- a/lib/content_views/task_list_page.dart +++ b/lib/content_views/task_list_page.dart @@ -92,6 +92,8 @@ class _TaskListPageState extends State { for (int i=0; i<_taskList.length; i++) { var taskInfo = _taskList[i]; + var textColor = isTaskActive(i) ? Colors.black : const Color(0x33000000); + steps.add( ListTile( minVerticalPadding: 0, @@ -136,8 +138,8 @@ class _TaskListPageState extends State { Text( taskInfo.task.topic, textAlign: TextAlign.left, - style: const TextStyle( - color: Colors.blue, + style: TextStyle( + color: textColor, fontSize: 15.0, ), ), @@ -145,8 +147,8 @@ class _TaskListPageState extends State { Text( taskInfo.additionalText ?? '', textAlign: TextAlign.left, - style: const TextStyle( - color: Colors.blue, + style: TextStyle( + color: textColor, fontSize: 12.0, ), ), @@ -156,7 +158,9 @@ class _TaskListPageState extends State { ), ), onTap: () { - _processTask(taskInfo); + if (isTaskActive(i)) { + _processTask(taskInfo); + } }, ), ); @@ -174,7 +178,7 @@ class _TaskListPageState extends State { taskInfo = TaskInfo(); taskInfo.answer = null; taskInfo.additionalText = null; - taskInfo.completed = task.opt as bool; + taskInfo.completed = task.opt != null ? task.opt! : false; } taskInfo.task = task; diff --git a/lib/content_views/tour_list_page.dart b/lib/content_views/tour_list_page.dart index 38decc3..909fee1 100644 --- a/lib/content_views/tour_list_page.dart +++ b/lib/content_views/tour_list_page.dart @@ -98,19 +98,22 @@ class _TourListPageState extends State { const SizedBox(width: 10), SizedBox( width: 100, - child: ElevatedButton( - style: ButtonStyle( - shape: MaterialStateProperty.all( - RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8.0), - side: const BorderSide(color: Colors.grey), + child: Visibility( + visible: widget.job.tours[0].pos != null, + child: ElevatedButton( + style: ButtonStyle( + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8.0), + side: const BorderSide(color: Colors.grey), + ), ), + backgroundColor: MaterialStateProperty.all(Colors.lightGreen), + foregroundColor: MaterialStateProperty.all(Colors.black), ), - backgroundColor: MaterialStateProperty.all(Colors.lightGreen), - foregroundColor: MaterialStateProperty.all(Colors.black), - ), - onPressed: () => { showMapPopup(context, widget.job.tours[0], widget.job.tours)}, - child: const Text("Karte"))) + onPressed: () => { showMapPopup(context, widget.job.tours[0], widget.job.tours)}, + child: const Text("Karte")), + )) ], ), Expanded( diff --git a/lib/main.dart b/lib/main.dart index 7f125ef..4f00a74 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -136,11 +136,11 @@ class _MainState extends State
{ }, child: Scaffold( appBar: PreferredSize( - preferredSize: const Size.fromHeight(70), + preferredSize: const Size.fromHeight(100), child: ColoredSafeArea( key: const Key("appBar"), child: SizedBox( - height: 80, + height: 100, child: Padding( padding: const EdgeInsets.all(8), child: Stack( @@ -198,7 +198,7 @@ class _MainState extends State
{ ], ), SizedBox( - height: 60, + height: 100, width: 300, child: Center( heightFactor: 1, diff --git a/lib/model/tour_task.g.dart b/lib/model/tour_task.g.dart index 67c5b9c..c87f620 100644 --- a/lib/model/tour_task.g.dart +++ b/lib/model/tour_task.g.dart @@ -138,8 +138,8 @@ TourTask _tourTaskDeserialize( object.max = reader.readLongOrNull(offsets[0]); object.maxLen = reader.readLongOrNull(offsets[1]); object.min = reader.readLongOrNull(offsets[2]); - object.opt = reader.readBool(offsets[3]); - object.reenter = reader.readBool(offsets[4]); + object.opt = reader.readBoolOrNull(offsets[3]); + object.reenter = reader.readBoolOrNull(offsets[4]); object.rt = reader.readBoolOrNull(offsets[5]); object.sId = reader.readLong(offsets[6]); object.taskArrival = reader.readLongOrNull(offsets[7]); @@ -165,9 +165,9 @@ P _tourTaskDeserializeProp

( case 2: return (reader.readLongOrNull(offset)) as P; case 3: - return (reader.readBool(offset)) as P; + return (reader.readBoolOrNull(offset)) as P; case 4: - return (reader.readBool(offset)) as P; + return (reader.readBoolOrNull(offset)) as P; case 5: return (reader.readBoolOrNull(offset)) as P; case 6: @@ -398,8 +398,24 @@ extension TourTaskQueryFilter }); } + QueryBuilder optIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'opt', + )); + }); + } + + QueryBuilder optIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'opt', + )); + }); + } + QueryBuilder optEqualTo( - bool value) { + bool? value) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'opt', @@ -408,8 +424,24 @@ extension TourTaskQueryFilter }); } + QueryBuilder reenterIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'reenter', + )); + }); + } + + QueryBuilder reenterIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'reenter', + )); + }); + } + QueryBuilder reenterEqualTo( - bool value) { + bool? value) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'reenter', @@ -1091,8 +1123,8 @@ TourTask _$TourTaskFromJson(Map json) => TourTask() ..sId = json['s_id'] as int ..type = json['type'] as int ..topic = json['topic'] as String - ..opt = json['opt'] as bool - ..reenter = json['reenter'] as bool + ..opt = json['opt'] as bool? + ..reenter = json['reenter'] as bool? ..min = json['min'] as int? ..max = json['max'] as int? ..maxLen = json['max_len'] as int? diff --git a/pubspec.lock b/pubspec.lock index 8c18c76..aff0a57 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -173,10 +173,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" convert: dependency: transitive description: @@ -748,10 +748,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" mgrs_dart: dependency: transitive description: @@ -1113,18 +1113,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" stream_transform: dependency: transitive description: @@ -1153,10 +1153,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" time: dependency: transitive description: @@ -1321,10 +1321,10 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" web_socket_channel: dependency: transitive description: @@ -1382,5 +1382,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.1.0 <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=3.13.0"