diff --git a/lib/views/messageview.dart b/lib/views/messageview.dart index f84c081..53eab3d 100644 --- a/lib/views/messageview.dart +++ b/lib/views/messageview.dart @@ -1,5 +1,8 @@ import 'package:flutter/material.dart'; +import 'package:flutter_app/views/peersettingsview.dart'; +import 'package:provider/provider.dart'; +import '../main.dart'; import '../model.dart'; import '../opaque.dart'; import '../widgets/messagelist.dart'; @@ -28,10 +31,10 @@ class _MessageViewState extends State { appBar: AppBar( title: Text(widget.conversationHandle), actions: [ - IconButton(icon: Icon(Icons.chat), onPressed: _pushConvoSettings), - IconButton(icon: Icon(Icons.list), onPressed: _pushConvoSettings), - IconButton(icon: Icon(Icons.push_pin), onPressed: _pushConvoSettings), - IconButton(icon: Icon(Icons.settings), onPressed: _pushConvoSettings), + IconButton(icon: Icon(Icons.chat), onPressed: _pushContactSettings), + IconButton(icon: Icon(Icons.list), onPressed: _pushContactSettings), + IconButton(icon: Icon(Icons.push_pin), onPressed: _pushContactSettings), + IconButton(icon: Icon(Icons.settings), onPressed: _pushContactSettings), ], ), body: MessageList(profile: widget.profile, conversationHandle: widget.conversationHandle), @@ -39,7 +42,23 @@ class _MessageViewState extends State { ); } - void _pushConvoSettings() {} + void _pushContactSettings() { + Navigator.of(context).push(MaterialPageRoute( + builder: (BuildContext bcontext) { + if (Provider.of(context, listen: false).selectedConversation.length == 32) { + return MultiProvider( + providers: [ChangeNotifierProvider.value(value: Provider.of(context))], + child: PeerSettingsView(), + ); + } else { + return MultiProvider( + providers: [ChangeNotifierProvider.value(value: Provider.of(context))], + child: PeerSettingsView(), + ); + } + }, + )); + } void _sendMessage() { ChatMessage cm = new ChatMessage(o: 1, d: ctrlrCompose.value.text); diff --git a/lib/views/peersettingsview.dart b/lib/views/peersettingsview.dart new file mode 100644 index 0000000..f875f2d --- /dev/null +++ b/lib/views/peersettingsview.dart @@ -0,0 +1,50 @@ +import 'dart:convert'; +import 'dart:io'; +import 'package:flutter_app/model.dart'; +import 'package:package_info_plus/package_info_plus.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_app/opaque.dart'; +import 'package:flutter_app/settings.dart'; +import 'package:provider/provider.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; + +import '../main.dart'; + +/// Peer Settings View Provides way to Configure . +class PeerSettingsView extends StatefulWidget { + @override + _PeerSettingsViewState createState() => _PeerSettingsViewState(); +} + +class _PeerSettingsViewState extends State { + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text(Provider.of(context).onion), + ), + body: _buildSettingsList(), + ); + } + + Widget _buildSettingsList() { + return Consumer(builder: (context, settings, child) { + return LayoutBuilder(builder: (BuildContext context, BoxConstraints viewportConstraints) { + return Scrollbar( + isAlwaysShown: true, + child: SingleChildScrollView( + clipBehavior: Clip.antiAlias, + child: ConstrainedBox( + constraints: BoxConstraints( + minHeight: viewportConstraints.maxHeight, + ), + child: Column(children: [])))); + }); + }); + } +} diff --git a/lib/widgets/contactrow.dart b/lib/widgets/contactrow.dart index 349a1d5..3857a64 100644 --- a/lib/widgets/contactrow.dart +++ b/lib/widgets/contactrow.dart @@ -60,7 +60,8 @@ class _ContactRowState extends State { builder: (BuildContext builderContext) { return MultiProvider( providers: [ - Provider.value(value: Provider.of(context)), + ChangeNotifierProvider.value(value: Provider.of(context)), + ChangeNotifierProvider.value(value: Provider.of(context)), ], child: MessageView(conversationHandle: handle), ); diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index e71a16d..d38195a 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -2,8 +2,6 @@ // Generated file. Do not edit. // -// clang-format off - #include "generated_plugin_registrant.h" diff --git a/linux/flutter/generated_plugin_registrant.h b/linux/flutter/generated_plugin_registrant.h index e0f0a47..9bf7478 100644 --- a/linux/flutter/generated_plugin_registrant.h +++ b/linux/flutter/generated_plugin_registrant.h @@ -2,8 +2,6 @@ // Generated file. Do not edit. // -// clang-format off - #ifndef GENERATED_PLUGIN_REGISTRANT_ #define GENERATED_PLUGIN_REGISTRANT_