diff --git a/android/cwtch/cwtch.aar b/android/cwtch/cwtch.aar index ffdf628..ec095ea 100644 Binary files a/android/cwtch/cwtch.aar and b/android/cwtch/cwtch.aar differ diff --git a/lib/model.dart b/lib/model.dart index c709704..6524434 100644 --- a/lib/model.dart +++ b/lib/model.dart @@ -87,16 +87,17 @@ class ContactListState extends ChangeNotifier { ContactListState(Cwtch cwtch, String profileOnion) { cwtch.GetContacts(profileOnion).then((jsonStr) { + print("contacts: " + jsonStr); List contacts = jsonDecode(jsonStr); - contacts.forEach((onion) { + contacts.forEach((c) { add(ContactInfoState( profileOnion: profileOnion, - onion: onion, - nickname: "fay quen", + onion: c["onion"], + nickname: c["name"], isGroup: false, isInvitation: false, isBlocked: false, - status: "", + status: c["status"], imagePath: "", )); }); diff --git a/lib/views/contactsview.dart b/lib/views/contactsview.dart index 46ba6ac..2ab5e34 100644 --- a/lib/views/contactsview.dart +++ b/lib/views/contactsview.dart @@ -41,7 +41,7 @@ class _ContactsViewState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: Text(Provider.of(context).nickname + '\'s contacts'), + title: Text(Provider.of(context).nickname ?? Provider.of(context).onion ?? '' + '\'s contacts'), actions: [ IconButton(icon: Icon(Icons.copy), onPressed: _copyOnion,), ], @@ -102,10 +102,10 @@ class _ContactsViewState extends State { void _pushMessageView(String handle) { Navigator.of(context).push( MaterialPageRoute( - builder: (BuildContext context) { - return Provider( - create: (_) => Provider.of(context), - child: MessageView(profile: Provider.of(context), conversationHandle: handle), + builder: (BuildContext builderContext) { + return MultiProvider( + providers: [ChangeNotifierProvider(create: (_) => Provider.of(context)),], + child: MessageView(conversationHandle: handle), ); }, ), diff --git a/lib/views/triplecolview.dart b/lib/views/triplecolview.dart index 9b1905d..cdba5d2 100644 --- a/lib/views/triplecolview.dart +++ b/lib/views/triplecolview.dart @@ -24,7 +24,7 @@ class _TripleColumnViewState extends State { ), Flexible( flex: flwtch.columns[1], - child: flwtch.selectedProfile == null ? Center(child:Text("pick a profile")) : ContactsView(profile:flwtch.selectedProfile), + child: flwtch.selectedProfile == null ? Center(child:Text("pick a profile")) : ContactsView(), ), Flexible( flex: flwtch.columns[2], diff --git a/pubspec.lock b/pubspec.lock index 1edac19..cd0d8d7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -256,4 +256,4 @@ packages: version: "0.1.2" sdks: dart: ">=2.12.0-0.0 <3.0.0" - flutter: ">=1.16.0 <2.0.0" + flutter: ">=1.16.0"