From d4cddc0d0db47aac2251d14df85ba196dd51c6cd Mon Sep 17 00:00:00 2001 From: "J. A. Messias" Date: Tue, 10 Dec 2024 17:32:27 -0300 Subject: [PATCH] add rinch text -> open fre website --- .../home/presentation/pages/about_system.dart | 63 +++++++++++++++---- lib/flutter_flow/nav/nav.dart | 1 - pubspec.yaml | 1 - 3 files changed, 50 insertions(+), 15 deletions(-) diff --git a/lib/features/home/presentation/pages/about_system.dart b/lib/features/home/presentation/pages/about_system.dart index 88a8cd97..0c82242e 100644 --- a/lib/features/home/presentation/pages/about_system.dart +++ b/lib/features/home/presentation/pages/about_system.dart @@ -1,14 +1,12 @@ -import 'dart:io'; +import 'package:flutter/gestures.dart'; 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'; +import 'package:url_launcher/url_launcher.dart'; class AboutSystemPage extends StatefulWidget { @override @@ -89,24 +87,63 @@ class _AboutSystemPageState extends State { ); } + Future _launchURL() async { + final Uri url = Uri.parse('https://fre.com.br/'); + if (!await launchUrl(url)) { + throw Exception('Could not launch $url'); + } + } + 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'), - ), + _buildLogo(), + SizedBox(height: 20), + _buildAppVersionText(), + Spacer(), + _buildLaunch(), SizedBox(height: 20), - Text( - 'App Version: $_appVersion', - style: TextStyle(fontSize: 18), - ), ], ), ); } + + Widget _buildLogo() { + return SizedBox( + height: 50, + width: 50, + child: Image.asset('assets/images/fre.png'), + ); + } + + Widget _buildLaunch() { + final theme = FlutterFlowTheme.of(context).primary; + return RichText( + text: TextSpan( + text: 'Website', + style: TextStyle(color: theme, fontSize: 16), + recognizer: TapGestureRecognizer()..onTap = () => _launchURL(), + ), + ); + } + + Widget _buildAppVersionText() { + final theme = FlutterFlowTheme.of(context); + return Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Versão do Aplicativo: $_appVersion', + enText: 'App Version: $_appVersion', + ), + style: theme.headlineMedium.override( + fontFamily: theme.headlineMediumFamily, + color: theme.primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey(theme.headlineMediumFamily), + ), + ); + } } diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index 27f97d9b..ada01e71 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -8,7 +8,6 @@ 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'; diff --git a/pubspec.yaml b/pubspec.yaml index d0dc80ac..bd579dbb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -102,7 +102,6 @@ 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