feat: major progress
This commit is contained in:
@ -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),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,9 @@ Future<void> 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<void> 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<void> showFeatureBottomSheet(
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
],
|
||||
if (feature.description != null) ...[
|
||||
Text(feature.description!),
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
..._buildFeatureContent(feature),
|
||||
]),
|
||||
),
|
||||
@ -113,17 +119,89 @@ List<Widget> _buildDoorContent(Feature feature, List<String> connects) {
|
||||
|
||||
/// Builds the content for the Toilet feature type.
|
||||
List<Widget> _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<Widget> _buildStairsContent(Feature feature, List<int> 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<Widget> _buildLiftContent(Feature feature, List<int> 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.
|
||||
|
@ -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<Widget> renderLevel(int level, {LayerHitNotifier? hitNotifier}) {
|
||||
return <Widget>[
|
||||
@ -77,24 +78,6 @@ List<Widget> 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<Widget> renderLevel(int level, {LayerHitNotifier? hitNotifier}) {
|
||||
height: 21,
|
||||
point: point,
|
||||
child: Icon(
|
||||
icon,
|
||||
findToiletIcon(type),
|
||||
color: Colors.purple,
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
|
74
lib/controllers/isar_controller.dart
Normal file
74
lib/controllers/isar_controller.dart
Normal file
@ -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> settings;
|
||||
|
||||
IsarController();
|
||||
|
||||
Future<void> 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<void> 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,
|
||||
}
|
910
lib/controllers/isar_controller.g.dart
Normal file
910
lib/controllers/isar_controller.g.dart
Normal file
@ -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<Settings> 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<int> offsets,
|
||||
Map<Type, List<int>> allOffsets,
|
||||
) {
|
||||
var bytesCount = offsets.last;
|
||||
return bytesCount;
|
||||
}
|
||||
|
||||
void _settingsSerialize(
|
||||
Settings object,
|
||||
IsarWriter writer,
|
||||
List<int> offsets,
|
||||
Map<Type, List<int>> 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<int> offsets,
|
||||
Map<Type, List<int>> 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<P>(
|
||||
IsarReader reader,
|
||||
int propertyId,
|
||||
int offset,
|
||||
Map<Type, List<int>> 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<IsarLinkBase<dynamic>> _settingsGetLinks(Settings object) {
|
||||
return [];
|
||||
}
|
||||
|
||||
void _settingsAttach(IsarCollection<dynamic> col, Id id, Settings object) {
|
||||
object.id = id;
|
||||
}
|
||||
|
||||
extension SettingsQueryWhereSort on QueryBuilder<Settings, Settings, QWhere> {
|
||||
QueryBuilder<Settings, Settings, QAfterWhere> anyId() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addWhereClause(const IdWhereClause.any());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extension SettingsQueryWhere on QueryBuilder<Settings, Settings, QWhereClause> {
|
||||
QueryBuilder<Settings, Settings, QAfterWhereClause> idEqualTo(Id id) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addWhereClause(IdWhereClause.between(
|
||||
lower: id,
|
||||
upper: id,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterWhereClause> 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<Settings, Settings, QAfterWhereClause> idGreaterThan(Id id,
|
||||
{bool include = false}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addWhereClause(
|
||||
IdWhereClause.greaterThan(lower: id, includeLower: include),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterWhereClause> idLessThan(Id id,
|
||||
{bool include = false}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addWhereClause(
|
||||
IdWhereClause.lessThan(upper: id, includeUpper: include),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterWhereClause> 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<Settings, Settings, QFilterCondition> {
|
||||
QueryBuilder<Settings, Settings, QAfterFilterCondition> femaleToiletsEqualTo(
|
||||
bool value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'femaleToilets',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterFilterCondition>
|
||||
handicapToiletsEqualTo(bool value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'handicapToilets',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterFilterCondition> idEqualTo(Id value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'id',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterFilterCondition> idGreaterThan(
|
||||
Id value, {
|
||||
bool include = false,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
||||
include: include,
|
||||
property: r'id',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterFilterCondition> idLessThan(
|
||||
Id value, {
|
||||
bool include = false,
|
||||
}) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.lessThan(
|
||||
include: include,
|
||||
property: r'id',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterFilterCondition> 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<Settings, Settings, QAfterFilterCondition> maleToiletsEqualTo(
|
||||
bool value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'maleToilets',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterFilterCondition>
|
||||
showComputerPoolsEqualTo(bool value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'showComputerPools',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterFilterCondition> showDoorsEqualTo(
|
||||
bool value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'showDoors',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterFilterCondition> showElevatorsEqualTo(
|
||||
bool value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'showElevators',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterFilterCondition>
|
||||
showFoodAndDrinkEqualTo(bool value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'showFoodAndDrink',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterFilterCondition> showIconsEqualTo(
|
||||
bool value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'showIcons',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterFilterCondition>
|
||||
showLectureHallsEqualTo(bool value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'showLectureHalls',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterFilterCondition>
|
||||
showSeminarRoomsEqualTo(bool value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'showSeminarRooms',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterFilterCondition> showStairsEqualTo(
|
||||
bool value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'showStairs',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterFilterCondition> showToiletsEqualTo(
|
||||
bool value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'showToilets',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extension SettingsQueryObject
|
||||
on QueryBuilder<Settings, Settings, QFilterCondition> {}
|
||||
|
||||
extension SettingsQueryLinks
|
||||
on QueryBuilder<Settings, Settings, QFilterCondition> {}
|
||||
|
||||
extension SettingsQuerySortBy on QueryBuilder<Settings, Settings, QSortBy> {
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByFemaleToilets() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'femaleToilets', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByFemaleToiletsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'femaleToilets', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByHandicapToilets() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'handicapToilets', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByHandicapToiletsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'handicapToilets', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByMaleToilets() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'maleToilets', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByMaleToiletsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'maleToilets', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByShowComputerPools() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showComputerPools', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByShowComputerPoolsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showComputerPools', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByShowDoors() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showDoors', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByShowDoorsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showDoors', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByShowElevators() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showElevators', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByShowElevatorsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showElevators', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByShowFoodAndDrink() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showFoodAndDrink', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByShowFoodAndDrinkDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showFoodAndDrink', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByShowIcons() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showIcons', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByShowIconsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showIcons', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByShowLectureHalls() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showLectureHalls', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByShowLectureHallsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showLectureHalls', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByShowSeminarRooms() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showSeminarRooms', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByShowSeminarRoomsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showSeminarRooms', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByShowStairs() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showStairs', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByShowStairsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showStairs', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByShowToilets() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showToilets', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> sortByShowToiletsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showToilets', Sort.desc);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extension SettingsQuerySortThenBy
|
||||
on QueryBuilder<Settings, Settings, QSortThenBy> {
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByFemaleToilets() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'femaleToilets', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByFemaleToiletsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'femaleToilets', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByHandicapToilets() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'handicapToilets', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByHandicapToiletsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'handicapToilets', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenById() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'id', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByIdDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'id', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByMaleToilets() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'maleToilets', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByMaleToiletsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'maleToilets', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByShowComputerPools() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showComputerPools', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByShowComputerPoolsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showComputerPools', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByShowDoors() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showDoors', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByShowDoorsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showDoors', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByShowElevators() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showElevators', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByShowElevatorsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showElevators', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByShowFoodAndDrink() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showFoodAndDrink', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByShowFoodAndDrinkDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showFoodAndDrink', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByShowIcons() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showIcons', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByShowIconsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showIcons', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByShowLectureHalls() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showLectureHalls', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByShowLectureHallsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showLectureHalls', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByShowSeminarRooms() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showSeminarRooms', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByShowSeminarRoomsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showSeminarRooms', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByShowStairs() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showStairs', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByShowStairsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showStairs', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByShowToilets() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showToilets', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QAfterSortBy> thenByShowToiletsDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'showToilets', Sort.desc);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extension SettingsQueryWhereDistinct
|
||||
on QueryBuilder<Settings, Settings, QDistinct> {
|
||||
QueryBuilder<Settings, Settings, QDistinct> distinctByFemaleToilets() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addDistinctBy(r'femaleToilets');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QDistinct> distinctByHandicapToilets() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addDistinctBy(r'handicapToilets');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QDistinct> distinctByMaleToilets() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addDistinctBy(r'maleToilets');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QDistinct> distinctByShowComputerPools() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addDistinctBy(r'showComputerPools');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QDistinct> distinctByShowDoors() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addDistinctBy(r'showDoors');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QDistinct> distinctByShowElevators() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addDistinctBy(r'showElevators');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QDistinct> distinctByShowFoodAndDrink() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addDistinctBy(r'showFoodAndDrink');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QDistinct> distinctByShowIcons() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addDistinctBy(r'showIcons');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QDistinct> distinctByShowLectureHalls() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addDistinctBy(r'showLectureHalls');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QDistinct> distinctByShowSeminarRooms() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addDistinctBy(r'showSeminarRooms');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QDistinct> distinctByShowStairs() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addDistinctBy(r'showStairs');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, Settings, QDistinct> distinctByShowToilets() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addDistinctBy(r'showToilets');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extension SettingsQueryProperty
|
||||
on QueryBuilder<Settings, Settings, QQueryProperty> {
|
||||
QueryBuilder<Settings, int, QQueryOperations> idProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'id');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, bool, QQueryOperations> femaleToiletsProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'femaleToilets');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, bool, QQueryOperations> handicapToiletsProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'handicapToilets');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, bool, QQueryOperations> maleToiletsProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'maleToilets');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, bool, QQueryOperations> showComputerPoolsProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'showComputerPools');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, bool, QQueryOperations> showDoorsProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'showDoors');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, bool, QQueryOperations> showElevatorsProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'showElevators');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, bool, QQueryOperations> showFoodAndDrinkProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'showFoodAndDrink');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, bool, QQueryOperations> showIconsProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'showIcons');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, bool, QQueryOperations> showLectureHallsProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'showLectureHalls');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, bool, QQueryOperations> showSeminarRoomsProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'showSeminarRooms');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, bool, QQueryOperations> showStairsProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'showStairs');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Settings, bool, QQueryOperations> showToiletsProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'showToilets');
|
||||
});
|
||||
}
|
||||
}
|
@ -34,7 +34,9 @@ Result<Feature> 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?;
|
||||
|
||||
|
0
lib/data/settings/settings_model.dart
Normal file
0
lib/data/settings/settings_model.dart
Normal file
@ -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());
|
||||
}
|
||||
|
||||
|
70
lib/map.dart
70
lib/map.dart
@ -127,27 +127,55 @@ class MapPage extends StatelessWidget {
|
||||
),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
child: Obx(
|
||||
() => DropdownButton<int>(
|
||||
value: Get.find<MyMapController>().currentLevel.value,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onSurface),
|
||||
dropdownColor: Theme.of(context).colorScheme.surface,
|
||||
onChanged: (int? newValue) {
|
||||
if (newValue != null) {
|
||||
Get.find<MyMapController>().setLevel(newValue);
|
||||
}
|
||||
// Handle dropdown value change
|
||||
},
|
||||
items: Get.find<MyMapController>()
|
||||
.levels
|
||||
.map<DropdownMenuItem<int>>((int value) {
|
||||
return DropdownMenuItem<int>(
|
||||
value: value,
|
||||
child: Text("Level $value"),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Obx(
|
||||
() => DropdownButton<int>(
|
||||
value: Get.find<MyMapController>().currentLevel.value,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onSurface),
|
||||
dropdownColor: Theme.of(context).colorScheme.surface,
|
||||
onChanged: (int? newValue) {
|
||||
if (newValue != null) {
|
||||
Get.find<MyMapController>().setLevel(newValue);
|
||||
}
|
||||
// Handle dropdown value change
|
||||
},
|
||||
items: Get.find<MyMapController>()
|
||||
.levels
|
||||
.map<DropdownMenuItem<int>>((int value) {
|
||||
return DropdownMenuItem<int>(
|
||||
value: value,
|
||||
child: Text("Level $value"),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.arrow_upward),
|
||||
onPressed: () {
|
||||
int currentLevel =
|
||||
Get.find<MyMapController>().currentLevel.value;
|
||||
if (currentLevel <
|
||||
Get.find<MyMapController>().levels.last) {
|
||||
Get.find<MyMapController>()
|
||||
.setLevel(currentLevel + 1);
|
||||
}
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.arrow_downward),
|
||||
onPressed: () {
|
||||
int currentLevel =
|
||||
Get.find<MyMapController>().currentLevel.value;
|
||||
if (currentLevel >
|
||||
Get.find<MyMapController>().levels.first) {
|
||||
Get.find<MyMapController>()
|
||||
.setLevel(currentLevel - 1);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
|
@ -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<IsarController>();
|
||||
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"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user