generated from FGA0138-MDS-Ajax/template-repository
-
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.
- Loading branch information
Showing
8 changed files
with
229 additions
and
6 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
description: This file stores settings for Dart & Flutter DevTools. | ||
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states | ||
extensions: |
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
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class ButtonSingIn extends StatefulWidget { | ||
final Widget title; | ||
final Icon icon; | ||
final bool isLoading; | ||
|
||
final Function() onPressed; | ||
|
||
const ButtonSingIn( | ||
{super.key, | ||
required this.title, | ||
required this.icon, | ||
required this.onPressed, | ||
required this.isLoading}); | ||
|
||
@override | ||
State<ButtonSingIn> createState() => _ButtonSingInState(); | ||
} | ||
|
||
class _ButtonSingInState extends State<ButtonSingIn> { | ||
@override | ||
|
||
|
||
Widget build(BuildContext context) { | ||
return InkWell( | ||
onTap:(){ | ||
widget.onPressed(); | ||
|
||
}, | ||
|
||
|
||
child: Container( | ||
height: 45, | ||
width: 114, | ||
decoration: BoxDecoration( | ||
color: Color(0xFF75CDF3), | ||
borderRadius: BorderRadius.circular(8.0)), | ||
child: Center( | ||
child: widget.isLoading | ||
? Transform.scale( scale: 0.5,child: CircularProgressIndicator(color:Color(0xFFED5EA3 ) , backgroundColor: Colors.white,)) | ||
: Row( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
|
||
children: [widget.title, | ||
SizedBox(width: 5,), | ||
widget.icon, | ||
], | ||
))), | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class PurpleTextField extends StatelessWidget { | ||
final String label; | ||
final Icon icon; | ||
const PurpleTextField({super.key, required this.label , required this.icon}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return SizedBox( | ||
width: 324, | ||
height: 68 , | ||
child: TextField( | ||
|
||
decoration: InputDecoration( | ||
|
||
border: OutlineInputBorder( | ||
borderSide: BorderSide(width:2 ), | ||
borderRadius: BorderRadius.circular(4.0) | ||
), | ||
enabledBorder: OutlineInputBorder( | ||
|
||
borderSide: BorderSide( width: 2,color: Color(0xFFACACAC)) | ||
), | ||
focusedBorder: OutlineInputBorder( | ||
borderSide: BorderSide ( width: 2 , color: Color(0x80FC298F)) | ||
), | ||
prefixIcon: icon , | ||
filled: true, | ||
fillColor: Color(0xFFDEE1FF), | ||
labelText: label, | ||
labelStyle: TextStyle( | ||
color: Color(0xCCACACAC), | ||
fontSize: 16.0, | ||
fontWeight: FontWeight.w100 | ||
) | ||
), | ||
), | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,126 @@ | ||
import 'dart:js_interop'; | ||
import 'dart:developer'; | ||
import 'package:flutter/material.dart'; | ||
import 'components/input_purple.dart'; | ||
import 'components/button_singIn.dart'; | ||
|
||
|
||
class Login extends StatefulWidget{ | ||
const Login ({super.key}); | ||
|
||
@override | ||
_LoginState createState()=> _LoginState(); | ||
} | ||
class _LoginState extends State<Login> { | ||
bool isLoading = false; | ||
@override | ||
Widget build(BuildContext context) { | ||
double screenWidth = MediaQuery.of(context).size.width; | ||
return Scaffold( | ||
body: Stack( | ||
children: [ | ||
// Background gradient | ||
Container( | ||
alignment: Alignment.center, | ||
width: double.infinity, | ||
height: double.infinity, | ||
decoration: BoxDecoration( | ||
gradient: LinearGradient( | ||
colors: [Color(0xFF75CDF3), Color(0xFFB2E8FF)], | ||
begin: Alignment.topCenter, | ||
end: Alignment.bottomCenter, | ||
), | ||
), | ||
), | ||
|
||
// Container (ficará abaixo da imagem do bolo) | ||
|
||
Center( | ||
child: Container( | ||
width: 400.0, | ||
height: 400.0, | ||
decoration: BoxDecoration( | ||
borderRadius: BorderRadius.circular(10), | ||
color: Colors.white, | ||
), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: [ | ||
// Outros widgets aqui | ||
SizedBox( | ||
height: 60, | ||
), | ||
Form(child: Column( | ||
children: [ | ||
PurpleTextField( | ||
label: "Digite o nome do seu usuário", | ||
icon: Icon( | ||
Icons.person_outline, | ||
color: Color(0xCCACACAC), | ||
), | ||
), | ||
SizedBox(height: 20,), | ||
PurpleTextField( | ||
label: "Digite a sua senha", | ||
icon: Icon( | ||
Icons.lock_outline, | ||
color: Color(0xCCACACAC), | ||
), | ||
), | ||
], | ||
)), | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.end, | ||
|
||
children: [ | ||
Container( | ||
|
||
margin: EdgeInsets.fromLTRB(0, 50, 20, 0), | ||
child: ButtonSingIn( | ||
title: Text("Entrar" , style: TextStyle( | ||
color: Colors.white | ||
),), | ||
isLoading: isLoading, | ||
icon: Icon( | ||
Icons.keyboard_arrow_right_rounded, | ||
color: Colors.white, | ||
), | ||
onPressed: () { | ||
|
||
setState(() { | ||
isLoading = !isLoading; | ||
}); | ||
}, | ||
), | ||
) | ||
], | ||
) | ||
//SizedBox(height: 35), | ||
|
||
], | ||
), | ||
), | ||
), | ||
|
||
Center( | ||
child: Transform.translate( | ||
offset: Offset(0, -230), | ||
// Mover a imagem 50 pixels para cima (ajuste conforme necessário) | ||
child: Image.asset( | ||
"assets/images/cake.png", | ||
width: 128, | ||
height: 128, | ||
), | ||
), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
|
||
|
||
|
||
} | ||
|
||
|
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
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