Skip to content

Commit

Permalink
[MERGE] 26-tela-login
Browse files Browse the repository at this point in the history
  • Loading branch information
JAugustoM committed Dec 16, 2024
2 parents f6c59ed + f895bad commit 2aa471a
Show file tree
Hide file tree
Showing 8 changed files with 229 additions and 6 deletions.
Binary file added catavento/assets/images/cake.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions catavento/devtools_options.yaml
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:
3 changes: 2 additions & 1 deletion catavento/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:catavento/bloc/demanda_bloc.dart';
import 'package:catavento/constants.dart';
import 'package:catavento/screens/Login/login.dart';
import 'package:catavento/screens/dashboardAdmin/dashboard_admin.dart';
import 'package:catavento/screens/dashboardFuncionarios/dashboard_funcionarios.dart';
import 'package:catavento/views/login_view.dart';
Expand Down Expand Up @@ -47,7 +48,7 @@ class LoadView extends StatelessWidget {
builder: (context, snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.done:
return const DashBoardAdmin();
return const Login();
default:
return const CircularProgressIndicator();
}
Expand Down
52 changes: 52 additions & 0 deletions catavento/lib/screens/Login/components/button_singIn.dart
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,
],
))),
);
}
}
41 changes: 41 additions & 0 deletions catavento/lib/screens/Login/components/input_purple.dart
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
)
),
),
);
}
}
126 changes: 126 additions & 0 deletions catavento/lib/screens/Login/login.dart
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,
),
),
),
],
),
);
}



}


8 changes: 4 additions & 4 deletions catavento/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ packages:
dependency: "direct main"
description:
name: file_picker
sha256: "16dc141db5a2ccc6520ebb6a2eb5945b1b09e95085c021d9f914f8ded7f1465c"
sha256: "89500471922dd3a89ab0d6e13ab4a2268c25474bff4ca7c628f55c76e0ced1de"
url: "https://pub.dev"
source: hosted
version: "8.1.4"
version: "8.1.5"
file_selector_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -460,10 +460,10 @@ packages:
dependency: transitive
description:
name: path_provider_android
sha256: "8c4967f8b7cb46dc914e178daa29813d83ae502e0529d7b0478330616a691ef7"
sha256: "4adf4fd5423ec60a29506c76581bc05854c55e3a0b72d35bb28d661c9686edf2"
url: "https://pub.dev"
source: hosted
version: "2.2.14"
version: "2.2.15"
path_provider_foundation:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion catavento/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ flutter:

assets:
- assets/images/photo.jpg

- assets/images/cake.png

# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/to/resolution-aware-images
Expand Down

0 comments on commit 2aa471a

Please sign in to comment.