diff --git a/lib/ui/welcome/view/WelcomeView.dart b/lib/ui/welcome/view/WelcomeView.dart index d6aa41a..c62eae6 100644 --- a/lib/ui/welcome/view/WelcomeView.dart +++ b/lib/ui/welcome/view/WelcomeView.dart @@ -1,92 +1,106 @@ -import 'package:aranduapp/core/log/Log.dart'; import 'package:aranduapp/ui/onboarding/view/onboarding_view.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; import 'package:google_fonts/google_fonts.dart'; - -class WelcomeView extends StatelessWidget { - //final WelcomeModel model = WelcomeModel("Arandú","Começar"); +class WelcomeView extends StatefulWidget { WelcomeView({super.key}); + @override + State createState() => _WelcomeViewState(); +} + +class _WelcomeViewState extends State { @override Widget build(BuildContext context) { return Scaffold( - body: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const SizedBox(height: 95), - - //Cículo com gradiente com possível logo sobreposta - Stack( - alignment: Alignment.center, - children: [ - - - - Container( - width: 278, - height: 278, - decoration: BoxDecoration( - color: Theme.of(context).colorScheme.primary, - shape: BoxShape.circle, - ), - ), - - ], - ), - const SizedBox(height: 20), + body: Center( + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + _logo(context), + const SizedBox(height: 80), + _startButton(context), + const SizedBox(width: 80), + ], + )))); + } - //Titulo "arandú" com fonte amarante - Text( - "Arandú", - style: GoogleFonts.amarante( - fontSize: 60, - fontWeight: FontWeight.w500, + Widget _logo(BuildContext context) { + Size screenSize = MediaQuery.of(context).size; + + double circleDiameter = screenSize.height; + double nameSize = screenSize.height * 0.075; + + return Center( + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + //Cículo com gradiente com possível logo sobreposta + Stack( + alignment: Alignment.center, + children: [ + Container( + width: circleDiameter * 0.3, + height: circleDiameter *0.3, + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.primary, + shape: BoxShape.circle, ), ), - const Spacer(), - - //Botão de começar com gradiente - GestureDetector( - onTap: () => { - - - Navigator.of(context).pushReplacement( - MaterialPageRoute( - builder: (context) => const OnboardingView(), - ), - ) - - - }, + ], + ), + const SizedBox(height: 25), - child: Container( - padding: const EdgeInsets.symmetric(horizontal:120, vertical: 15), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15), - color: Theme.of(context).colorScheme.primary, - ), - child: Text( - "Começar", - style: GoogleFonts.comfortaa( - color: Colors.white, - fontSize: 15, - fontWeight: FontWeight.w500, //coloca a fonte certa + //Titulo "arandú" com fonte amarante + Text( + "Arandú", + style: GoogleFonts.amarante( + textStyle: Theme.of(context).textTheme.bodyLarge?.copyWith( + fontSize: nameSize, + fontWeight: FontWeight.w500, + ), + ), + ), + ], + ))); + } - ), - ) - ), - + Widget _startButton(BuildContext context) { + Size screenSize = MediaQuery.of(context).size; + + double paddingHorizontal = + screenSize.width * 0.07; // largura da tela + double paddingVertical = screenSize.height * 0.025; // da altura da tela + return SingleChildScrollView( + child: GestureDetector( + onTap: () => { + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => const OnboardingView(), ), - const SizedBox(height:50), - ], - ) - ) + ) + }, + child: Container( + padding: EdgeInsets.symmetric( + horizontal: paddingHorizontal, vertical: paddingVertical), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Theme.of(context).colorScheme.primary, + ), + child: Text( + "Começar", + style: Theme.of(context).textTheme.bodyLarge?.apply( + color: Theme.of(context).colorScheme.onPrimary, + ), + )), + ), ); } - }