Files
Motula-Translate-App/motula_translate_app/lib/screens/onboding/onboding_screen.dart
2024-03-08 12:15:47 +01:00

133 lines
4.3 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:rive/rive.dart';
import 'components/animated_btn.dart';
import 'components/sign_in_dialog.dart';
class OnbodingScreen extends StatefulWidget {
const OnbodingScreen({super.key});
@override
State<OnbodingScreen> createState() => _OnbodingScreenState();
}
class _OnbodingScreenState extends State<OnbodingScreen> {
late RiveAnimationController _btnAnimationController;
bool isShowSignInDialog = false;
@override
void initState() {
_btnAnimationController = OneShotAnimation(
"active",
autoplay: false,
);
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: [
Positioned(
width: MediaQuery.of(context).size.width * 1.7,
left: 100,
bottom: 100,
child: Image.asset(
"assets/Backgrounds/Spline.png",
),
),
Positioned.fill(
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 20, sigmaY: 20),
child: const SizedBox(),
),
),
const RiveAnimation.asset(
"assets/RiveAssets/shapes.riv",
),
Positioned.fill(
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 30, sigmaY: 30),
child: const SizedBox(),
),
),
AnimatedPositioned(
top: isShowSignInDialog ? -50 : 0,
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
duration: const Duration(milliseconds: 260),
child: SafeArea(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 32),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Spacer(),
const SizedBox(
width: 260,
child: Column(
children: [
Text(
"Learn design & code",
style: TextStyle(
fontSize: 60,
fontWeight: FontWeight.w700,
fontFamily: "Poppins",
height: 1.2,
),
),
SizedBox(height: 16),
Text(
"Dont skip design. Learn design and code, by building real apps with Flutter and Swift. Complete courses about the best tools.",
),
],
),
),
const Spacer(flex: 2),
AnimatedBtn(
btnAnimationController: _btnAnimationController,
press: () {
_btnAnimationController.isActive = true;
Future.delayed(
const Duration(milliseconds: 800),
() {
setState(() {
isShowSignInDialog = true;
});
showCustomDialog(
context,
onValue: (_) {},
);
// showCustomDialog(
// context,
// onValue: (_) {
// setState(() {
// isShowSignInDialog = false;
// });
// },
// );
},
);
},
),
const Padding(
padding: EdgeInsets.symmetric(vertical: 24),
child: Text(
"Purchase includes access to 30+ courses, 240+ premium tutorials, 120+ hours of videos, source files and certificates."),
)
],
),
),
),
),
],
),
);
}
}