Line data Source code
1 : import 'package:amadeus_proto/app_state.dart';
2 : import 'package:amadeus_proto/models/chapter_info.dart';
3 : import 'package:amadeus_proto/pages/home/widgets/exercices_button.dart';
4 : import 'package:provider/provider.dart';
5 : import 'package:flutter/material.dart';
6 : import 'package:localization/localization.dart';
7 :
8 : class ExercisesOverview extends StatelessWidget {
9 12 : const ExercisesOverview({super.key});
10 :
11 0 : @override
12 : Widget build(BuildContext context) {
13 0 : final Size deviceSize = MediaQuery.of(context).size;
14 0 : final appState = context.read<AppState>();
15 :
16 0 : return SizedBox(
17 0 : height: deviceSize.height / 5.5,
18 0 : child: Column(children: [
19 0 : Padding(
20 : padding: const EdgeInsets.fromLTRB(15.0, 6, 15, 0),
21 0 : child: Row(
22 : mainAxisAlignment: MainAxisAlignment.spaceBetween,
23 0 : children: [
24 0 : Text(
25 0 : "exercises.recent".i18n(),
26 : style:
27 : const TextStyle(fontSize: 17, fontWeight: FontWeight.bold),
28 : ),
29 0 : SizedBox(
30 : height: 25,
31 0 : child: TextButton(
32 0 : style: TextButton.styleFrom(
33 : minimumSize: Size.zero,
34 : padding: EdgeInsets.zero,
35 : ),
36 0 : child: Text(
37 0 : "seeAll".i18n(),
38 0 : style: TextStyle(
39 0 : color: Theme.of(context).primaryColor,
40 : ),
41 : ),
42 0 : onPressed: () {
43 0 : appState.pageIndex = 1;
44 : },
45 : ),
46 : )
47 : ],
48 : ),
49 : ),
50 : const SizedBox(
51 : height: 10,
52 : ),
53 0 : Expanded(
54 0 : child: ListView(
55 : scrollDirection: Axis.horizontal,
56 0 : children: [
57 : const SizedBox(
58 : width: 15,
59 : ),
60 0 : ExercisesButton(
61 0 : chapterInfo: ChapterInfo(
62 : imagePath:
63 : "assets/FigmaDesign/Asset/Images/IntrumentPractice.png",
64 : name: "Technique",
65 : totalExercises: 12,
66 : clearedExercises: 0,
67 : chapterNumber: 1,
68 : ),
69 : ),
70 0 : ExercisesButton(
71 0 : chapterInfo: ChapterInfo(
72 : imagePath:
73 : "assets/FigmaDesign/Asset/Images/IntrumentPractice.png",
74 : name: "Sample text",
75 : totalExercises: 16,
76 : clearedExercises: 0,
77 : chapterNumber: 1,
78 : ),
79 : ),
80 : const SizedBox(
81 : width: 15,
82 : ),
83 : ],
84 : ),
85 : ),
86 : ]),
87 : );
88 : }
89 : }
|