diff --git a/assets/images/fre.png b/assets/images/fre.png new file mode 100644 index 00000000..fc355bcf Binary files /dev/null and b/assets/images/fre.png differ diff --git a/assets/images/fre.svg b/assets/images/fre.svg new file mode 100644 index 00000000..f9c87f4f --- /dev/null +++ b/assets/images/fre.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/lib/features/home/presentation/pages/about_system.dart b/lib/features/home/presentation/pages/about_system.dart new file mode 100644 index 00000000..88a8cd97 --- /dev/null +++ b/lib/features/home/presentation/pages/about_system.dart @@ -0,0 +1,112 @@ +import 'dart:io'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:package_info_plus/package_info_plus.dart'; +import 'package:yaml/yaml.dart'; + +class AboutSystemPage extends StatefulWidget { + @override + _AboutSystemPageState createState() => _AboutSystemPageState(); +} + +class _AboutSystemPageState extends State { + String _appVersion = ''; + + @override + void initState() { + super.initState(); + _loadAppVersion(); + } + + Future _loadAppVersion() async { + try { + final PackageInfo packageInfo = await PackageInfo.fromPlatform(); + setState(() { + _appVersion = packageInfo.version; + }); + } catch (e) { + setState(() { + _appVersion = 'Erro ao carregar versão'; + }); + } + } + + @override + Widget build(BuildContext context) { + final theme = FlutterFlowTheme.of(context); + return Scaffold( + backgroundColor: theme.primaryBackground, + appBar: _buildAppBar(context, theme), + body: _buildBody(), + ); + } + + PreferredSizeWidget _buildAppBar(BuildContext context, FlutterFlowTheme theme) { + return AppBar( + backgroundColor: theme.primaryBackground, + automaticallyImplyLeading: false, + leading: _buildBackButton(context, theme), + title: _buildTitle(context, theme), + centerTitle: true, + elevation: 0.0, + ); + } + + Widget _buildBackButton(BuildContext context, FlutterFlowTheme theme) { + return FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 30.0, + borderWidth: 1.0, + buttonSize: 60.0, + icon: Icon( + Icons.keyboard_arrow_left, + color: theme.primaryText, + size: 30.0, + ), + onPressed: () => Navigator.of(context).pop(), + ); + } + + Widget _buildTitle(BuildContext context, FlutterFlowTheme theme) { + return Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Sobre o Sistema', + enText: 'About the System', + ), + style: theme.headlineMedium.override( + fontFamily: theme.headlineMediumFamily, + color: theme.primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey(theme.headlineMediumFamily), + ), + ); + } + + Widget _buildBody() { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox(height: 20), + SizedBox( + height: 50, + width: 50, + child: Image.asset('assets/images/fre.png'), + ), + SizedBox(height: 20), + Text( + 'App Version: $_appVersion', + style: TextStyle(fontSize: 18), + ), + ], + ), + ); + } +} diff --git a/lib/features/home/presentation/pages/index.dart b/lib/features/home/presentation/pages/index.dart index e4ff2696..2813c3c0 100644 --- a/lib/features/home/presentation/pages/index.dart +++ b/lib/features/home/presentation/pages/index.dart @@ -1 +1,2 @@ +export 'about_system.dart'; export 'home_page.dart'; diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index 44104d7a..27f97d9b 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -8,6 +8,7 @@ import 'package:hub/backend/schema/util/schema_util.dart'; import 'package:hub/features/history/index.dart'; import 'package:hub/features/home/index.dart'; import 'package:hub/features/property/index.dart'; +import 'package:hub/features/system/presentation/pages/about_system.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/delivery_schedule_page/delivery_schedule_widget.dart'; @@ -113,7 +114,7 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) { create: (context) => LocalProfileBloc()..add(LocalProfileEvent()), ), ], - child: ProvisionalHistoryPage(), + child: AboutSystemPage(), ) : const ReceptionPageWidget(); } else { diff --git a/pubspec.lock b/pubspec.lock index db0188e7..87e1e713 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1185,6 +1185,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.0" + package_info_plus: + dependency: "direct main" + description: + name: package_info_plus + sha256: da8d9ac8c4b1df253d1a328b7bf01ae77ef132833479ab40763334db13b91cce + url: "https://pub.dev" + source: hosted + version: "8.1.1" + package_info_plus_platform_interface: + dependency: transitive + description: + name: package_info_plus_platform_interface + sha256: ac1f4a4847f1ade8e6a87d1f39f5d7c67490738642e2542f559ec38c37489a66 + url: "https://pub.dev" + source: hosted + version: "3.0.1" page_transition: dependency: "direct main" description: @@ -1911,7 +1927,7 @@ packages: source: hosted version: "6.5.0" yaml: - dependency: transitive + dependency: "direct main" description: name: yaml sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" diff --git a/pubspec.yaml b/pubspec.yaml index 0448cb01..d0dc80ac 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -102,6 +102,8 @@ dependencies: # dio: ^5.7.0 # crypto: ^3.0.5 freezed_annotation: ^2.4.4 + yaml: ^3.1.2 + package_info_plus: ^8.1.1 # json_annotation: ^4.9.0 dependency_overrides: @@ -139,6 +141,7 @@ flutter: assets: - assets/fonts/ - assets/images/ + - assets/images/fre.svg - assets/images/dark/ - assets/images/light/ fonts: