-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: evacuation screen and small refactor of file structure in digit…
…al guide
- Loading branch information
Tomasz Trela
authored and
Tomasz Trela
committed
Dec 14, 2024
1 parent
90f9e89
commit 15810d5
Showing
21 changed files
with
286 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ntation/widgets/accessibility_button.dart → ...ntation/widgets/accessibility_button.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
lib/features/digital_guide_view/presentation/widgets/digital_guide_go_to_button.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import "package:flutter/material.dart"; | ||
|
||
import "../../../../config/ui_config.dart"; | ||
import "../../../../theme/app_theme.dart"; | ||
import "../../tabs/entraces/data/models/digital_guide_entrace.dart"; | ||
|
||
class DigitalGuideGoToButton extends StatelessWidget { | ||
const DigitalGuideGoToButton({ | ||
super.key, | ||
required this.onTap, | ||
required this.entrace, | ||
}); | ||
|
||
final VoidCallback onTap; | ||
final DigitalGuideEntrace entrace; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return GestureDetector( | ||
onTap: onTap, | ||
child: Container( | ||
padding: DigitalGuideConfig.mediumButtonPadding, | ||
decoration: BoxDecoration( | ||
borderRadius: | ||
BorderRadius.circular(DigitalGuideConfig.borderRadiusMedium), | ||
border: Border.all( | ||
color: DigitalGuideConfig.borderColor, | ||
), | ||
), | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Text( | ||
entrace.translations.pl.name, | ||
style: context.textTheme.title, | ||
), | ||
Icon( | ||
Icons.arrow_forward_ios, | ||
color: context.colorTheme.blueAzure, | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...esentation/widgets/headlines_section.dart → ...esentation/widgets/headlines_section.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
...ion/amenities_expansion_tile_content.dart → ...ion/amenities_expansion_tile_content.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
lib/features/digital_guide_view/tabs/entraces/data/models/digital_guide_entrace.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import "package:freezed_annotation/freezed_annotation.dart"; | ||
|
||
part "digital_guide_entrace.freezed.dart"; | ||
part "digital_guide_entrace.g.dart"; | ||
|
||
@freezed | ||
class DigitalGuideEntrace with _$DigitalGuideEntrace { | ||
const factory DigitalGuideEntrace({ | ||
required int id, | ||
required DigitalGuideTranslationsEntrace translations, | ||
}) = _DigitalGuideEntrace; | ||
|
||
factory DigitalGuideEntrace.fromJson(Map<String, dynamic> json) => | ||
_$DigitalGuideEntraceFromJson(json); | ||
} | ||
|
||
@freezed | ||
class DigitalGuideTranslationsEntrace with _$DigitalGuideTranslationsEntrace { | ||
const factory DigitalGuideTranslationsEntrace({ | ||
required DigitalGuideTranslationEntrace pl, | ||
}) = _DigitalGuideTranslationsEntrace; | ||
|
||
factory DigitalGuideTranslationsEntrace.fromJson(Map<String, dynamic> json) => | ||
_$DigitalGuideTranslationsEntraceFromJson(json); | ||
} | ||
|
||
@freezed | ||
class DigitalGuideTranslationEntrace with _$DigitalGuideTranslationEntrace { | ||
const factory DigitalGuideTranslationEntrace({ | ||
required String name, | ||
required String location, | ||
}) = _DigitalGuideTranslationEntrace; | ||
|
||
factory DigitalGuideTranslationEntrace.fromJson(Map<String, dynamic> json) => | ||
_$DigitalGuideTranslationEntraceFromJson(json); | ||
} |
31 changes: 31 additions & 0 deletions
31
lib/features/digital_guide_view/tabs/entraces/data/repository/entraces_repository.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import "package:fast_immutable_collections/fast_immutable_collections.dart"; | ||
import "package:flutter_riverpod/flutter_riverpod.dart"; | ||
import "package:riverpod_annotation/riverpod_annotation.dart"; | ||
|
||
import "../../../../../../../api_base_rest/client/dio_client.dart"; | ||
import "../../../../../../../config/env.dart"; | ||
|
||
import "../models/digital_guide_entrace.dart"; | ||
|
||
part "entraces_repository.g.dart"; | ||
|
||
@riverpod | ||
Future<IList<DigitalGuideEntrace>> getDigitalGuideEntraces( | ||
Ref ref, | ||
int buildingId, | ||
) async { | ||
final digitalGuideEntranceUrl = | ||
"${Env.digitalGuideUrl}/entrances/?building=$buildingId"; | ||
final dio = ref.read(restClientProvider); | ||
dio.options.headers["Authorization"] = | ||
"Token ${Env.digitalGuideAuthorizationToken}"; | ||
|
||
final response = await dio.get(digitalGuideEntranceUrl); | ||
final data = response.data as List<dynamic>; | ||
final entrances = data | ||
.map((json) => DigitalGuideEntrace.fromJson(json as Map<String, dynamic>)) | ||
.toIList(); | ||
|
||
print(entrances); | ||
return entrances; | ||
} |
Oops, something went wrong.