diff --git a/dialer/lib/features/home/home_page.dart b/dialer/lib/features/home/home_page.dart index 2c9b56f..97e2c88 100644 --- a/dialer/lib/features/home/home_page.dart +++ b/dialer/lib/features/home/home_page.dart @@ -9,16 +9,6 @@ import 'package:dialer/features/settings/settings.dart'; import '../../services/contact_service.dart'; import 'package:dialer/features/voicemail/voicemail_page.dart'; -const bool _privacyMode = bool.fromEnvironment('privacy-mode', defaultValue: false); - -String _maskName(String name) { - if (!_privacyMode) return name; - final parts = name.split(' '); - return parts.map((part) { - if (part.length < 2) return part; - return '${part[0]}${'*' * (part.length - 1)}'; - }).join(' '); -} class _MyHomePageState extends State with SingleTickerProviderStateMixin { @@ -104,7 +94,7 @@ class _MyHomePageState extends State return SearchBar( controller: controller, padding: - MaterialStateProperty.all( + WidgetStateProperty.all( const EdgeInsets.only( top: 6.0, bottom: 6.0, @@ -116,10 +106,10 @@ class _MyHomePageState extends State controller.openView(); _onSearchChanged(''); }, - backgroundColor: MaterialStateProperty.all( + backgroundColor: WidgetStateProperty.all( const Color.fromARGB(255, 30, 30, 30)), hintText: 'Search contacts', - hintStyle: MaterialStateProperty.all( + hintStyle: WidgetStateProperty.all( const TextStyle(color: Colors.grey, fontSize: 16.0), ), leading: const Icon( @@ -128,7 +118,7 @@ class _MyHomePageState extends State size: 24.0, ), shape: - MaterialStateProperty.all( + WidgetStateProperty.all( RoundedRectangleBorder( borderRadius: BorderRadius.circular(12.0), ), @@ -141,7 +131,14 @@ class _MyHomePageState extends State suggestionsBuilder: (BuildContext context, SearchController controller) { return _contactSuggestions.map((contact) { - return _buildSuggestionTile(contact, controller); + return ListTile( + key: ValueKey(contact.id), + title: Text(_obfuscateService.obfuscateData(contact.displayName), + style: const TextStyle(color: Colors.white)), + onTap: () { + controller.closeView(contact.displayName); + }, + ); }).toList(); }, ), @@ -237,17 +234,6 @@ class _MyHomePageState extends State ), ); } - - Widget _buildSuggestionTile(Contact contact, SearchController controller) { - final maskedName = _maskName(contact.displayName); - return ListTile( - key: ValueKey(contact.id), - title: Text(maskedName, style: const TextStyle(color: Colors.white)), - onTap: () { - controller.closeView(maskedName); - }, - ); - } } class MyHomePage extends StatefulWidget {