1- import  'package:url_launcher/url_launcher.dart' ;
2- 
31import  '../../conversations/widgets/item.dart' ;
42import  '/screens/contacts/controllers/detail.dart' ;
53import  '/imports.dart' ;
64
75class  ContactDetailView  extends  StatelessWidget  {
86  final  labels =  Get .find <LabelsController >();
97  final  realtime =  Get .find <RealtimeService >();
10-   final  attributeService =  Get .find <CustomAttributesController >();
11- 
12-   final  ContactDetailController  c;
13-   final  int  id;
8+   final  customAttributes =  Get .find <CustomAttributesController >();
149
10+   final  ContactDetailController  controller;
1511  ContactDetailView ({
1612    super .key,
17-     required  this . id,
13+     required  int   id,
1814    ContactInfo ?  initial,
19-   }) :  c =  Get .put (ContactDetailController (id, initial:  initial), tag:  '$id ' );
15+   }) :  controller =  Get .putOrFind (
16+           () =>  ContactDetailController (id, initial:  initial),
17+           tag:  '$id ' ,
18+         );
2019
2120  @override 
2221  Widget  build (BuildContext  context) {
2322    return  Obx (() {
24-       final  info =  c .info.value;
23+       final  info =  controller .info.value;
2524      if  (info ==  null ) {
2625        return  Scaffold (
2726          appBar:  AppBar (),
@@ -89,7 +88,7 @@ class ContactDetailView extends StatelessWidget {
8988  }
9089
9190  Widget  buildActions () {
92-     final  info =  c .info.value;
91+     final  info =  controller .info.value;
9392
9493    return  Padding (
9594      padding:  const  EdgeInsets .all (4.0 ),
@@ -132,18 +131,15 @@ class ContactDetailView extends StatelessWidget {
132131  }) {
133132    return  FilledButton .tonal (
134133      onPressed:  onPressed,
135-       child:  Column (
136-         children:  [
137-           Padding (
138-             padding: 
139-                 const  EdgeInsets .only (left:  8 , right:  8 , top:  8 , bottom:  4 ),
140-             child:  Icon (iconData),
141-           ),
142-           Padding (
143-             padding:  const  EdgeInsets .only (left:  8 , right:  8 , bottom:  8 ),
144-             child:  Text (label),
145-           ),
146-         ],
134+       child:  Padding (
135+         padding:  const  EdgeInsets .only (top:  8 , bottom:  8 ),
136+         child:  Column (
137+           spacing:  4 ,
138+           children:  [
139+             Icon (iconData),
140+             Text (label),
141+           ],
142+         ),
147143      ),
148144    );
149145  }
@@ -189,7 +185,7 @@ class ContactDetailView extends StatelessWidget {
189185
190186  Widget  buildLabels (BuildContext  context) {
191187    return  Obx (() {
192-       final  items =  c .labels.value;
188+       final  items =  controller .labels.value;
193189
194190      return  Column (
195191        crossAxisAlignment:  CrossAxisAlignment .start,
@@ -229,7 +225,7 @@ class ContactDetailView extends StatelessWidget {
229225                Chip (
230226                  label:  Text (t.modify),
231227                  deleteIcon:  Icon (Icons .edit),
232-                   onDeleted:  c .modifyLabels,
228+                   onDeleted:  controller .modifyLabels,
233229                )
234230              ],
235231            ),
@@ -241,7 +237,7 @@ class ContactDetailView extends StatelessWidget {
241237
242238  Widget  buildConversations (BuildContext  context) {
243239    return  Obx (() {
244-       final  items =  c .conversations.value;
240+       final  items =  controller .conversations.value;
245241      if  (items.isEmpty) return  Container ();
246242
247243      return  Column (
@@ -310,7 +306,7 @@ class ContactDetailView extends StatelessWidget {
310306        buildLabel (t.custom_attributes),
311307        Card (
312308          child:  Obx (() {
313-             final  attributes =  attributeService .items.value;
309+             final  attributes =  customAttributes .items.value;
314310
315311            return  ListView .builder (
316312              padding:  EdgeInsets .zero,
0 commit comments