forked from eatvio/eatvio_app
feat: add welcome screen
This commit is contained in:
9
assets/images/logo_welcome.svg
Normal file
9
assets/images/logo_welcome.svg
Normal file
@@ -0,0 +1,9 @@
|
||||
<svg width="168" height="104" viewBox="0 0 168 104" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M18.2589 85.7787L6.61498 101.745C5.53182 103.243 4.29393 103.991 2.90131 103.991C0.967105 103.991 0 102.667 0 100.02V78.7182C0 75.5622 1.07026 73.9846 3.21078 73.9846C5.3513 73.9846 6.42155 75.5622 6.42155 78.7182V92.438L18.2975 76.1511C19.3549 74.707 20.4897 73.9846 21.7017 73.9846C23.6875 73.9846 24.6804 75.482 24.6804 78.4774V99.2577C24.6804 102.414 23.6102 103.991 21.4696 103.991C19.3291 103.991 18.2589 102.414 18.2589 99.2577V85.7787Z" fill="#323F4B"/>
|
||||
<path d="M43.4542 80.5167C41.1284 80.5167 39.6813 80.4498 39.1128 80.316C37.3813 79.9409 36.5156 78.9758 36.5156 77.4213C36.5156 75.3317 38.0403 74.2861 41.0896 74.2861H52.2921C55.3415 74.2861 56.8661 75.3317 56.8661 77.4213C56.8661 78.9758 56.0005 79.9409 54.269 80.316C53.7006 80.4498 52.2534 80.5167 49.9276 80.5167V99.2482C49.9276 102.41 48.8551 103.991 46.7103 103.991C44.5395 103.991 43.4542 102.41 43.4542 99.2482V80.5167Z" fill="#323F4B"/>
|
||||
<path d="M73.0443 103.69C71.43 103.69 70.3026 103.407 69.6621 102.844C69.0215 102.253 68.7012 101.125 68.7012 99.4604V78.9989C68.7012 77.2537 69.0215 76.0321 69.6621 75.3338C70.3026 74.6356 71.4557 74.2861 73.1212 74.2861H78.348C80.8846 74.2861 83.037 74.8367 84.8051 75.9379C86.9574 77.2538 88.034 79.1465 88.034 81.6171C88.034 84.8121 86.9318 86.9738 84.7282 88.1021V88.2226C86.3683 88.7597 87.5466 89.5521 88.2645 90.599C88.9817 91.6196 89.3403 93.0288 89.3403 94.8282C89.3403 97.8087 88.3542 100.078 86.3811 101.635C84.6386 103.005 82.2941 103.69 79.3477 103.69H73.0443ZM75.0814 91.002V97.9299H78.2712C79.6295 97.9299 80.6413 97.7416 81.308 97.3658C82.1789 96.8559 82.6143 95.943 82.6143 94.6271C82.6143 93.0966 82.1917 92.076 81.3464 91.5654C80.7309 91.1895 79.6679 91.002 78.1559 91.002H75.0814ZM75.0814 80.006V85.7657H77.8485C79.1044 85.7657 79.9881 85.6045 80.5004 85.2821C81.2183 84.8528 81.5769 84.0469 81.5769 82.8659C81.5769 80.9588 80.3339 80.006 77.8485 80.006H75.0814Z" fill="#323F4B"/>
|
||||
<path d="M121.166 85.7787L109.522 101.745C108.439 103.243 107.201 103.991 105.808 103.991C103.875 103.991 102.907 102.667 102.907 100.02V78.7182C102.907 75.5622 103.978 73.9846 106.118 73.9846C108.259 73.9846 109.329 75.5622 109.329 78.7182V92.438L121.205 76.1511C122.262 74.707 123.397 73.9846 124.609 73.9846C126.595 73.9846 127.588 75.482 127.588 78.4774V99.2577C127.588 102.414 126.518 103.991 124.377 103.991C122.237 103.991 121.166 102.414 121.166 99.2577V85.7787Z" fill="#323F4B"/>
|
||||
<path d="M140.722 89.0277C140.722 84.6422 141.919 81.0714 144.312 78.3168C146.784 75.4287 150.127 73.9846 154.341 73.9846C158.582 73.9846 161.938 75.4152 164.409 78.2771C166.803 81.0317 168 84.6152 168 89.0277C168 93.4139 166.803 96.9847 164.409 99.7394C161.912 102.574 158.556 103.991 154.341 103.991C150.127 103.991 146.784 102.561 144.312 99.6988C141.919 96.9712 140.722 93.4139 140.722 89.0277ZM147.59 89.108C147.59 91.5153 148.123 93.5077 149.19 95.0853C150.387 96.9307 152.104 97.8534 154.341 97.8534C156.579 97.8534 158.309 96.9442 159.531 95.1258C160.599 93.5212 161.132 91.5153 161.132 89.108C161.132 86.6212 160.625 84.5755 159.609 82.9709C158.387 81.0714 156.631 80.1225 154.341 80.1225C152.052 80.1225 150.309 81.0714 149.112 82.9709C148.097 84.5755 147.59 86.6212 147.59 89.108Z" fill="#323F4B"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M84.0105 0C102.659 0 117.773 8.59537 117.773 28.1847C117.773 47.752 102.659 63.6323 84.0105 63.6323C65.3404 63.6323 50.2266 47.752 50.2266 28.1847C50.2266 8.59537 65.3404 0 84.0105 0Z" fill="#43A6F2"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M83.8669 41.4666C79.4151 41.4666 75.0485 40.5474 70.9749 38.7731C66.9016 36.9774 63.2272 34.348 60.1827 31.0559C58.776 29.5595 58.8599 27.1653 60.3297 25.7544C61.8204 24.3222 64.1511 24.4077 65.5578 25.9041C67.9094 28.4479 70.7439 30.4788 73.8935 31.8469C77.0428 33.2364 80.4233 33.9419 83.8669 33.9419C87.2889 33.9419 90.6695 33.2364 93.8187 31.8469C96.9687 30.4788 99.8029 28.4479 102.154 25.9041C103.562 24.4077 105.892 24.3222 107.382 25.7544C108.853 27.1653 108.936 29.5595 107.53 31.0559C104.485 34.348 100.811 36.9774 96.7374 38.7731C92.6644 40.5474 88.2972 41.4666 83.8669 41.4666Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.1 KiB |
1
assets/splash/bg.json
Normal file
1
assets/splash/bg.json
Normal file
@@ -0,0 +1 @@
|
||||
{"nm":"background","ddd":0,"h":1920,"w":1080,"meta":{"g":"@lottiefiles/toolkit-js 0.33.2"},"layers":[{"ty":4,"nm":"Shape Layer 1","sr":1,"st":0,"op":155,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[540,960,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Rectangle 1","ix":1,"cix":2,"np":3,"it":[{"ty":"rc","bm":0,"hd":false,"mn":"ADBE Vector Shape - Rect","nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":0},"s":{"a":0,"k":[1160,880]}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":6},"c":{"a":0,"k":[1,1,1]}},{"ty":"gf","bm":0,"hd":false,"mn":"ADBE Vector Graphic - G-Fill","nm":"Gradient Fill 1","e":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[374.412,342.611],"t":0},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[22.822,357.191],"t":31},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[-420.714,389.994],"t":61},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[50.932,404.573],"t":91},{"s":[376.797,364.48],"t":120}]},"g":{"p":3,"k":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0,0.00784313725490196,0.4392156862745098,1,0.5,0.10196078431372549,0.4666666666666667,0.9411764705882353,1,0.9490196078431372,0.9490196078431372,0.9490196078431372],"t":0},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0,0.3411764705882353,0.6039215686274509,0.9411764705882353,0.5,0.0392156862745098,0.4549019607843137,1,1,0.1568627450980392,0.42745098039215684,0.8823529411764706],"t":31},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0,0.3176470588235294,0.5568627450980392,0.8666666666666667,0.5,0.6392156862745098,0.796078431372549,1,1,1,1,1],"t":61},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0,0.1843137254901961,0.5019607843137255,0.9294117647058824,0.5,0.0784313725490196,0.596078431372549,0.7529411764705882,1,0,0.43529411764705883,1],"t":91},{"s":[0,0.00784313725490196,0.4392156862745098,1,0.5,0.5686274509803921,0.7411764705882353,0.9686274509803922,1,0.29411764705882354,0.5529411764705883,0.8862745098039215],"t":120}]}},"t":1,"a":{"a":0,"k":0},"h":{"a":0,"k":0},"s":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[-430.769,-404.573],"t":0},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[23.726,-364.48],"t":31},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[312.726,-353.48],"t":61},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[29.739,-353.48],"t":91},{"s":[-407.606,-357.125],"t":120}]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[93.29,219.491],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":1},{"ty":1,"nm":"Deep Red Solid 1","sr":1,"st":0,"op":155,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[540,960,0]},"s":{"a":0,"k":[100,100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[540,960,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"ef":[],"sc":"#5095ef","sh":1920,"sw":1080,"ind":2}],"v":"4.6.10","fr":15,"op":155,"ip":0,"assets":[]}
|
||||
BIN
assets/splash/bg.lottie
Normal file
BIN
assets/splash/bg.lottie
Normal file
Binary file not shown.
@@ -53,15 +53,17 @@ import 'package:eatvio_app/features/settings/presentation/pages/pressure_screen.
|
||||
import 'package:eatvio_app/features/settings/presentation/pages/settings_screen.dart';
|
||||
import 'package:eatvio_app/features/support/presentation/pages/support_screen.dart';
|
||||
import 'package:eatvio_app/features/user_details/presentation/user_details_screen.dart';
|
||||
import 'package:eatvio_app/features/welcome/presentation/pages/welcome_screen.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class AppRouter {
|
||||
static GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
||||
|
||||
static GoRouter appRouter = GoRouter(
|
||||
initialLocation: '/my-profile-screen',
|
||||
initialLocation: '/welcome-screen',
|
||||
navigatorKey: navigatorKey,
|
||||
routes: [
|
||||
GoRoute(
|
||||
@@ -123,6 +125,20 @@ class AppRouter {
|
||||
),
|
||||
],
|
||||
),
|
||||
GoRoute(
|
||||
path: '/welcome-screen',
|
||||
name: 'welcomeScreen',
|
||||
builder: (context, state) => const WelcomeScreen(),
|
||||
redirect: (context, state) async {
|
||||
final sharedPreferences = await SharedPreferences.getInstance();
|
||||
final welcomeScreenWasShowed = sharedPreferences.getBool('welcomeScreenWasShowed');
|
||||
if (welcomeScreenWasShowed == true) {
|
||||
return '/my-profile-screen';
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
path: '/consultant-finance-screen',
|
||||
name: 'consultantFinanceScreen',
|
||||
|
||||
107
lib/features/welcome/presentation/pages/welcome_screen.dart
Normal file
107
lib/features/welcome/presentation/pages/welcome_screen.dart
Normal file
@@ -0,0 +1,107 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:lottie/lottie.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../../../../core/theme/theme_helper.dart';
|
||||
|
||||
class WelcomeScreen extends StatelessWidget {
|
||||
const WelcomeScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Positioned(
|
||||
left: -20,
|
||||
top: -20,
|
||||
right: -20,
|
||||
bottom: -20,
|
||||
child: Lottie.asset(
|
||||
'assets/splash/bg.json',
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
Positioned.fill(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(height: 40),
|
||||
SvgPicture.asset('assets/images/logo_welcome.svg'),
|
||||
const Spacer(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Material(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
color: Colors.white,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 20),
|
||||
const Text(
|
||||
'Добро пожаловать\nв EATVIO! 🚀',
|
||||
style: TextStyle(
|
||||
fontSize: 28,
|
||||
fontWeight: FontWeight.w800,
|
||||
height: 1,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
const Text(
|
||||
'Это первая версия приложения, и мы активно работаем над его улучшением. Если вы заметите ошибку или у вас есть идея — пожалуйста, сообщите нам! Ваша помощь бесценна ❤️',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
height: 1,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 52),
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
final sharedPreferences = await SharedPreferences.getInstance();
|
||||
await sharedPreferences.setBool('welcomeScreenWasShowed', true);
|
||||
GoRouter.of(context).go('/my-profile-screen');
|
||||
},
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
child: Ink(
|
||||
height: 52,
|
||||
decoration: BoxDecoration(
|
||||
color: appTheme.blueA400,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: const Center(
|
||||
child: Text(
|
||||
'Начать пользоваться',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
height: 1,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -67,6 +67,7 @@ dependencies:
|
||||
http_parser: ^4.1.2
|
||||
path: ^1.9.0
|
||||
collection: ^1.19.0
|
||||
shared_preferences: ^2.5.3
|
||||
|
||||
dependency_overrides:
|
||||
intl: ^0.19.0
|
||||
|
||||
Reference in New Issue
Block a user