From e653010458c5006bc0e7008f201a0299abfafbf7 Mon Sep 17 00:00:00 2001 From: Yandrik Date: Sun, 21 Apr 2024 02:22:53 +0200 Subject: [PATCH] feat: major progress --- lib/components/colorful_chips.dart | 15 +- lib/components/feature_bottom_sheet.dart | 88 +- lib/components/map_render_level.dart | 21 +- lib/controllers/isar_controller.dart | 74 ++ lib/controllers/isar_controller.g.dart | 910 ++++++++++++++++++ lib/data/geo/parser.dart | 4 +- lib/data/settings/settings_model.dart | 0 lib/main.dart | 9 +- lib/map.dart | 70 +- lib/settings.dart | 155 ++- lib/util/util.dart | 16 + linux/flutter/generated_plugin_registrant.cc | 4 + linux/flutter/generated_plugins.cmake | 1 + macos/Flutter/GeneratedPluginRegistrant.swift | 4 + pubspec.lock | 144 ++- pubspec.yaml | 4 + .../flutter/generated_plugin_registrant.cc | 3 + windows/flutter/generated_plugins.cmake | 1 + 18 files changed, 1464 insertions(+), 59 deletions(-) create mode 100644 lib/controllers/isar_controller.dart create mode 100644 lib/controllers/isar_controller.g.dart create mode 100644 lib/data/settings/settings_model.dart diff --git a/lib/components/colorful_chips.dart b/lib/components/colorful_chips.dart index fc4ebfd..458eddc 100644 --- a/lib/components/colorful_chips.dart +++ b/lib/components/colorful_chips.dart @@ -14,7 +14,10 @@ class ColorfulChip extends StatelessWidget { labelStyle: TextStyle( color: color.computeLuminance() > 0.5 ? Colors.black : Colors.white, ), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + side: BorderSide.none, + ), ); } } @@ -22,11 +25,13 @@ class ColorfulChip extends StatelessWidget { class ColorfulActionChip extends StatelessWidget { final String label; final VoidCallback onPressed; + final double? size; const ColorfulActionChip({ Key? key, required this.label, required this.onPressed, + this.size, }) : super(key: key); @override @@ -38,9 +43,15 @@ class ColorfulActionChip extends StatelessWidget { backgroundColor: color, labelStyle: TextStyle( color: color.computeLuminance() > 0.5 ? Colors.black : Colors.white, + fontSize: size, + ), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + side: BorderSide.none, ), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), onPressed: onPressed, + padding: EdgeInsets.symmetric( + horizontal: (size ?? 16) / 2, vertical: (size ?? 8.0) / 2), ); } } diff --git a/lib/components/feature_bottom_sheet.dart b/lib/components/feature_bottom_sheet.dart index fd9687a..7078dfe 100644 --- a/lib/components/feature_bottom_sheet.dart +++ b/lib/components/feature_bottom_sheet.dart @@ -18,7 +18,9 @@ Future showFeatureBottomSheet( Theme( data: ThemeData.light(), child: Container( - height: 300, + constraints: const BoxConstraints( + minHeight: 300, + ), width: Get.mediaQuery.size.width, decoration: const BoxDecoration( color: Colors.black, @@ -26,7 +28,7 @@ Future showFeatureBottomSheet( topLeft: Radius.circular(30), topRight: Radius.circular(30)), ), padding: const EdgeInsets.all(20), - child: Column(children: [ + child: Column(mainAxisSize: MainAxisSize.min, children: [ Center( child: Container( width: 50, @@ -65,6 +67,10 @@ Future showFeatureBottomSheet( ), const SizedBox(height: 14), ], + if (feature.description != null) ...[ + Text(feature.description!), + const SizedBox(height: 10), + ], ..._buildFeatureContent(feature), ]), ), @@ -113,17 +119,89 @@ List _buildDoorContent(Feature feature, List connects) { /// Builds the content for the Toilet feature type. List _buildToiletContent(Feature feature, String toiletType) { - return [Text('Toilet: ${feature.name}\nType: $toiletType')]; + return [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon( + Icons.wc, + size: 60, + color: Colors.white, + ), + Icon( + findToiletIcon(toiletType), + size: 60, + color: Colors.white, + ) + ], + ) + ]; } /// Builds the content for the Stairs feature type. List _buildStairsContent(Feature feature, List connectsLevels) { - return [Text('Stairs: ${feature.name}\nConnects Levels: $connectsLevels')]; + return [ + Text( + feature.name, + style: const TextStyle(fontSize: 18), + ), + const SizedBox(height: 10), + if (connectsLevels.isNotEmpty) ...[ + const Align( + alignment: Alignment.centerLeft, + child: Padding( + padding: EdgeInsets.only(right: 4), + child: Text( + 'Connects Levels:', + style: TextStyle(fontWeight: FontWeight.bold), + ), + ), + ), + Align( + alignment: Alignment.centerLeft, + child: Wrap( + spacing: 8, + runSpacing: 4, + children: connectsLevels.map((level) { + return ColorfulChip(label: level.toString()); + }).toList(), + ), + ), + ], + ]; } /// Builds the content for the Lift feature type. List _buildLiftContent(Feature feature, List connectsLevels) { - return [Text('Lift: ${feature.name}\nConnects Levels: $connectsLevels')]; + return [ + Text( + feature.name, + style: const TextStyle(fontSize: 18), + ), + const SizedBox(height: 10), + if (connectsLevels.isNotEmpty) ...[ + const Align( + alignment: Alignment.centerLeft, + child: Padding( + padding: EdgeInsets.only(right: 4), + child: Text( + 'Connects Levels:', + style: TextStyle(fontWeight: FontWeight.bold), + ), + ), + ), + Align( + alignment: Alignment.centerLeft, + child: Wrap( + spacing: 8, + runSpacing: 4, + children: connectsLevels.map((level) { + return ColorfulChip(label: level.toString()); + }).toList(), + ), + ), + ], + ]; } /// Builds the content for the PublicTransport feature type. diff --git a/lib/components/map_render_level.dart b/lib/components/map_render_level.dart index f03bce2..7ae26f9 100644 --- a/lib/components/map_render_level.dart +++ b/lib/components/map_render_level.dart @@ -8,6 +8,7 @@ import 'package:uninav/controllers/map_controller.dart'; import 'package:uninav/data/geo/model.dart'; import 'package:uninav/map.dart'; import 'package:uninav/util/geomath.dart'; +import 'package:uninav/util/util.dart'; List renderLevel(int level, {LayerHitNotifier? hitNotifier}) { return [ @@ -77,24 +78,6 @@ List renderLevel(int level, {LayerHitNotifier? hitNotifier}) { filter: (feature) => feature.level == level && feature.type is Toilet, markerConstructor: (feature) { final type = (feature.type as Toilet).toilet_type; - IconData icon; - switch (type.toLowerCase()) { - case 'male': - icon = Icons.male; - break; - case 'female': - icon = Icons.female; - break; - case 'handicap': - icon = Icons.wheelchair_pickup; - break; - default: - print("WARN: Toilet didn't have recognizable type! " - "(Level ${feature.level}, Name ${feature.name}, " - "Location: ${feature.getPoint().unwrap()})"); - icon = Icons.wc; - break; - } final point = feature.getPoint().unwrap(); return Marker( @@ -102,7 +85,7 @@ List renderLevel(int level, {LayerHitNotifier? hitNotifier}) { height: 21, point: point, child: Icon( - icon, + findToiletIcon(type), color: Colors.purple, ), alignment: Alignment.center, diff --git a/lib/controllers/isar_controller.dart b/lib/controllers/isar_controller.dart new file mode 100644 index 0000000..d9dc7fd --- /dev/null +++ b/lib/controllers/isar_controller.dart @@ -0,0 +1,74 @@ +import 'package:get/get.dart'; +import 'package:isar/isar.dart'; +import 'package:path_provider/path_provider.dart'; + +part 'isar_controller.g.dart'; + +/// Manages the initialization and access to the Isar database instance. +/// +/// The `IsarController` class is responsible for initializing the Isar database +/// and providing access to the database instance. It ensures that the Isar +/// instance is properly initialized before it can be accessed. +/// +/// The `initializeIsar()` method is used to initialize the Isar instance by +/// opening the database with the provided schema. Make sure to call this before +/// calling anything else!. The `isar` getter returns the +/// Isar instance, throwing an exception if the instance is not yet initialized. +class IsarController { + late Isar _isar; + + late final Rx settings; + + IsarController(); + + Future initializeIsar() async { + final dir = await getApplicationDocumentsDirectory(); + _isar = await Isar.open( + [SettingsSchema], + directory: dir.path, + ); + settings = (await _isar.settings.get(1) ?? Settings()).obs; + _isar.settings.watchObject(1).forEach((element) { + if (element != null) settings.value = element; + }); + } + + Future persistSettings() async { + await _isar.writeTxn(() async { + await _isar.settings.put(settings.value); + }); + } + + Isar get isar { + if (_isar == null) { + throw Exception('Isar is not initialized'); + } + return _isar; + } +} + +@collection +class Settings { + Id id = 1; + + bool showIcons = true; + + bool showElevators = true; + bool showFoodAndDrink = true; + bool showLectureHalls = true; + bool showComputerPools = true; + bool showSeminarRooms = true; + bool showToilets = true; + bool showStairs = true; + bool showDoors = true; + + bool maleToilets = false; + bool femaleToilets = false; + bool handicapToilets = false; +} + +enum ToiletPreference { + male, + female, + disabled, +} diff --git a/lib/controllers/isar_controller.g.dart b/lib/controllers/isar_controller.g.dart new file mode 100644 index 0000000..58a09bd --- /dev/null +++ b/lib/controllers/isar_controller.g.dart @@ -0,0 +1,910 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'isar_controller.dart'; + +// ************************************************************************** +// IsarCollectionGenerator +// ************************************************************************** + +// coverage:ignore-file +// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_checks, join_return_with_assignment, prefer_final_locals, avoid_js_rounded_ints, avoid_positional_boolean_parameters, always_specify_types + +extension GetSettingsCollection on Isar { + IsarCollection get settings => this.collection(); +} + +const SettingsSchema = CollectionSchema( + name: r'Settings', + id: -8656046621518759136, + properties: { + r'femaleToilets': PropertySchema( + id: 0, + name: r'femaleToilets', + type: IsarType.bool, + ), + r'handicapToilets': PropertySchema( + id: 1, + name: r'handicapToilets', + type: IsarType.bool, + ), + r'maleToilets': PropertySchema( + id: 2, + name: r'maleToilets', + type: IsarType.bool, + ), + r'showComputerPools': PropertySchema( + id: 3, + name: r'showComputerPools', + type: IsarType.bool, + ), + r'showDoors': PropertySchema( + id: 4, + name: r'showDoors', + type: IsarType.bool, + ), + r'showElevators': PropertySchema( + id: 5, + name: r'showElevators', + type: IsarType.bool, + ), + r'showFoodAndDrink': PropertySchema( + id: 6, + name: r'showFoodAndDrink', + type: IsarType.bool, + ), + r'showIcons': PropertySchema( + id: 7, + name: r'showIcons', + type: IsarType.bool, + ), + r'showLectureHalls': PropertySchema( + id: 8, + name: r'showLectureHalls', + type: IsarType.bool, + ), + r'showSeminarRooms': PropertySchema( + id: 9, + name: r'showSeminarRooms', + type: IsarType.bool, + ), + r'showStairs': PropertySchema( + id: 10, + name: r'showStairs', + type: IsarType.bool, + ), + r'showToilets': PropertySchema( + id: 11, + name: r'showToilets', + type: IsarType.bool, + ) + }, + estimateSize: _settingsEstimateSize, + serialize: _settingsSerialize, + deserialize: _settingsDeserialize, + deserializeProp: _settingsDeserializeProp, + idName: r'id', + indexes: {}, + links: {}, + embeddedSchemas: {}, + getId: _settingsGetId, + getLinks: _settingsGetLinks, + attach: _settingsAttach, + version: '3.1.0+1', +); + +int _settingsEstimateSize( + Settings object, + List offsets, + Map> allOffsets, +) { + var bytesCount = offsets.last; + return bytesCount; +} + +void _settingsSerialize( + Settings object, + IsarWriter writer, + List offsets, + Map> allOffsets, +) { + writer.writeBool(offsets[0], object.femaleToilets); + writer.writeBool(offsets[1], object.handicapToilets); + writer.writeBool(offsets[2], object.maleToilets); + writer.writeBool(offsets[3], object.showComputerPools); + writer.writeBool(offsets[4], object.showDoors); + writer.writeBool(offsets[5], object.showElevators); + writer.writeBool(offsets[6], object.showFoodAndDrink); + writer.writeBool(offsets[7], object.showIcons); + writer.writeBool(offsets[8], object.showLectureHalls); + writer.writeBool(offsets[9], object.showSeminarRooms); + writer.writeBool(offsets[10], object.showStairs); + writer.writeBool(offsets[11], object.showToilets); +} + +Settings _settingsDeserialize( + Id id, + IsarReader reader, + List offsets, + Map> allOffsets, +) { + final object = Settings(); + object.femaleToilets = reader.readBool(offsets[0]); + object.handicapToilets = reader.readBool(offsets[1]); + object.id = id; + object.maleToilets = reader.readBool(offsets[2]); + object.showComputerPools = reader.readBool(offsets[3]); + object.showDoors = reader.readBool(offsets[4]); + object.showElevators = reader.readBool(offsets[5]); + object.showFoodAndDrink = reader.readBool(offsets[6]); + object.showIcons = reader.readBool(offsets[7]); + object.showLectureHalls = reader.readBool(offsets[8]); + object.showSeminarRooms = reader.readBool(offsets[9]); + object.showStairs = reader.readBool(offsets[10]); + object.showToilets = reader.readBool(offsets[11]); + return object; +} + +P _settingsDeserializeProp

( + IsarReader reader, + int propertyId, + int offset, + Map> allOffsets, +) { + switch (propertyId) { + case 0: + return (reader.readBool(offset)) as P; + case 1: + return (reader.readBool(offset)) as P; + case 2: + return (reader.readBool(offset)) as P; + case 3: + return (reader.readBool(offset)) as P; + case 4: + return (reader.readBool(offset)) as P; + case 5: + return (reader.readBool(offset)) as P; + case 6: + return (reader.readBool(offset)) as P; + case 7: + return (reader.readBool(offset)) as P; + case 8: + return (reader.readBool(offset)) as P; + case 9: + return (reader.readBool(offset)) as P; + case 10: + return (reader.readBool(offset)) as P; + case 11: + return (reader.readBool(offset)) as P; + default: + throw IsarError('Unknown property with id $propertyId'); + } +} + +Id _settingsGetId(Settings object) { + return object.id; +} + +List> _settingsGetLinks(Settings object) { + return []; +} + +void _settingsAttach(IsarCollection col, Id id, Settings object) { + object.id = id; +} + +extension SettingsQueryWhereSort on QueryBuilder { + QueryBuilder anyId() { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(const IdWhereClause.any()); + }); + } +} + +extension SettingsQueryWhere on QueryBuilder { + QueryBuilder idEqualTo(Id id) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IdWhereClause.between( + lower: id, + upper: id, + )); + }); + } + + QueryBuilder idNotEqualTo(Id id) { + return QueryBuilder.apply(this, (query) { + if (query.whereSort == Sort.asc) { + return query + .addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: false), + ) + .addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: false), + ); + } else { + return query + .addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: false), + ) + .addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: false), + ); + } + }); + } + + QueryBuilder idGreaterThan(Id id, + {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: include), + ); + }); + } + + QueryBuilder idLessThan(Id id, + {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: include), + ); + }); + } + + QueryBuilder idBetween( + Id lowerId, + Id upperId, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + )); + }); + } +} + +extension SettingsQueryFilter + on QueryBuilder { + QueryBuilder femaleToiletsEqualTo( + bool value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'femaleToilets', + value: value, + )); + }); + } + + QueryBuilder + handicapToiletsEqualTo(bool value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'handicapToilets', + value: value, + )); + }); + } + + QueryBuilder idEqualTo(Id value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idGreaterThan( + Id value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idLessThan( + Id value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idBetween( + Id lower, + Id upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder maleToiletsEqualTo( + bool value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'maleToilets', + value: value, + )); + }); + } + + QueryBuilder + showComputerPoolsEqualTo(bool value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'showComputerPools', + value: value, + )); + }); + } + + QueryBuilder showDoorsEqualTo( + bool value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'showDoors', + value: value, + )); + }); + } + + QueryBuilder showElevatorsEqualTo( + bool value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'showElevators', + value: value, + )); + }); + } + + QueryBuilder + showFoodAndDrinkEqualTo(bool value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'showFoodAndDrink', + value: value, + )); + }); + } + + QueryBuilder showIconsEqualTo( + bool value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'showIcons', + value: value, + )); + }); + } + + QueryBuilder + showLectureHallsEqualTo(bool value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'showLectureHalls', + value: value, + )); + }); + } + + QueryBuilder + showSeminarRoomsEqualTo(bool value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'showSeminarRooms', + value: value, + )); + }); + } + + QueryBuilder showStairsEqualTo( + bool value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'showStairs', + value: value, + )); + }); + } + + QueryBuilder showToiletsEqualTo( + bool value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'showToilets', + value: value, + )); + }); + } +} + +extension SettingsQueryObject + on QueryBuilder {} + +extension SettingsQueryLinks + on QueryBuilder {} + +extension SettingsQuerySortBy on QueryBuilder { + QueryBuilder sortByFemaleToilets() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'femaleToilets', Sort.asc); + }); + } + + QueryBuilder sortByFemaleToiletsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'femaleToilets', Sort.desc); + }); + } + + QueryBuilder sortByHandicapToilets() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'handicapToilets', Sort.asc); + }); + } + + QueryBuilder sortByHandicapToiletsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'handicapToilets', Sort.desc); + }); + } + + QueryBuilder sortByMaleToilets() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'maleToilets', Sort.asc); + }); + } + + QueryBuilder sortByMaleToiletsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'maleToilets', Sort.desc); + }); + } + + QueryBuilder sortByShowComputerPools() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showComputerPools', Sort.asc); + }); + } + + QueryBuilder sortByShowComputerPoolsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showComputerPools', Sort.desc); + }); + } + + QueryBuilder sortByShowDoors() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showDoors', Sort.asc); + }); + } + + QueryBuilder sortByShowDoorsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showDoors', Sort.desc); + }); + } + + QueryBuilder sortByShowElevators() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showElevators', Sort.asc); + }); + } + + QueryBuilder sortByShowElevatorsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showElevators', Sort.desc); + }); + } + + QueryBuilder sortByShowFoodAndDrink() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showFoodAndDrink', Sort.asc); + }); + } + + QueryBuilder sortByShowFoodAndDrinkDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showFoodAndDrink', Sort.desc); + }); + } + + QueryBuilder sortByShowIcons() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showIcons', Sort.asc); + }); + } + + QueryBuilder sortByShowIconsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showIcons', Sort.desc); + }); + } + + QueryBuilder sortByShowLectureHalls() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showLectureHalls', Sort.asc); + }); + } + + QueryBuilder sortByShowLectureHallsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showLectureHalls', Sort.desc); + }); + } + + QueryBuilder sortByShowSeminarRooms() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showSeminarRooms', Sort.asc); + }); + } + + QueryBuilder sortByShowSeminarRoomsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showSeminarRooms', Sort.desc); + }); + } + + QueryBuilder sortByShowStairs() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showStairs', Sort.asc); + }); + } + + QueryBuilder sortByShowStairsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showStairs', Sort.desc); + }); + } + + QueryBuilder sortByShowToilets() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showToilets', Sort.asc); + }); + } + + QueryBuilder sortByShowToiletsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showToilets', Sort.desc); + }); + } +} + +extension SettingsQuerySortThenBy + on QueryBuilder { + QueryBuilder thenByFemaleToilets() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'femaleToilets', Sort.asc); + }); + } + + QueryBuilder thenByFemaleToiletsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'femaleToilets', Sort.desc); + }); + } + + QueryBuilder thenByHandicapToilets() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'handicapToilets', Sort.asc); + }); + } + + QueryBuilder thenByHandicapToiletsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'handicapToilets', Sort.desc); + }); + } + + QueryBuilder thenById() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'id', Sort.asc); + }); + } + + QueryBuilder thenByIdDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'id', Sort.desc); + }); + } + + QueryBuilder thenByMaleToilets() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'maleToilets', Sort.asc); + }); + } + + QueryBuilder thenByMaleToiletsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'maleToilets', Sort.desc); + }); + } + + QueryBuilder thenByShowComputerPools() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showComputerPools', Sort.asc); + }); + } + + QueryBuilder thenByShowComputerPoolsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showComputerPools', Sort.desc); + }); + } + + QueryBuilder thenByShowDoors() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showDoors', Sort.asc); + }); + } + + QueryBuilder thenByShowDoorsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showDoors', Sort.desc); + }); + } + + QueryBuilder thenByShowElevators() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showElevators', Sort.asc); + }); + } + + QueryBuilder thenByShowElevatorsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showElevators', Sort.desc); + }); + } + + QueryBuilder thenByShowFoodAndDrink() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showFoodAndDrink', Sort.asc); + }); + } + + QueryBuilder thenByShowFoodAndDrinkDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showFoodAndDrink', Sort.desc); + }); + } + + QueryBuilder thenByShowIcons() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showIcons', Sort.asc); + }); + } + + QueryBuilder thenByShowIconsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showIcons', Sort.desc); + }); + } + + QueryBuilder thenByShowLectureHalls() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showLectureHalls', Sort.asc); + }); + } + + QueryBuilder thenByShowLectureHallsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showLectureHalls', Sort.desc); + }); + } + + QueryBuilder thenByShowSeminarRooms() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showSeminarRooms', Sort.asc); + }); + } + + QueryBuilder thenByShowSeminarRoomsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showSeminarRooms', Sort.desc); + }); + } + + QueryBuilder thenByShowStairs() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showStairs', Sort.asc); + }); + } + + QueryBuilder thenByShowStairsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showStairs', Sort.desc); + }); + } + + QueryBuilder thenByShowToilets() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showToilets', Sort.asc); + }); + } + + QueryBuilder thenByShowToiletsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'showToilets', Sort.desc); + }); + } +} + +extension SettingsQueryWhereDistinct + on QueryBuilder { + QueryBuilder distinctByFemaleToilets() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'femaleToilets'); + }); + } + + QueryBuilder distinctByHandicapToilets() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'handicapToilets'); + }); + } + + QueryBuilder distinctByMaleToilets() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'maleToilets'); + }); + } + + QueryBuilder distinctByShowComputerPools() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'showComputerPools'); + }); + } + + QueryBuilder distinctByShowDoors() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'showDoors'); + }); + } + + QueryBuilder distinctByShowElevators() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'showElevators'); + }); + } + + QueryBuilder distinctByShowFoodAndDrink() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'showFoodAndDrink'); + }); + } + + QueryBuilder distinctByShowIcons() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'showIcons'); + }); + } + + QueryBuilder distinctByShowLectureHalls() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'showLectureHalls'); + }); + } + + QueryBuilder distinctByShowSeminarRooms() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'showSeminarRooms'); + }); + } + + QueryBuilder distinctByShowStairs() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'showStairs'); + }); + } + + QueryBuilder distinctByShowToilets() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'showToilets'); + }); + } +} + +extension SettingsQueryProperty + on QueryBuilder { + QueryBuilder idProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'id'); + }); + } + + QueryBuilder femaleToiletsProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'femaleToilets'); + }); + } + + QueryBuilder handicapToiletsProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'handicapToilets'); + }); + } + + QueryBuilder maleToiletsProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'maleToilets'); + }); + } + + QueryBuilder showComputerPoolsProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'showComputerPools'); + }); + } + + QueryBuilder showDoorsProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'showDoors'); + }); + } + + QueryBuilder showElevatorsProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'showElevators'); + }); + } + + QueryBuilder showFoodAndDrinkProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'showFoodAndDrink'); + }); + } + + QueryBuilder showIconsProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'showIcons'); + }); + } + + QueryBuilder showLectureHallsProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'showLectureHalls'); + }); + } + + QueryBuilder showSeminarRoomsProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'showSeminarRooms'); + }); + } + + QueryBuilder showStairsProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'showStairs'); + }); + } + + QueryBuilder showToiletsProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'showToilets'); + }); + } +} diff --git a/lib/data/geo/parser.dart b/lib/data/geo/parser.dart index e6481c1..a28df80 100644 --- a/lib/data/geo/parser.dart +++ b/lib/data/geo/parser.dart @@ -34,7 +34,9 @@ Result parseFeature( } yaml = yaml as YamlMap? ?? {}; - final description = yaml['desription'] as String?; + final description = yaml['description'] as String?; + + // if (description != null) print("================ $description"); final building = yaml['building'] as String?; diff --git a/lib/data/settings/settings_model.dart b/lib/data/settings/settings_model.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/main.dart b/lib/main.dart index 6ca9fb1..286c808 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,11 +1,18 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; +import 'package:uninav/controllers/isar_controller.dart'; import 'package:uninav/controllers/map_controller.dart'; import 'package:uninav/map.dart'; import 'package:uninav/settings.dart'; -void main() { +// TODO: maybe make not async? +void main() async { Get.put(MyMapController()); + await Get.putAsync(() async { + final controller = IsarController(); + await controller.initializeIsar(); + return controller; + }); runApp(const MyApp()); } diff --git a/lib/map.dart b/lib/map.dart index 5569515..64b70d8 100644 --- a/lib/map.dart +++ b/lib/map.dart @@ -127,27 +127,55 @@ class MapPage extends StatelessWidget { ), padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), - child: Obx( - () => DropdownButton( - value: Get.find().currentLevel.value, - style: TextStyle( - color: Theme.of(context).colorScheme.onSurface), - dropdownColor: Theme.of(context).colorScheme.surface, - onChanged: (int? newValue) { - if (newValue != null) { - Get.find().setLevel(newValue); - } - // Handle dropdown value change - }, - items: Get.find() - .levels - .map>((int value) { - return DropdownMenuItem( - value: value, - child: Text("Level $value"), - ); - }).toList(), - ), + child: Row( + children: [ + Obx( + () => DropdownButton( + value: Get.find().currentLevel.value, + style: TextStyle( + color: Theme.of(context).colorScheme.onSurface), + dropdownColor: Theme.of(context).colorScheme.surface, + onChanged: (int? newValue) { + if (newValue != null) { + Get.find().setLevel(newValue); + } + // Handle dropdown value change + }, + items: Get.find() + .levels + .map>((int value) { + return DropdownMenuItem( + value: value, + child: Text("Level $value"), + ); + }).toList(), + ), + ), + IconButton( + icon: const Icon(Icons.arrow_upward), + onPressed: () { + int currentLevel = + Get.find().currentLevel.value; + if (currentLevel < + Get.find().levels.last) { + Get.find() + .setLevel(currentLevel + 1); + } + }, + ), + IconButton( + icon: const Icon(Icons.arrow_downward), + onPressed: () { + int currentLevel = + Get.find().currentLevel.value; + if (currentLevel > + Get.find().levels.first) { + Get.find() + .setLevel(currentLevel - 1); + } + }, + ), + ], ), )), ], diff --git a/lib/settings.dart b/lib/settings.dart index 1ebd1ea..bb1d4c9 100644 --- a/lib/settings.dart +++ b/lib/settings.dart @@ -1,20 +1,171 @@ import 'package:flutter/material.dart'; +import 'package:get/get.dart'; import 'package:uninav/components/drawer.dart'; import 'package:uninav/components/hamburger_menu.dart'; +import 'package:uninav/controllers/isar_controller.dart'; class SettingsPage extends StatelessWidget { const SettingsPage({super.key}); @override Widget build(BuildContext context) { + final isarController = Get.find(); + final settings = isarController.settings; + return Scaffold( appBar: AppBar( title: const Text('Settings'), leading: HamburgerMenu(), ), drawer: MyDrawer(), - body: const Center( - child: Text('TODO'), + body: SingleChildScrollView( + child: Column( + children: [ + Obx( + () => Column( + children: [ + SwitchListTile( + title: const Text('Show Icons'), + subtitle: const Text( + 'Warning: disables ALL icons', + style: TextStyle(color: Colors.red, fontSize: 12), + ), + value: settings.value.showIcons, + onChanged: (value) { + settings.update((val) { + val?.showIcons = value; + }); + isarController.persistSettings(); + }, + ), + SwitchListTile( + title: const Text('Show Elevators'), + value: settings.value.showElevators, + onChanged: (value) { + settings.update((val) { + val?.showElevators = value; + }); + isarController.persistSettings(); + }, + ), + SwitchListTile( + title: const Text('Show Food and Drink'), + value: settings.value.showFoodAndDrink, + onChanged: (value) { + settings.update((val) { + val?.showFoodAndDrink = value; + }); + isarController.persistSettings(); + }, + ), + SwitchListTile( + title: const Text('Show Lecture Halls'), + value: settings.value.showLectureHalls, + onChanged: (value) { + settings.update((val) { + val?.showLectureHalls = value; + }); + isarController.persistSettings(); + }, + ), + SwitchListTile( + title: const Text('Show Computer Pools'), + value: settings.value.showComputerPools, + onChanged: (value) { + settings.update((val) { + val?.showComputerPools = value; + }); + isarController.persistSettings(); + }, + ), + SwitchListTile( + title: const Text('Show Seminar Rooms'), + value: settings.value.showSeminarRooms, + onChanged: (value) { + settings.update((val) { + val?.showSeminarRooms = value; + }); + isarController.persistSettings(); + }, + ), + SwitchListTile( + title: const Text('Show Toilets'), + value: settings.value.showToilets, + onChanged: (value) { + settings.update((val) { + val?.showToilets = value; + }); + isarController.persistSettings(); + }, + ), + SwitchListTile( + title: const Text('Show Stairs'), + value: settings.value.showStairs, + onChanged: (value) { + settings.update((val) { + val?.showStairs = value; + }); + isarController.persistSettings(); + }, + ), + SwitchListTile( + title: const Text('Show Doors'), + value: settings.value.showDoors, + onChanged: (value) { + settings.update((val) { + val?.showDoors = value; + }); + isarController.persistSettings(); + }, + ), + const SizedBox(height: 12), + const Padding( + padding: EdgeInsets.only(left: 8.0), + child: Text('Toilet Preference'), + ), + CheckboxListTile( + title: const Text('Male Toilets'), + value: settings.value.maleToilets, + onChanged: (value) { + settings.update((val) { + val?.maleToilets = value ?? false; + }); + isarController.persistSettings(); + }, + ), + CheckboxListTile( + title: const Text('Female Toilets'), + value: settings.value.femaleToilets, + onChanged: (value) { + settings.update((val) { + val?.femaleToilets = value ?? false; + }); + isarController.persistSettings(); + }, + ), + CheckboxListTile( + title: const Text('Handicap Toilets'), + value: settings.value.handicapToilets, + onChanged: (value) { + settings.update((val) { + val?.handicapToilets = value ?? false; + }); + isarController.persistSettings(); + }, + ), + const SizedBox(height: 12), + ElevatedButton( + onPressed: () { + settings.value = Settings(); + isarController.persistSettings(); + }, + child: const Text("Reset Settings"), + ), + ], + ), + ), + ], + ), ), ); } diff --git a/lib/util/util.dart b/lib/util/util.dart index 06b961f..4d65f4e 100644 --- a/lib/util/util.dart +++ b/lib/util/util.dart @@ -1,3 +1,5 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; import 'package:uninav/data/geo/model.dart'; String formatDuration(Duration duration) { @@ -65,3 +67,17 @@ String formatDistance(int distanceInMeters) { } } } + +IconData findToiletIcon(String type) { + switch (type.toLowerCase()) { + case 'male': + return Icons.male; + case 'female': + return Icons.female; + case 'handicap': + return Icons.accessible; + default: + print("WARN: Toilet didn't have recognizable type! Type was '$type'"); + return Icons.wc; + } +} diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index f6f23bf..bfc0d08 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -6,9 +6,13 @@ #include "generated_plugin_registrant.h" +#include #include void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) isar_flutter_libs_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "IsarFlutterLibsPlugin"); + isar_flutter_libs_plugin_register_with_registrar(isar_flutter_libs_registrar); g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index f16b4c3..6237f02 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + isar_flutter_libs url_launcher_linux ) diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 8236f57..adf3885 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,8 +5,12 @@ import FlutterMacOS import Foundation +import isar_flutter_libs +import path_provider_foundation import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + IsarFlutterLibsPlugin.register(with: registry.registrar(forPlugin: "IsarFlutterLibsPlugin")) + PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/pubspec.lock b/pubspec.lock index 40c11bc..49176c6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,18 +5,18 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" + sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a url: "https://pub.dev" source: hosted - version: "67.0.0" + version: "61.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" + sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 url: "https://pub.dev" source: hosted - version: "6.4.1" + version: "5.13.0" anim_search_bar: dependency: "direct main" description: @@ -197,10 +197,18 @@ packages: dependency: transitive description: name: dart_style - sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9" + sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" url: "https://pub.dev" source: hosted - version: "2.3.6" + version: "2.3.2" + dartx: + dependency: transitive + description: + name: dartx + sha256: "8b25435617027257d43e6508b5fe061012880ddfdaa75a71d607c3de2a13d244" + url: "https://pub.dev" + source: hosted + version: "1.2.0" fake_async: dependency: transitive description: @@ -209,6 +217,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" + ffi: + dependency: transitive + description: + name: ffi + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" + url: "https://pub.dev" + source: hosted + version: "2.1.2" file: dependency: transitive description: @@ -352,14 +368,38 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.4" + isar: + dependency: "direct main" + description: + name: isar + sha256: "99165dadb2cf2329d3140198363a7e7bff9bbd441871898a87e26914d25cf1ea" + url: "https://pub.dev" + source: hosted + version: "3.1.0+1" + isar_flutter_libs: + dependency: "direct main" + description: + name: isar_flutter_libs + sha256: bc6768cc4b9c61aabff77152e7f33b4b17d2fc93134f7af1c3dd51500fe8d5e8 + url: "https://pub.dev" + source: hosted + version: "3.1.0+1" + isar_generator: + dependency: "direct dev" + description: + name: isar_generator + sha256: "76c121e1295a30423604f2f819bc255bc79f852f3bc8743a24017df6068ad133" + url: "https://pub.dev" + source: hosted + version: "3.1.0+1" js: dependency: transitive description: name: js - sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "0.7.1" + version: "0.6.7" json_annotation: dependency: "direct main" description: @@ -496,6 +536,62 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.0" + path_provider: + dependency: "direct main" + description: + name: path_provider + sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161 + url: "https://pub.dev" + source: hosted + version: "2.1.3" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: a248d8146ee5983446bf03ed5ea8f6533129a12b11f12057ad1b4a67a2b3b41d + url: "https://pub.dev" + source: hosted + version: "2.2.4" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" + url: "https://pub.dev" + source: hosted + version: "2.2.1" + platform: + dependency: transitive + description: + name: platform + sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" + url: "https://pub.dev" + source: hosted + version: "3.1.4" plugin_platform_interface: dependency: transitive description: @@ -661,6 +757,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.1" + time: + dependency: transitive + description: + name: time + sha256: ad8e018a6c9db36cb917a031853a1aae49467a93e0d464683e029537d848c221 + url: "https://pub.dev" + source: hosted + version: "2.1.4" timing: dependency: transitive description: @@ -797,6 +901,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.4.5" + win32: + dependency: transitive + description: + name: win32 + sha256: "0a989dc7ca2bb51eac91e8fd00851297cfffd641aa7538b165c62637ca0eaa4a" + url: "https://pub.dev" + source: hosted + version: "5.4.0" wkt_parser: dependency: transitive description: @@ -805,6 +917,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.0" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d + url: "https://pub.dev" + source: hosted + version: "1.0.4" + xxh3: + dependency: transitive + description: + name: xxh3 + sha256: a92b30944a9aeb4e3d4f3c3d4ddb3c7816ca73475cd603682c4f8149690f56d7 + url: "https://pub.dev" + source: hosted + version: "1.0.1" yaml: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 6ff9234..47b4e9f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -50,6 +50,9 @@ dependencies: json_annotation: ^4.8.1 rust_core: ^0.5.3 anyhow: ^1.3.0 + isar: ^3.1.0+1 + isar_flutter_libs: ^3.1.0+1 + path_provider: ^2.1.3 dev_dependencies: flutter_test: @@ -64,6 +67,7 @@ dev_dependencies: build_runner: ^2.4.9 freezed: ^2.5.2 json_serializable: ^6.7.1 + isar_generator: ^3.1.0+1 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 4f78848..65cb334 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,9 +6,12 @@ #include "generated_plugin_registrant.h" +#include #include void RegisterPlugins(flutter::PluginRegistry* registry) { + IsarFlutterLibsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("IsarFlutterLibsPlugin")); UrlLauncherWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 88b22e5..439b324 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + isar_flutter_libs url_launcher_windows )