-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
112 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import '../../module.dart'; | ||
|
||
const privacyRoutes = CustomRoute( | ||
path: 'privacy', | ||
name: 'PrivacyRouter', | ||
page: PrivacyPage, | ||
transitionsBuilder: TransitionsBuilders.zoomIn, | ||
); | ||
|
||
class PrivacyPage extends StatelessWidget { | ||
const PrivacyPage({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return PharMeLogoPage(); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import '../module.dart'; | ||
|
||
class LifecycleObserver extends HookWidget { | ||
const LifecycleObserver({ | ||
Key? key, | ||
required this.appRouter, | ||
required this.child, | ||
}) : super(key: key); | ||
|
||
final AppRouter appRouter; | ||
final Widget child; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
useOnAppLifecycleStateChange((previous, current) async { | ||
if (current == AppLifecycleState.resumed) { | ||
appRouter.navigateBack(); | ||
} | ||
if ( | ||
current == AppLifecycleState.inactive || | ||
current == AppLifecycleState.paused | ||
) { | ||
await appRouter.push(PrivacyRouter()); | ||
} | ||
}); | ||
return child; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import '../module.dart'; | ||
|
||
class PharMeLogoPage extends StatelessWidget { | ||
const PharMeLogoPage({ | ||
Key? key, | ||
this.child, | ||
}) : super(key: key); | ||
|
||
final Widget? child; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return unscrollablePageScaffold( | ||
padding: PharMeTheme.largeSpace, | ||
body: Column( | ||
children: [ | ||
Expanded( | ||
child: Container( | ||
alignment: Alignment.center, | ||
child: SvgPicture.asset( | ||
'assets/images/logo.svg', | ||
), | ||
), | ||
), | ||
Container( | ||
alignment: Alignment.center, | ||
child: child ?? SizedBox.shrink(), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
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