import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:gecko/globals.dart'; import 'package:gecko/models/widgets_keys.dart'; import 'package:gecko/providers/wallets_profiles.dart'; import 'package:gecko/screens/debug_screen.dart'; import 'package:gecko/screens/my_contacts.dart'; import 'package:gecko/screens/settings.dart'; class MainDrawer extends StatelessWidget { const MainDrawer({ Key? key, required this.isWalletsExists, }) : super(key: key); final bool isWalletsExists; @override Widget build(BuildContext context) { const listStyle = TextStyle(fontSize: 16); return SizedBox( width: MediaQuery.of(context).size.width * 0.67, child: Drawer( child: Column( children: [ Expanded( child: ListView(padding: EdgeInsets.zero, children: [ const DrawerHeader( decoration: BoxDecoration( color: orangeC, ), child: Column(children: [ Image( image: AssetImage('assets/icon/gecko_final.png'), height: 130), ]), ), const SizedBox(height: 10), Opacity( opacity: 0.8, child: ListTile( key: keyParameters, leading: const Icon(Icons.settings), title: Text( 'parameters'.tr(), style: listStyle, ), onTap: () { Navigator.pop(context); Navigator.push( context, MaterialPageRoute(builder: (context) { return SettingsScreen(); }), ); }, ), ), const SizedBox(height: 5), if (isWalletsExists) Opacity( opacity: 0.8, child: ListTile( key: keyContacts, leading: const Icon(Icons.contacts_rounded), title: Text( 'contactsManagement'.tr(), style: listStyle, ), onTap: () { Navigator.pop(context); Navigator.push( context, MaterialPageRoute(builder: (context) { return const ContactsScreen(); }), ); }, ), ), const SizedBox(height: 5), if (kDebugMode) Opacity( opacity: 0.8, child: ListTile( key: keyDebugScreen, leading: const Icon(Icons.developer_mode_rounded), title: Text( 'Debug screen'.tr(), style: listStyle, ), onTap: () { Navigator.pop(context); Navigator.push( context, MaterialPageRoute(builder: (context) { return const DebugScreen(); }), ); }, ), ), ])), Align( alignment: FractionalOffset.bottomCenter, child: InkWell( key: keyCopyAddress, splashColor: orangeC, child: Padding( padding: const EdgeInsets.all(15), child: Opacity( opacity: 0.8, child: Text('Ğecko v$appVersion', style: const TextStyle(fontSize: 13)), ), ), onTap: () { Clipboard.setData( ClipboardData(text: 'Ğecko v$appVersion')); snackMessage(context, message: 'Le numéro de version de Ğecko a été copié dans votre presse papier', duration: 4); }), ), const SizedBox(height: 15) ], ), ), ); } }