|
1 | 1 | import 'package:flutter/material.dart'; |
| 2 | +import 'package:flutter_bloc/flutter_bloc.dart'; |
| 3 | +import 'package:twoaxis_finance/features/version/domain/entities/version.dart'; |
| 4 | +import 'package:twoaxis_finance/features/version/presentation/cubit/version_cubit.dart'; |
2 | 5 |
|
3 | 6 | class InfoPage extends StatelessWidget { |
4 | 7 | const InfoPage({super.key}); |
5 | 8 |
|
6 | 9 | @override |
7 | 10 | Widget build(BuildContext context) { |
8 | 11 | return Scaffold( |
9 | | - appBar: AppBar( |
10 | | - title: const Text( |
11 | | - "About", |
12 | | - ), |
13 | | - backgroundColor: Theme.of(context).colorScheme.surfaceContainer, |
| 12 | + appBar: AppBar( |
| 13 | + title: const Text( |
| 14 | + "About", |
14 | 15 | ), |
15 | | - body: ListView( |
16 | | - children: [ |
17 | | - ListTile( |
18 | | - title: Text("Version", |
19 | | - style: TextStyle(color: Theme.of(context).colorScheme.onSurfaceVariant)), |
20 | | - subtitle: Text("1.2.1", |
21 | | - style: TextStyle(color: Theme.of(context).colorScheme.onSurfaceVariant)), |
22 | | - leading: Icon(Icons.build, color: Theme.of(context).colorScheme.onSurfaceVariant), |
23 | | - onTap: () {}, |
24 | | - ), |
25 | | - Divider(color: Theme.of(context).colorScheme.surfaceContainer, height: 1), |
26 | | - ListTile( |
27 | | - title: Text("Build Number", |
28 | | - style: TextStyle(color: Theme.of(context).colorScheme.onSurfaceVariant)), |
29 | | - subtitle: Text("17", |
30 | | - style: TextStyle(color: Theme.of(context).colorScheme.onSurfaceVariant)), |
31 | | - leading: Icon(Icons.build, color: Theme.of(context).colorScheme.onSurfaceVariant), |
32 | | - onTap: () {}, |
33 | | - ), |
34 | | - Divider(color: Theme.of(context).colorScheme.surfaceContainer, height: 1), |
35 | | - const SizedBox(height: 30), |
36 | | - Text( |
37 | | - "(c) ${DateTime.now().year} TwoAxis. All Rights Reserved.", |
38 | | - textAlign: TextAlign.center, |
39 | | - style: TextStyle(color: Theme.of(context).colorScheme.onSurfaceVariant), |
40 | | - ), |
41 | | - ], |
42 | | - )); |
| 16 | + backgroundColor: Theme.of(context).colorScheme.surfaceContainer, |
| 17 | + ), |
| 18 | + body: BlocBuilder<VersionCubit, Version>( |
| 19 | + builder: (context, version) { |
| 20 | + return ListView( |
| 21 | + children: [ |
| 22 | + ListTile( |
| 23 | + title: Text("Version", |
| 24 | + style: TextStyle( |
| 25 | + color: Theme.of(context).colorScheme.onSurfaceVariant)), |
| 26 | + subtitle: Text(version.version, |
| 27 | + style: TextStyle( |
| 28 | + color: Theme.of(context).colorScheme.onSurfaceVariant)), |
| 29 | + leading: Icon(Icons.build, |
| 30 | + color: Theme.of(context).colorScheme.onSurfaceVariant), |
| 31 | + onTap: () {}, |
| 32 | + ), |
| 33 | + Divider( |
| 34 | + color: Theme.of(context).colorScheme.surfaceContainer, |
| 35 | + height: 1), |
| 36 | + ListTile( |
| 37 | + title: Text("Build Number", |
| 38 | + style: TextStyle( |
| 39 | + color: Theme.of(context).colorScheme.onSurfaceVariant)), |
| 40 | + subtitle: Text(version.buildNumber, |
| 41 | + style: TextStyle( |
| 42 | + color: Theme.of(context).colorScheme.onSurfaceVariant)), |
| 43 | + leading: Icon(Icons.build, |
| 44 | + color: Theme.of(context).colorScheme.onSurfaceVariant), |
| 45 | + onTap: () {}, |
| 46 | + ), |
| 47 | + Divider( |
| 48 | + color: Theme.of(context).colorScheme.surfaceContainer, |
| 49 | + height: 1), |
| 50 | + const SizedBox(height: 30), |
| 51 | + Text( |
| 52 | + "(c) ${DateTime.now().year} TwoAxis. All Rights Reserved.", |
| 53 | + textAlign: TextAlign.center, |
| 54 | + style: TextStyle( |
| 55 | + color: Theme.of(context).colorScheme.onSurfaceVariant), |
| 56 | + ), |
| 57 | + ], |
| 58 | + ); |
| 59 | + }, |
| 60 | + ), |
| 61 | + ); |
43 | 62 | } |
44 | 63 | } |
0 commit comments