melhorar o sensor de calor
This commit is contained in:
@@ -1,18 +1,21 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:playmaker/controllers/login_controller.dart';
|
||||
import 'package:playmaker/pages/RegisterPage.dart';
|
||||
import '../utils/size_extension.dart'; // 👇 O NOSSO SUPERPODER!
|
||||
import '../utils/size_extension.dart';
|
||||
import 'dart:math' as math; // 👇 IMPORTANTE PARA O TRAVÃO NO TABLET!
|
||||
|
||||
class BasketTrackHeader extends StatelessWidget {
|
||||
const BasketTrackHeader({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final double safeSf = math.min(context.sf, 1.15); // TRAVÃO DE MÃO
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 200 * context.sf, // Ajusta o tamanho da imagem suavemente
|
||||
height: 200 * context.sf,
|
||||
width: 200 * safeSf,
|
||||
height: 200 * safeSf,
|
||||
child: Image.asset(
|
||||
'assets/playmaker-logos.png',
|
||||
fit: BoxFit.contain,
|
||||
@@ -21,16 +24,16 @@ class BasketTrackHeader extends StatelessWidget {
|
||||
Text(
|
||||
'BasketTrack',
|
||||
style: TextStyle(
|
||||
fontSize: 36 * context.sf,
|
||||
fontSize: 36 * safeSf,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.grey[900],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 6 * context.sf),
|
||||
SizedBox(height: 6 * safeSf),
|
||||
Text(
|
||||
'Gere as tuas equipas e estatísticas',
|
||||
style: TextStyle(
|
||||
fontSize: 16 * context.sf,
|
||||
fontSize: 16 * safeSf,
|
||||
color: Colors.grey[600],
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
@@ -48,40 +51,42 @@ class LoginFormFields extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final double safeSf = math.min(context.sf, 1.15);
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
TextField(
|
||||
controller: controller.emailController,
|
||||
style: TextStyle(fontSize: 15 * context.sf),
|
||||
style: TextStyle(fontSize: 15 * safeSf),
|
||||
decoration: InputDecoration(
|
||||
labelText: 'E-mail',
|
||||
labelStyle: TextStyle(fontSize: 15 * context.sf),
|
||||
prefixIcon: Icon(Icons.email_outlined, size: 22 * context.sf),
|
||||
labelStyle: TextStyle(fontSize: 15 * safeSf),
|
||||
prefixIcon: Icon(Icons.email_outlined, size: 22 * safeSf),
|
||||
errorText: controller.emailError,
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12 * context.sf)),
|
||||
contentPadding: EdgeInsets.symmetric(vertical: 18 * context.sf, horizontal: 16 * context.sf),
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12 * safeSf)),
|
||||
contentPadding: EdgeInsets.symmetric(vertical: 18 * safeSf, horizontal: 16 * safeSf),
|
||||
),
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
),
|
||||
SizedBox(height: 20 * context.sf),
|
||||
SizedBox(height: 20 * safeSf),
|
||||
TextField(
|
||||
controller: controller.passwordController,
|
||||
obscureText: controller.obscurePassword,
|
||||
style: TextStyle(fontSize: 15 * context.sf),
|
||||
style: TextStyle(fontSize: 15 * safeSf),
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Palavra-passe',
|
||||
labelStyle: TextStyle(fontSize: 15 * context.sf),
|
||||
prefixIcon: Icon(Icons.lock_outlined, size: 22 * context.sf),
|
||||
labelStyle: TextStyle(fontSize: 15 * safeSf),
|
||||
prefixIcon: Icon(Icons.lock_outlined, size: 22 * safeSf),
|
||||
errorText: controller.passwordError,
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(
|
||||
controller.obscurePassword ? Icons.visibility_outlined : Icons.visibility_off_outlined,
|
||||
size: 22 * context.sf
|
||||
size: 22 * safeSf
|
||||
),
|
||||
onPressed: controller.togglePasswordVisibility,
|
||||
),
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12 * context.sf)),
|
||||
contentPadding: EdgeInsets.symmetric(vertical: 18 * context.sf, horizontal: 16 * context.sf),
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12 * safeSf)),
|
||||
contentPadding: EdgeInsets.symmetric(vertical: 18 * safeSf, horizontal: 16 * safeSf),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -97,9 +102,11 @@ class LoginButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final double safeSf = math.min(context.sf, 1.15);
|
||||
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
height: 58 * context.sf,
|
||||
height: 58 * safeSf,
|
||||
child: ElevatedButton(
|
||||
onPressed: controller.isLoading ? null : () async {
|
||||
final success = await controller.login();
|
||||
@@ -108,15 +115,15 @@ class LoginButton extends StatelessWidget {
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFFE74C3C),
|
||||
foregroundColor: Colors.white,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14 * context.sf)),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14 * safeSf)),
|
||||
elevation: 3,
|
||||
),
|
||||
child: controller.isLoading
|
||||
? SizedBox(
|
||||
width: 28 * context.sf, height: 28 * context.sf,
|
||||
width: 28 * safeSf, height: 28 * safeSf,
|
||||
child: const CircularProgressIndicator(strokeWidth: 3, valueColor: AlwaysStoppedAnimation<Color>(Colors.white)),
|
||||
)
|
||||
: Text('Entrar', style: TextStyle(fontSize: 18 * context.sf, fontWeight: FontWeight.bold)),
|
||||
: Text('Entrar', style: TextStyle(fontSize: 18 * safeSf, fontWeight: FontWeight.bold)),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -127,19 +134,21 @@ class CreateAccountButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final double safeSf = math.min(context.sf, 1.15);
|
||||
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
height: 58 * context.sf,
|
||||
height: 58 * safeSf,
|
||||
child: OutlinedButton(
|
||||
onPressed: () {
|
||||
Navigator.push(context, MaterialPageRoute(builder: (context) => const RegisterPage()));
|
||||
},
|
||||
style: OutlinedButton.styleFrom(
|
||||
foregroundColor: const Color(0xFFE74C3C),
|
||||
side: BorderSide(color: const Color(0xFFE74C3C), width: 2 * context.sf),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14 * context.sf)),
|
||||
side: BorderSide(color: const Color(0xFFE74C3C), width: 2 * safeSf),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14 * safeSf)),
|
||||
),
|
||||
child: Text('Criar Conta', style: TextStyle(fontSize: 18 * context.sf, fontWeight: FontWeight.bold)),
|
||||
child: Text('Criar Conta', style: TextStyle(fontSize: 18 * safeSf, fontWeight: FontWeight.bold)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user