|
| 1 | +import 'dart:async'; |
| 2 | + |
1 | 3 | import 'package:flutter/material.dart';
|
| 4 | +import 'package:material_symbols_icons/symbols.dart'; |
2 | 5 |
|
3 |
| -class AboutPage extends StatelessWidget { |
| 6 | +class AboutPage extends StatefulWidget { |
4 | 7 | const AboutPage({super.key});
|
5 | 8 |
|
| 9 | + @override |
| 10 | + State<AboutPage> createState() => _AboutPageState(); |
| 11 | +} |
| 12 | + |
| 13 | +class _AboutPageState extends State<AboutPage> { |
| 14 | + late Timer _timer; |
| 15 | + int _currIndex = 0; |
| 16 | + |
| 17 | + @override |
| 18 | + void initState() { |
| 19 | + super.initState(); |
| 20 | + _timer = Timer.periodic( |
| 21 | + const Duration(seconds: 2), |
| 22 | + (timer) => setState(() => _currIndex += _currIndex < 3 ? 1 : -_currIndex), |
| 23 | + ); |
| 24 | + } |
| 25 | + |
| 26 | + @override |
| 27 | + void dispose() { |
| 28 | + _timer.cancel(); |
| 29 | + super.dispose(); |
| 30 | + } |
| 31 | + |
6 | 32 | @override
|
7 | 33 | Widget build(BuildContext context) {
|
8 |
| - return const Expanded( |
| 34 | + return Expanded( |
9 | 35 | child: SingleChildScrollView(
|
10 | 36 | child: Column(
|
11 | 37 | mainAxisAlignment: MainAxisAlignment.center,
|
12 | 38 | children: [
|
13 | 39 | Padding(
|
14 |
| - padding: EdgeInsets.all(20.0), |
| 40 | + padding: const EdgeInsets.all(20.0), |
15 | 41 | child: Column(
|
16 | 42 | mainAxisAlignment: MainAxisAlignment.center,
|
17 | 43 | children: [
|
18 |
| - Icon( |
19 |
| - Icons.wb_sunny, // Icono del clima |
20 |
| - size: 50, |
| 44 | + AnimatedSwitcher( |
| 45 | + duration: const Duration(milliseconds: 300), |
| 46 | + transitionBuilder: (child, anim) { |
| 47 | + double begin = _currIndex % 2 == 0 ? 2 : 0; |
| 48 | + |
| 49 | + return RotationTransition( |
| 50 | + turns: |
| 51 | + Tween<double>(begin: begin, end: 1).animate(anim), |
| 52 | + child: ScaleTransition(scale: anim, child: child), |
| 53 | + ); |
| 54 | + }, |
| 55 | + child: Icon( |
| 56 | + switch (_currIndex) { |
| 57 | + 0 => Icons.sunny, |
| 58 | + 1 => Icons.water_drop, |
| 59 | + 2 => Symbols.cloud, |
| 60 | + _ => Icons.thermostat |
| 61 | + }, |
| 62 | + size: 50, |
| 63 | + fill: 1, |
| 64 | + key: ValueKey(_currIndex), |
| 65 | + ), |
21 | 66 | ),
|
22 |
| - SizedBox(height: 20), |
23 |
| - Text( |
| 67 | + const SizedBox(height: 20), |
| 68 | + const Text( |
24 | 69 | "Aplicación del clima desarrollada por el Grupo 5 de prácticas intermedias del 7mo semestre usando los sensores de CyT",
|
25 | 70 | textAlign: TextAlign.center,
|
26 | 71 | ),
|
27 |
| - SizedBox(height: 20), |
28 |
| - Text( |
| 72 | + const SizedBox(height: 20), |
| 73 | + const Text( |
29 | 74 | "Integrantes:",
|
30 | 75 | style: TextStyle(
|
31 | 76 | fontWeight: FontWeight.bold,
|
32 | 77 | fontSize: 18,
|
33 | 78 | ),
|
34 | 79 | ),
|
35 |
| - SizedBox(height: 10), |
36 |
| - Text("Elvis Lizandro Aguilar Tax 201930304"), |
37 |
| - Text("Rudy Adolfo Pacheco Pacheco 201930220"), |
38 |
| - Text("David Enrique Lux Barrera 201931344"), |
39 |
| - Text("Dylan Antonio Elías Vásquez 201931369"), |
40 |
| - Text("Brayan Alexander Alonzo Quijivix 201931078"), |
| 80 | + const SizedBox(height: 10), |
| 81 | + const Text("Elvis Lizandro Aguilar Tax 201930304"), |
| 82 | + const Text("Rudy Adolfo Pacheco Pacheco 201930220"), |
| 83 | + const Text("David Enrique Lux Barrera 201931344"), |
| 84 | + const Text("Dylan Antonio Elías Vásquez 201931369"), |
| 85 | + const Text("Brayan Alexander Alonzo Quijivix 201931078"), |
41 | 86 | ],
|
42 | 87 | ),
|
43 | 88 | ),
|
|
0 commit comments