diff --git a/catavento/assets/images/cake.png b/catavento/assets/images/cake.png new file mode 100644 index 0000000..3f44334 Binary files /dev/null and b/catavento/assets/images/cake.png differ diff --git a/catavento/devtools_options.yaml b/catavento/devtools_options.yaml new file mode 100644 index 0000000..fa0b357 --- /dev/null +++ b/catavento/devtools_options.yaml @@ -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: diff --git a/catavento/lib/main.dart b/catavento/lib/main.dart index 1f30a43..e23ebe6 100644 --- a/catavento/lib/main.dart +++ b/catavento/lib/main.dart @@ -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'; @@ -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(); } diff --git a/catavento/lib/screens/Login/components/button_singIn.dart b/catavento/lib/screens/Login/components/button_singIn.dart new file mode 100644 index 0000000..77cdd7f --- /dev/null +++ b/catavento/lib/screens/Login/components/button_singIn.dart @@ -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 createState() => _ButtonSingInState(); +} + +class _ButtonSingInState extends State { + @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, + ], + ))), + ); + } +} \ No newline at end of file diff --git a/catavento/lib/screens/Login/components/input_purple.dart b/catavento/lib/screens/Login/components/input_purple.dart new file mode 100644 index 0000000..a9dd5ea --- /dev/null +++ b/catavento/lib/screens/Login/components/input_purple.dart @@ -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 + ) + ), + ), + ); + } +} diff --git a/catavento/lib/screens/Login/login.dart b/catavento/lib/screens/Login/login.dart new file mode 100644 index 0000000..633d4f3 --- /dev/null +++ b/catavento/lib/screens/Login/login.dart @@ -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 { + 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, + ), + ), + ), + ], + ), + ); + } + + + +} + + diff --git a/catavento/pubspec.lock b/catavento/pubspec.lock index bdb3413..6ebffd0 100644 --- a/catavento/pubspec.lock +++ b/catavento/pubspec.lock @@ -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: @@ -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: diff --git a/catavento/pubspec.yaml b/catavento/pubspec.yaml index 25c2fd0..911ebbf 100644 --- a/catavento/pubspec.yaml +++ b/catavento/pubspec.yaml @@ -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