Skip to content
Snippets Groups Projects
Commit 8af14c28 authored by vjrj's avatar vjrj
Browse files

Minor improvements in left drawer

parent 792f422c
No related branches found
No related tags found
No related merge requests found
...@@ -2,9 +2,11 @@ import 'package:easy_localization/easy_localization.dart'; ...@@ -2,9 +2,11 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:package_info_plus/package_info_plus.dart'; import 'package:package_info_plus/package_info_plus.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
import '../../data/models/cesium_card.dart'; import '../../data/models/cesium_card.dart';
import '../../shared_prefs.dart'; import '../../shared_prefs.dart';
import '../ui_helpers.dart';
class CardDrawer extends StatelessWidget { class CardDrawer extends StatelessWidget {
const CardDrawer({super.key}); const CardDrawer({super.key});
...@@ -12,8 +14,8 @@ class CardDrawer extends StatelessWidget { ...@@ -12,8 +14,8 @@ class CardDrawer extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<CesiumCard> cards = SharedPreferencesHelper().cesiumCards; final List<CesiumCard> cards = SharedPreferencesHelper().cesiumCards;
const ImageIcon g1nkgoIcon = ImageIcon( final ImageIcon g1nkgoIcon = ImageIcon(
AssetImage('img/favicon.png'), AssetImage(assets('img/favicon.png')),
size: 24, size: 24,
); );
return FutureBuilder<PackageInfo>( return FutureBuilder<PackageInfo>(
...@@ -29,11 +31,14 @@ class CardDrawer extends StatelessWidget { ...@@ -29,11 +31,14 @@ class CardDrawer extends StatelessWidget {
), */ ), */
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Image.asset( GestureDetector(
'assets/img/logo.png', onTap: () => tryCatch(),
fit: BoxFit.scaleDown, onLongPress: () => tryCatch(),
height: 80.0, child: Image.asset(
), 'assets/img/logo.png',
fit: BoxFit.scaleDown,
height: 80.0,
)),
// const SizedBox(height: 20.0), // const SizedBox(height: 20.0),
/* Text(tr('app_name'), /* Text(tr('app_name'),
style: const TextStyle( style: const TextStyle(
...@@ -56,6 +61,7 @@ class CardDrawer extends StatelessWidget { ...@@ -56,6 +61,7 @@ class CardDrawer extends StatelessWidget {
), ),
), ),
), ),
if (kReleaseMode) Expanded(child: Container()),
if (!kReleaseMode) if (!kReleaseMode)
Expanded( Expanded(
child: Container( child: Container(
...@@ -84,8 +90,7 @@ class CardDrawer extends StatelessWidget { ...@@ -84,8 +90,7 @@ class CardDrawer extends StatelessWidget {
AboutListTile( AboutListTile(
icon: g1nkgoIcon, icon: g1nkgoIcon,
applicationName: tr('app_name'), applicationName: tr('app_name'),
applicationVersion: applicationVersion: 'Version: ${snapshot.data!.version}',
'Version: ${snapshot.data!.version} build: ${snapshot.data!.buildNumber}',
applicationIcon: g1nkgoIcon, applicationIcon: g1nkgoIcon,
applicationLegalese: applicationLegalese:
'© 2023-${DateTime.now().year} Comunes Association, under AGPLv3', '© 2023-${DateTime.now().year} Comunes Association, under AGPLv3',
...@@ -102,3 +107,11 @@ class CardDrawer extends StatelessWidget { ...@@ -102,3 +107,11 @@ class CardDrawer extends StatelessWidget {
); );
} }
} }
Future<void> tryCatch() async {
try {
throw StateError('Testing sentry with try catch');
} catch (error, stackTrace) {
await Sentry.captureException(error, stackTrace: stackTrace);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment