-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from fga-eps-mds/feat#58/corrige_orientação
fix(#58): Corrige e ajusta aparência da WelcomeView
- Loading branch information
Showing
1 changed file
with
86 additions
and
72 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 |
---|---|---|
@@ -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<WelcomeView> createState() => _WelcomeViewState(); | ||
} | ||
|
||
class _WelcomeViewState extends State<WelcomeView> { | ||
@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, | ||
), | ||
)), | ||
), | ||
); | ||
} | ||
|
||
} |