Merge pull request 'Stub for Contact Info State' (#21) from splash into trunk
Reviewed-on: #21
This commit is contained in:
commit
0bd1c9b3f0
|
@ -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<MessageView> {
|
|||
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<MessageView> {
|
|||
);
|
||||
}
|
||||
|
||||
void _pushConvoSettings() {}
|
||||
void _pushContactSettings() {
|
||||
Navigator.of(context).push(MaterialPageRoute<void>(
|
||||
builder: (BuildContext bcontext) {
|
||||
if (Provider.of<FlwtchState>(context, listen: false).selectedConversation.length == 32) {
|
||||
return MultiProvider(
|
||||
providers: [ChangeNotifierProvider.value(value: Provider.of<ContactInfoState>(context))],
|
||||
child: PeerSettingsView(),
|
||||
);
|
||||
} else {
|
||||
return MultiProvider(
|
||||
providers: [ChangeNotifierProvider.value(value: Provider.of<ContactInfoState>(context))],
|
||||
child: PeerSettingsView(),
|
||||
);
|
||||
}
|
||||
},
|
||||
));
|
||||
}
|
||||
|
||||
void _sendMessage() {
|
||||
ChatMessage cm = new ChatMessage(o: 1, d: ctrlrCompose.value.text);
|
||||
|
|
|
@ -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<PeerSettingsView> {
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(Provider.of<ContactInfoState>(context).onion),
|
||||
),
|
||||
body: _buildSettingsList(),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSettingsList() {
|
||||
return Consumer<Settings>(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: []))));
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
|
@ -60,7 +60,8 @@ class _ContactRowState extends State<ContactRow> {
|
|||
builder: (BuildContext builderContext) {
|
||||
return MultiProvider(
|
||||
providers: [
|
||||
Provider.value(value: Provider.of<ProfileInfoState>(context)),
|
||||
ChangeNotifierProvider.value(value: Provider.of<ProfileInfoState>(context)),
|
||||
ChangeNotifierProvider.value(value: Provider.of<ContactInfoState>(context)),
|
||||
],
|
||||
child: MessageView(conversationHandle: handle),
|
||||
);
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// Generated file. Do not edit.
|
||||
//
|
||||
|
||||
// clang-format off
|
||||
|
||||
#include "generated_plugin_registrant.h"
|
||||
|
||||
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// Generated file. Do not edit.
|
||||
//
|
||||
|
||||
// clang-format off
|
||||
|
||||
#ifndef GENERATED_PLUGIN_REGISTRANT_
|
||||
#define GENERATED_PLUGIN_REGISTRANT_
|
||||
|
||||
|
|
Loading…
Reference in New Issue