TUDO
This commit is contained in:
219
lib/screens/logado_screen.dart
Normal file
219
lib/screens/logado_screen.dart
Normal file
@@ -0,0 +1,219 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../constants/app_colors.dart';
|
||||
import '../screens/inicial_screen.dart';
|
||||
|
||||
class LogadoScreen extends StatelessWidget {
|
||||
const LogadoScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.background,
|
||||
body: Stack(
|
||||
children: [
|
||||
// Static dark gray triangles
|
||||
Positioned(
|
||||
top: -50,
|
||||
left: -80,
|
||||
child: CustomPaint(
|
||||
size: const Size(160, 120),
|
||||
painter: TrianglePainter(
|
||||
color: Colors.grey.shade800.withOpacity(0.4),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 20,
|
||||
right: -60,
|
||||
child: CustomPaint(
|
||||
size: const Size(120, 90),
|
||||
painter: TrianglePainter(
|
||||
color: Colors.grey.shade800.withOpacity(0.3),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 80,
|
||||
left: 40,
|
||||
child: CustomPaint(
|
||||
size: const Size(140, 105),
|
||||
painter: TrianglePainter(
|
||||
color: Colors.grey.shade800.withOpacity(0.35),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 120,
|
||||
right: 80,
|
||||
child: CustomPaint(
|
||||
size: const Size(100, 75),
|
||||
painter: TrianglePainter(
|
||||
color: Colors.grey.shade800.withOpacity(0.25),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 160,
|
||||
left: -40,
|
||||
child: CustomPaint(
|
||||
size: const Size(130, 98),
|
||||
painter: TrianglePainter(
|
||||
color: Colors.grey.shade800.withOpacity(0.3),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Main content
|
||||
SafeArea(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(height: 80), // Space for triangles
|
||||
// Success icon with animation
|
||||
TweenAnimationBuilder(
|
||||
duration: const Duration(milliseconds: 600),
|
||||
tween: Tween<double>(begin: 0.0, end: 1.0),
|
||||
builder: (context, value, child) {
|
||||
return Transform.scale(
|
||||
scale: value,
|
||||
child: Container(
|
||||
width: 100,
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.buttonColor,
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColors.buttonColor.withOpacity(0.3),
|
||||
blurRadius: 20,
|
||||
spreadRadius: 5,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.check,
|
||||
size: 50,
|
||||
color: AppColors.white,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
|
||||
// Welcome message with fade in
|
||||
TweenAnimationBuilder(
|
||||
duration: const Duration(milliseconds: 800),
|
||||
tween: Tween<double>(begin: 0.0, end: 1.0),
|
||||
builder: (context, value, child) {
|
||||
return Opacity(
|
||||
opacity: value,
|
||||
child: const Text(
|
||||
'Login Realizado!',
|
||||
style: TextStyle(
|
||||
fontSize: 32,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
TweenAnimationBuilder(
|
||||
duration: const Duration(milliseconds: 1000),
|
||||
tween: Tween<double>(begin: 0.0, end: 1.0),
|
||||
builder: (context, value, child) {
|
||||
return Opacity(
|
||||
opacity: value,
|
||||
child: const Text(
|
||||
'Você está autenticado com sucesso.',
|
||||
style: TextStyle(fontSize: 18, color: Colors.white70),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 48),
|
||||
|
||||
// Back button with slide up animation
|
||||
TweenAnimationBuilder(
|
||||
duration: const Duration(milliseconds: 1200),
|
||||
tween: Tween<Offset>(
|
||||
begin: Offset(0, 1),
|
||||
end: Offset(0, 0),
|
||||
),
|
||||
builder: (context, value, child) {
|
||||
return Transform.translate(
|
||||
offset: value * 50,
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
height: 60,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pushReplacement(
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const InicialScreen(),
|
||||
),
|
||||
);
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppColors.buttonColor,
|
||||
foregroundColor: AppColors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
),
|
||||
elevation: 5,
|
||||
),
|
||||
child: const Text(
|
||||
'Voltar para Tela Inicial',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Custom painter for triangles
|
||||
class TrianglePainter extends CustomPainter {
|
||||
final Color color;
|
||||
|
||||
TrianglePainter({required this.color});
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size) {
|
||||
final paint = Paint()
|
||||
..color = color
|
||||
..style = PaintingStyle.fill;
|
||||
|
||||
final path = Path();
|
||||
path.moveTo(size.width / 2, 0);
|
||||
path.lineTo(0, size.height);
|
||||
path.lineTo(size.width, size.height);
|
||||
path.close();
|
||||
|
||||
canvas.drawPath(path, paint);
|
||||
}
|
||||
|
||||
@override
|
||||
bool shouldRepaint(covariant CustomPainter oldDelegate) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user