allow two column mode from settings
This commit is contained in:
parent
8a6d35967f
commit
46e48fbdc5
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../main.dart';
|
import '../main.dart';
|
||||||
|
import '../model.dart';
|
||||||
import 'contactsview.dart';
|
import 'contactsview.dart';
|
||||||
import 'messageview.dart';
|
import 'messageview.dart';
|
||||||
|
|
||||||
|
@ -26,7 +27,12 @@ class _DoubleColumnViewState extends State<DoubleColumnView> {
|
||||||
child: flwtch.selectedConversation == ""
|
child: flwtch.selectedConversation == ""
|
||||||
? Center(child: Text("pick a contact"))
|
? Center(child: Text("pick a contact"))
|
||||||
: //dev
|
: //dev
|
||||||
Container(child: MessageView()),
|
MultiProvider(
|
||||||
|
providers: [
|
||||||
|
ChangeNotifierProvider.value(value: Provider.of<ProfileInfoState>(context)),
|
||||||
|
ChangeNotifierProvider.value(value: Provider.of<ProfileInfoState>(context).contactList.getContact(flwtch.selectedConversation)),
|
||||||
|
],
|
||||||
|
child: Container(child: MessageView())),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
@ -74,6 +74,26 @@ class _GlobalSettingsViewState extends State<GlobalSettingsView> {
|
||||||
},
|
},
|
||||||
secondary: Icon(Icons.lightbulb_outline, color: settings.current().mainTextColor()),
|
secondary: Icon(Icons.lightbulb_outline, color: settings.current().mainTextColor()),
|
||||||
),
|
),
|
||||||
|
ListTile(
|
||||||
|
title: Text(/*AppLocalizations.of(context).settingLanguage*/"UI Columns", style: TextStyle(color: settings.current().mainTextColor())),
|
||||||
|
leading: Icon(Icons.table_chart, color: settings.current().mainTextColor()),
|
||||||
|
trailing: DropdownButton(
|
||||||
|
value: Provider.of<Settings>(context).locale.languageCode,
|
||||||
|
onChanged: (String newValue) {
|
||||||
|
if (newValue == "Double (1:2)") {
|
||||||
|
Provider.of<FlwtchState>(context).columns = [1, 2];
|
||||||
|
} else if (newValue == "Double (1:4)") {
|
||||||
|
Provider.of<FlwtchState>(context).columns = [1, 4];
|
||||||
|
} else {
|
||||||
|
Provider.of<FlwtchState>(context).columns = [1];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
items: ["Single", "Double (1:2)", "Double (1:4)"].map<DropdownMenuItem<String>>((String value) {
|
||||||
|
return DropdownMenuItem<String>(
|
||||||
|
value: value,
|
||||||
|
child: Text(value),
|
||||||
|
);
|
||||||
|
}).toList())),
|
||||||
SwitchListTile(
|
SwitchListTile(
|
||||||
title: Text(AppLocalizations.of(context).blockUnknownLabel, style: TextStyle(color: settings.current().mainTextColor())),
|
title: Text(AppLocalizations.of(context).blockUnknownLabel, style: TextStyle(color: settings.current().mainTextColor())),
|
||||||
subtitle: Text(AppLocalizations.of(context).descriptionBlockUnknownConnections),
|
subtitle: Text(AppLocalizations.of(context).descriptionBlockUnknownConnections),
|
||||||
|
|
Loading…
Reference in New Issue