Skip to content

Commit

Permalink
Merge pull request #87 from Astra-Labs/v.0.0.0.1
Browse files Browse the repository at this point in the history
0.0.9
  • Loading branch information
codingiswhyicry authored Jun 14, 2023
2 parents 1c6305c + c2a049a commit 589585f
Show file tree
Hide file tree
Showing 36 changed files with 251 additions and 40 deletions.
6 changes: 6 additions & 0 deletions Package/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.0.9
- Fixing RouteObserver navigation bug that stops
users from navigating forward after going back.
- Adding basic test structure for testing to be implemented.
- Removed RouteObserver from foundation file, we were able to fix a bug without RouteAware! :-)

## 0.0.8
Fixing Perichron import bug.

Expand Down
4 changes: 1 addition & 3 deletions Package/lib/src/Core/Foundation/sensory.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import 'package:aureus/aureus.dart';

import 'package:flutter/services.dart';
import 'package:just_audio/just_audio.dart';

/// {@category Foundation}
Expand Down Expand Up @@ -41,7 +39,7 @@ class Sensory {

/// A reusable function to play the sound.
Future<void> runAudioPlayer(String path) async {
await player.setAsset(path, package: "aureus");
await player.setAsset(path);
await player.play();
}

Expand Down
7 changes: 0 additions & 7 deletions Package/lib/src/Core/foundation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,6 @@ class AureusInformation {
/// A privacy policy that determines how you handle the users' data and information.
final String privacyPolicy;

/// A route observer that's been passed to your main MaterialApp. This needs to be
/// given for the [NotificationOverlayView], so that Aureus can properly manage
/// what screens are currently being shown to the user.
final RouteObserver routeObserver;

const AureusInformation({
required this.name,
required this.mission,
Expand All @@ -142,7 +137,6 @@ class AureusInformation {
required this.requestedDataPermissions,
required this.termsOfService,
required this.privacyPolicy,
required this.routeObserver,
}) : assert(name != "" &&
mission != "" &&
developerName != "" &&
Expand Down Expand Up @@ -226,7 +220,6 @@ class AureusValues {
packageVariables?.resourceInformation.requestedDataPermissions;
var tos = packageVariables?.resourceInformation.termsOfService;
var privacy = packageVariables?.resourceInformation.privacyPolicy;
var routeObserver = packageVariables?.resourceInformation.routeObserver;

// Flattened navigation values
var splash = packageVariables?.resourceNavigation.splashScreen;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class NotificationOverlayView extends StatefulWidget {
}

class _NotificationOverlayViewState extends State<NotificationOverlayView>
with AureusNotificationObserver, TickerProviderStateMixin, RouteAware {
with AureusNotificationObserver, TickerProviderStateMixin {
// A 'stand in' overlay view that will hold the UI components
Widget overlayView = Container();
var hasOverlayEnabled = false;
Expand All @@ -38,7 +38,6 @@ class _NotificationOverlayViewState extends State<NotificationOverlayView>
@override
void initState() {
sensation.prepare();
notificationMaster.registerObserver(this);

_controller = AnimationController(
vsync: this, duration: const Duration(milliseconds: 300))
Expand All @@ -63,34 +62,9 @@ class _NotificationOverlayViewState extends State<NotificationOverlayView>
begin: const Offset(0.0, 0.0), end: const Offset(0.0, 0.0))
.animate(CurvedAnimation(parent: _controller, curve: Curves.ease));

WidgetsBinding.instance!.addPostFrameCallback((timeStamp) {
print('ADDED POST FRAME CALLBACK FOR VIEW');
resourceValues.routeObserver!.subscribe(this, ModalRoute.of(context)!);
});

super.initState();
}

@override
void didPush() {
print("DID PUSH!");

notificationMaster.unregisterObserver(this);
notificationMaster.resetRequests();

super.didPush();
}

@override
void didPop() {
print("DID POP!");

notificationMaster.unregisterObserver(this);
notificationMaster.resetRequests();

super.didPop();
}

@override
void dispose() {
notificationMaster.unregisterObserver(this);
Expand Down Expand Up @@ -250,7 +224,9 @@ class _NotificationOverlayViewState extends State<NotificationOverlayView>

@override
Widget build(BuildContext context) {
notificationMaster.registerObserver(this);
WidgetsBinding.instance!.addPostFrameCallback((_) {
notificationMaster.registerObserver(this);
});

// Builds an overlay item to hold any items coming into the view
return Material(
Expand Down
Loading

0 comments on commit 589585f

Please sign in to comment.