Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/loading animation layout fix #238

Merged
merged 3 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions ios/Runner/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
Expand All @@ -14,12 +16,14 @@
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
<rect key="frame" x="196.33333333333334" y="426" width="0.33333333333334281" height="0.33333333333331439"/>
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" red="0.43529411764705883" green="0.6470588235294118" blue="0.97254901960784312" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<constraints>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
Expand All @@ -28,10 +32,10 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
<point key="canvasLocation" x="80.916030534351137" y="264.08450704225356"/>
</scene>
</scenes>
<resources>
<image name="LaunchImage" width="168" height="185"/>
<image name="LaunchImage" width="0.3333333432674408" height="0.3333333432674408"/>
</resources>
</document>
50 changes: 24 additions & 26 deletions lib/ui/splash/splash_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,29 @@ class _SplashPageState extends State<SplashPage> with TickerProviderStateMixin {
@override
Widget build(BuildContext context) {
return Scaffold(
extendBodyBehindAppBar: true,
body: Lottie.asset(
fit: BoxFit.fill,
'assets/animations/hypha_splash.json',
controller: _controller,
height: MediaQuery.of(context).size.height * 1,
width: MediaQuery.of(context).size.width * 1,
animate: true,
onLoaded: (composition) {
_controller
..duration = composition.duration
..forward().whenComplete(() {
final userAuthData = GetIt.I.get<AuthRepository>().currentAuthStatus;
if (userAuthData is Authenticated) {
if (Get.currentRoute != '/HyphaBottomNavigation') {
Get.offAll(() => const HyphaBottomNavigation());
}
} else {
if (Get.currentRoute != '/OnboardingPage') {
Get.offAll(() => const OnboardingPage());
}
}
});
},
),
);
extendBodyBehindAppBar: true,
body: Container(
height: MediaQuery.of(context).size.height * 1,
width: MediaQuery.of(context).size.width * 1,
child: FittedBox(
fit: BoxFit.cover,
child: Lottie.asset('assets/animations/hypha_splash.json', controller: _controller, animate: true,
onLoaded: (composition) {
_controller
..duration = composition.duration
..forward().whenComplete(() {
final userAuthData = GetIt.I.get<AuthRepository>().currentAuthStatus;
if (userAuthData is Authenticated) {
if (Get.currentRoute != '/HyphaBottomNavigation') {
Get.offAll(() => const HyphaBottomNavigation());
}
} else {
if (Get.currentRoute != '/OnboardingPage') {
Get.offAll(() => const OnboardingPage());
}
}
});
})),
));
}
}
Loading