Line data Source code
1 : import 'package:amadeus_proto/exercises/exercises_page.dart';
2 : import 'package:amadeus_proto/exercises/exercises_button.dart';
3 : import 'package:amadeus_proto/exercises/exercises_list.dart';
4 : import 'package:amadeus_proto/page_route_transition.dart';
5 : import 'package:flutter/material.dart';
6 : import 'package:localization/localization.dart';
7 :
8 : class ExerciseCategory extends StatelessWidget {
9 0 : const ExerciseCategory({super.key, required this.exercisesType});
10 :
11 : final ExerciseValue exercisesType;
12 :
13 : final double heightSize = 150;
14 :
15 0 : @override
16 : Widget build(BuildContext context) {
17 0 : return Container(
18 : margin: const EdgeInsets.all(5),
19 0 : child: Column(
20 0 : children: [
21 0 : GestureDetector(
22 0 : onTap: () {
23 0 : Navigator.of(context)
24 0 : .push(pageRouteTransition(CategoriesExercises(
25 0 : category: exercisesType.category,
26 : ))
27 : // MaterialPageRoute(
28 : // builder: (context) => CategoriesExercises(
29 : // categoryName: exercisesType.categoryName,
30 : // exercises: exercisesType.exercises),
31 : // maintainState: true));
32 : );
33 : },
34 0 : child: Container(
35 : width: 350,
36 0 : height: heightSize,
37 0 : decoration: BoxDecoration(
38 0 : borderRadius: BorderRadius.circular(30),
39 0 : border: Border.all(color: const Color(0xFFDFDFDF)),
40 : color: const Color(0xFFFFFFFF)),
41 0 : padding: EdgeInsets.symmetric(vertical: (10 / 100) * heightSize),
42 0 : child: Row(
43 : crossAxisAlignment: CrossAxisAlignment.center,
44 0 : children: [
45 0 : Container(
46 : width: 120,
47 0 : height: (75 / 100) * heightSize,
48 : margin: const EdgeInsets.only(left: 16.0),
49 0 : decoration: BoxDecoration(
50 0 : borderRadius: BorderRadius.circular(30),
51 : color: const Color.fromARGB(255, 236, 231, 251),
52 : ),
53 0 : child: Center(
54 : child:
55 0 : ExerciseButton(iconPath: exercisesType.iconPath)
56 : // ),
57 : )),
58 : const SizedBox(width: 10),
59 0 : Expanded(
60 0 : child: Column(
61 : crossAxisAlignment: CrossAxisAlignment.start,
62 0 : children: [
63 0 : Text(
64 0 : exercisesType.category.categoryName.i18n(),
65 : style: const TextStyle(
66 : fontSize: 20,
67 : fontWeight: FontWeight.w900,
68 : fontStyle: FontStyle.normal),
69 : ),
70 : const SizedBox(height: 10),
71 0 : Expanded(
72 0 : child: SingleChildScrollView(
73 0 : child: Text(
74 0 : exercisesType.description.i18n(),
75 : style: const TextStyle(
76 : fontSize: 12,
77 : fontWeight: FontWeight.w200,
78 : fontStyle: FontStyle.normal),
79 : // overflow: TextOverflow.fade,
80 : // maxLines: 3,
81 : ),
82 : ),
83 : ),
84 : ],
85 : ),
86 : ),
87 : ],
88 : ),
89 : ),
90 : ),
91 : ],
92 : ),
93 : );
94 : }
95 : }
|