Newer
Older
import 'package:sentry_flutter/sentry_flutter.dart';
class CardDrawer extends StatelessWidget {
const CardDrawer({super.key});
@override
Widget build(BuildContext context) {
final List<CesiumCard> cards = SharedPreferencesHelper().cesiumCards;
return FutureBuilder<PackageInfo>(
future: PackageInfo.fromPlatform(),
builder: (BuildContext context, AsyncSnapshot<PackageInfo> snapshot) {
if (snapshot.hasData) {
return Drawer(
child: ListView(
// Important: Remove any padding from the ListView.
padding: EdgeInsets.zero,
children: <Widget>[
DrawerHeader(
/* decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
), */
child: Column(
children: <Widget>[
GestureDetector(
onTap: () => tryCatch(),
onLongPress: () => tryCatch(),
child: Image.asset(
'assets/img/logo.png',
fit: BoxFit.scaleDown,
height: 80.0,
)),
// const SizedBox(height: 20.0),
/* Text(tr('app_name'),
style: const TextStyle(
fontSize: 24.0,
color: Colors.white,
)), */
],
),
SizedBox(
height: (cards.length * 70) + 50,
child: const Center(
child: CardStack(),
if (inDevelopment)
ListTile(
leading: const Icon(Icons.build),
title: const Text('Sandbox'),
onTap: () {
showDialog(
context: context,
builder: (BuildContext context) {
return const Sandbox();
},
);
},
),
ListTile(
leading: const Icon(Icons.telegram_outlined),
title: Text(tr('telegram_group')),
onTap: () async {
final Locale locale = context.locale;
if (locale == const Locale('es') ||
locale == const Locale('ca') ||
locale == const Locale('gl') ||
locale == const Locale('eu') ||
locale == const Locale('ast')) {
}
if (locale == const Locale('fr')) {
await openUrl('https://t.me/g1nkgoFR');
ListTile(
leading: const Icon(Icons.feedback),
title: Text(tr('feedback')),
onTap: () {
Navigator.pop(context);
final String gitLabToken = dotenv.get('GITLAB_TOKEN',
fallback: 'FKb9GMueV4-hyDEWjfAf');
BetterFeedback.of(context).showAndUploadToGitLab(
projectId: '663',
apiToken: gitLabToken,
gitlabUrl: 'git.duniter.org');
/* BetterFeedback.of(context).showAndUploadToSentry(
AboutListTile(
icon: g1nkgoIcon,
applicationName: tr('app_name'),
applicationVersion: 'Version: ${snapshot.data!.version}',
'© ${DateTime.now().year.toString() == '2023' ? '2023' : '2023-${DateTime.now().year}'} Comunes Association, under AGPLv3',
aboutBoxChildren: const <Widget>[
SizedBox(height: 10.0),
]),
],
);
} else {
return const Center(child: CircularProgressIndicator());
}
},