WIP
This commit is contained in:
parent
6af6b030c2
commit
5363841556
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 64 KiB |
|
@ -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<AboutSystemPage> {
|
||||
String _appVersion = '';
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadAppVersion();
|
||||
}
|
||||
|
||||
Future<void> _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: <Widget>[
|
||||
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),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1 +1,2 @@
|
|||
export 'about_system.dart';
|
||||
export 'home_page.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 {
|
||||
|
|
18
pubspec.lock
18
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"
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue