flutter format
continuous-integration/drone/pr Build is pending
Details
continuous-integration/drone/pr Build is pending
Details
This commit is contained in:
parent
b29bb1e4dc
commit
abf4d79e80
|
@ -282,8 +282,6 @@ class ProfileInfoState extends ChangeNotifier {
|
||||||
this._contacts.updateLastMessageTime(this._contacts._contacts.first.identifier, this._contacts._contacts.first.lastMessageTime);
|
this._contacts.updateLastMessageTime(this._contacts._contacts.first.identifier, this._contacts._contacts.first.lastMessageTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse out the server list json into our server info state struct...
|
// Parse out the server list json into our server info state struct...
|
||||||
|
|
|
@ -37,7 +37,6 @@ class Settings extends ChangeNotifier {
|
||||||
bool blockUnknownConnections = false;
|
bool blockUnknownConnections = false;
|
||||||
bool streamerMode = false;
|
bool streamerMode = false;
|
||||||
|
|
||||||
|
|
||||||
void setTheme(String themeId, String mode) {
|
void setTheme(String themeId, String mode) {
|
||||||
theme = getTheme(themeId, mode);
|
theme = getTheme(themeId, mode);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
@ -220,7 +219,6 @@ class Settings extends ChangeNotifier {
|
||||||
/// Convert this Settings object to a JSON representation for serialization on the
|
/// Convert this Settings object to a JSON representation for serialization on the
|
||||||
/// event bus.
|
/// event bus.
|
||||||
dynamic asJson() {
|
dynamic asJson() {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"Locale": this.locale.languageCode,
|
"Locale": this.locale.languageCode,
|
||||||
"Theme": theme.theme,
|
"Theme": theme.theme,
|
||||||
|
|
|
@ -17,7 +17,8 @@ import 'neon2.dart';
|
||||||
const mode_light = "light";
|
const mode_light = "light";
|
||||||
const mode_dark = "dark";
|
const mode_dark = "dark";
|
||||||
|
|
||||||
final themes = { cwtch_theme: {mode_light: CwtchLight(), mode_dark: CwtchDark()},
|
final themes = {
|
||||||
|
cwtch_theme: {mode_light: CwtchLight(), mode_dark: CwtchDark()},
|
||||||
ghost_theme: {mode_light: GhostLight(), mode_dark: GhostDark()},
|
ghost_theme: {mode_light: GhostLight(), mode_dark: GhostDark()},
|
||||||
mermaid_theme: {mode_light: MermaidLight(), mode_dark: MermaidDark()},
|
mermaid_theme: {mode_light: MermaidLight(), mode_dark: MermaidDark()},
|
||||||
midnight_theme: {mode_light: MidnightLight(), mode_dark: MidnightDark()},
|
midnight_theme: {mode_light: MidnightLight(), mode_dark: MidnightDark()},
|
||||||
|
@ -169,13 +170,10 @@ ThemeData mkThemeData(Settings opaque) {
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
scrollbarTheme: ScrollbarThemeData(
|
scrollbarTheme: ScrollbarThemeData(isAlwaysShown: false, thumbColor: MaterialStateProperty.all(opaque.current().scrollbarDefaultColor)),
|
||||||
isAlwaysShown: false, thumbColor: MaterialStateProperty.all(opaque.current().scrollbarDefaultColor)),
|
|
||||||
tabBarTheme: TabBarTheme(indicator: UnderlineTabIndicator(borderSide: BorderSide(color: opaque.current().defaultButtonActiveColor))),
|
tabBarTheme: TabBarTheme(indicator: UnderlineTabIndicator(borderSide: BorderSide(color: opaque.current().defaultButtonActiveColor))),
|
||||||
dialogTheme: DialogTheme(
|
dialogTheme: DialogTheme(
|
||||||
backgroundColor: opaque.current().backgroundPaneColor,
|
backgroundColor: opaque.current().backgroundPaneColor, titleTextStyle: TextStyle(color: opaque.current().mainTextColor), contentTextStyle: TextStyle(color: opaque.current().mainTextColor)),
|
||||||
titleTextStyle: TextStyle(color: opaque.current().mainTextColor),
|
|
||||||
contentTextStyle: TextStyle(color: opaque.current().mainTextColor)),
|
|
||||||
textTheme: TextTheme(
|
textTheme: TextTheme(
|
||||||
headline1: TextStyle(color: opaque.current().mainTextColor),
|
headline1: TextStyle(color: opaque.current().mainTextColor),
|
||||||
headline2: TextStyle(color: opaque.current().mainTextColor),
|
headline2: TextStyle(color: opaque.current().mainTextColor),
|
||||||
|
@ -196,10 +194,7 @@ ThemeData mkThemeData(Settings opaque) {
|
||||||
trackColor: MaterialStateProperty.all(opaque.current().dropShadowColor),
|
trackColor: MaterialStateProperty.all(opaque.current().dropShadowColor),
|
||||||
),
|
),
|
||||||
floatingActionButtonTheme: FloatingActionButtonThemeData(
|
floatingActionButtonTheme: FloatingActionButtonThemeData(
|
||||||
backgroundColor: opaque.current().defaultButtonColor,
|
backgroundColor: opaque.current().defaultButtonColor, hoverColor: opaque.current().defaultButtonActiveColor, enableFeedback: true, splashColor: opaque.current().defaultButtonActiveColor),
|
||||||
hoverColor: opaque.current().defaultButtonActiveColor,
|
|
||||||
enableFeedback: true,
|
|
||||||
splashColor: opaque.current().defaultButtonActiveColor),
|
|
||||||
textSelectionTheme: TextSelectionThemeData(
|
textSelectionTheme: TextSelectionThemeData(
|
||||||
cursorColor: opaque.current().defaultButtonActiveColor, selectionColor: opaque.current().defaultButtonActiveColor, selectionHandleColor: opaque.current().defaultButtonActiveColor),
|
cursorColor: opaque.current().defaultButtonActiveColor, selectionColor: opaque.current().defaultButtonActiveColor, selectionHandleColor: opaque.current().defaultButtonActiveColor),
|
||||||
);
|
);
|
||||||
|
|
|
@ -86,10 +86,10 @@ class _AddEditServerViewState extends State<AddEditServerView> {
|
||||||
// Onion
|
// Onion
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: serverInfoState.onion.isNotEmpty,
|
visible: serverInfoState.onion.isNotEmpty,
|
||||||
child: Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [
|
child: Column(
|
||||||
CwtchLabel(label: AppLocalizations.of(context)!.serverAddress),
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
SelectableText(serverInfoState.onion)
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
])),
|
children: [CwtchLabel(label: AppLocalizations.of(context)!.serverAddress), SelectableText(serverInfoState.onion)])),
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [
|
Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
|
@ -157,25 +157,18 @@ class _AddEditServerViewState extends State<AddEditServerView> {
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
Text(AppLocalizations.of(context)!.serverMetricsLabel, style: Provider.of<FlwtchState>(context).biggerFont),
|
Text(AppLocalizations.of(context)!.serverMetricsLabel, style: Provider.of<FlwtchState>(context).biggerFont),
|
||||||
Row(
|
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
children: [
|
|
||||||
Row( crossAxisAlignment: CrossAxisAlignment.start, children: [
|
|
||||||
Text(AppLocalizations.of(context)!.serverTotalMessagesLabel),
|
Text(AppLocalizations.of(context)!.serverTotalMessagesLabel),
|
||||||
]),
|
]),
|
||||||
Text(serverInfoState.totalMessages.toString())
|
Text(serverInfoState.totalMessages.toString())
|
||||||
]),
|
]),
|
||||||
|
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
||||||
Row(
|
Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Row( crossAxisAlignment: CrossAxisAlignment.start, children: [
|
|
||||||
Text(AppLocalizations.of(context)!.serverConnectionsLabel),
|
Text(AppLocalizations.of(context)!.serverConnectionsLabel),
|
||||||
]),
|
]),
|
||||||
Text(serverInfoState.connections.toString())
|
Text(serverInfoState.connections.toString())
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
|
||||||
])),
|
])),
|
||||||
|
|
||||||
// ***** Password *****
|
// ***** Password *****
|
||||||
|
|
|
@ -331,15 +331,24 @@ String getLanguageFull(context, String languageCode) {
|
||||||
/// Since we don't seem to able to dynamically pull translations, this function maps themes to their names
|
/// Since we don't seem to able to dynamically pull translations, this function maps themes to their names
|
||||||
String getThemeName(context, String theme) {
|
String getThemeName(context, String theme) {
|
||||||
switch (theme) {
|
switch (theme) {
|
||||||
case cwtch_theme: return AppLocalizations.of(context)!.themeNameCwtch;
|
case cwtch_theme:
|
||||||
case ghost_theme: return AppLocalizations.of(context)!.themeNameGhost;
|
return AppLocalizations.of(context)!.themeNameCwtch;
|
||||||
case mermaid_theme: return AppLocalizations.of(context)!.themeNameMermaid;
|
case ghost_theme:
|
||||||
case midnight_theme: return AppLocalizations.of(context)!.themeNameMidnight;
|
return AppLocalizations.of(context)!.themeNameGhost;
|
||||||
case neon1_theme: return AppLocalizations.of(context)!.themeNameNeon1;
|
case mermaid_theme:
|
||||||
case neon2_theme: return AppLocalizations.of(context)!.themeNameNeon2;
|
return AppLocalizations.of(context)!.themeNameMermaid;
|
||||||
case pumpkin_theme: return AppLocalizations.of(context)!.themeNamePumpkin;
|
case midnight_theme:
|
||||||
case vampire_theme: return AppLocalizations.of(context)!.themeNameVampire;
|
return AppLocalizations.of(context)!.themeNameMidnight;
|
||||||
case witch_theme: return AppLocalizations.of(context)!.themeNameWitch;
|
case neon1_theme:
|
||||||
|
return AppLocalizations.of(context)!.themeNameNeon1;
|
||||||
|
case neon2_theme:
|
||||||
|
return AppLocalizations.of(context)!.themeNameNeon2;
|
||||||
|
case pumpkin_theme:
|
||||||
|
return AppLocalizations.of(context)!.themeNamePumpkin;
|
||||||
|
case vampire_theme:
|
||||||
|
return AppLocalizations.of(context)!.themeNameVampire;
|
||||||
|
case witch_theme:
|
||||||
|
return AppLocalizations.of(context)!.themeNameWitch;
|
||||||
}
|
}
|
||||||
return theme;
|
return theme;
|
||||||
}
|
}
|
||||||
|
|
|
@ -314,8 +314,7 @@ class _MessageViewState extends State<MessageView> {
|
||||||
children = [composeBox];
|
children = [composeBox];
|
||||||
}
|
}
|
||||||
|
|
||||||
return Container(
|
return Container(color: Provider.of<Settings>(context).theme.backgroundMainColor, child: Column(mainAxisSize: MainAxisSize.min, children: children));
|
||||||
color: Provider.of<Settings>(context).theme.backgroundMainColor, child: Column(mainAxisSize: MainAxisSize.min, children: children));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send the message if enter is pressed without the shift key...
|
// Send the message if enter is pressed without the shift key...
|
||||||
|
|
|
@ -10,14 +10,12 @@ import '../main.dart';
|
||||||
import '../model.dart';
|
import '../model.dart';
|
||||||
import '../settings.dart';
|
import '../settings.dart';
|
||||||
|
|
||||||
|
|
||||||
class ProfileServersView extends StatefulWidget {
|
class ProfileServersView extends StatefulWidget {
|
||||||
@override
|
@override
|
||||||
_ProfileServersView createState() => _ProfileServersView();
|
_ProfileServersView createState() => _ProfileServersView();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ProfileServersView extends State<ProfileServersView> {
|
class _ProfileServersView extends State<ProfileServersView> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
super.dispose();
|
super.dispose();
|
||||||
|
@ -25,9 +23,10 @@ class _ProfileServersView extends State<ProfileServersView> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
var knownServers = Provider.of<ProfileInfoState>(context).serverList.servers.map<String>((RemoteServerInfoState remoteServer) {
|
||||||
var knownServers = Provider.of<ProfileInfoState>(context).serverList.servers.map<String>((RemoteServerInfoState remoteServer) { return remoteServer.onion + ".onion"; }).toSet();
|
return remoteServer.onion + ".onion";
|
||||||
var importServerList = Provider.of<ServerListState>(context).servers.where((server) => !knownServers.contains(server.onion) ).map<DropdownMenuItem<String>>((ServerInfoState serverInfo) {
|
}).toSet();
|
||||||
|
var importServerList = Provider.of<ServerListState>(context).servers.where((server) => !knownServers.contains(server.onion)).map<DropdownMenuItem<String>>((ServerInfoState serverInfo) {
|
||||||
return DropdownMenuItem<String>(
|
return DropdownMenuItem<String>(
|
||||||
value: serverInfo.onion,
|
value: serverInfo.onion,
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -37,20 +36,17 @@ class _ProfileServersView extends State<ProfileServersView> {
|
||||||
);
|
);
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
importServerList.insert(0, DropdownMenuItem<String>(
|
importServerList.insert(0, DropdownMenuItem<String>(value: "", child: Text(AppLocalizations.of(context)!.importLocalServerSelectText)));
|
||||||
value: "",
|
|
||||||
child: Text(AppLocalizations.of(context)!.importLocalServerSelectText)));
|
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text(MediaQuery
|
title: Text(MediaQuery.of(context).size.width > 600 ? AppLocalizations.of(context)!.manageKnownServersLong : AppLocalizations.of(context)!.manageKnownServersShort),
|
||||||
.of(context)
|
|
||||||
.size
|
|
||||||
.width > 600 ? AppLocalizations.of(context)!.manageKnownServersLong : AppLocalizations.of(context)!.manageKnownServersShort),
|
|
||||||
),
|
),
|
||||||
body: Consumer<ProfileInfoState>(builder: (context, profile, child) {
|
body: Consumer<ProfileInfoState>(
|
||||||
|
builder: (context, profile, child) {
|
||||||
ProfileServerListState servers = profile.serverList;
|
ProfileServerListState servers = profile.serverList;
|
||||||
final tiles = servers.servers.map((RemoteServerInfoState server) {
|
final tiles = servers.servers.map(
|
||||||
|
(RemoteServerInfoState server) {
|
||||||
return ChangeNotifierProvider<RemoteServerInfoState>.value(
|
return ChangeNotifierProvider<RemoteServerInfoState>.value(
|
||||||
value: server,
|
value: server,
|
||||||
builder: (context, child) => RepaintBoundary(child: RemoteServerRow()),
|
builder: (context, child) => RepaintBoundary(child: RemoteServerRow()),
|
||||||
|
@ -63,20 +59,19 @@ class _ProfileServersView extends State<ProfileServersView> {
|
||||||
tiles: tiles,
|
tiles: tiles,
|
||||||
).toList();
|
).toList();
|
||||||
|
|
||||||
final importCard = Card( child: ListTile(
|
final importCard = Card(
|
||||||
|
child: ListTile(
|
||||||
title: Text(AppLocalizations.of(context)!.importLocalServerLabel),
|
title: Text(AppLocalizations.of(context)!.importLocalServerLabel),
|
||||||
leading: Icon(CwtchIcons.add_circle_24px , color: Provider.of<Settings>(context).current().mainTextColor),
|
leading: Icon(CwtchIcons.add_circle_24px, color: Provider.of<Settings>(context).current().mainTextColor),
|
||||||
trailing: DropdownButton(
|
trailing: DropdownButton(
|
||||||
onChanged: (String? importServer) {
|
onChanged: (String? importServer) {
|
||||||
if (importServer!.isNotEmpty) {
|
if (importServer!.isNotEmpty) {
|
||||||
var server = Provider.of<ServerListState>(context).getServer(importServer)!;
|
var server = Provider.of<ServerListState>(context).getServer(importServer)!;
|
||||||
showImportConfirm(context, profile.onion, server.onion, server.description, server.serverBundle);
|
showImportConfirm(context, profile.onion, server.onion, server.description, server.serverBundle);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
value: "",
|
value: "",
|
||||||
items: importServerList,
|
items: importServerList,
|
||||||
|
|
||||||
)));
|
)));
|
||||||
|
|
||||||
return LayoutBuilder(builder: (BuildContext context, BoxConstraints viewportConstraints) {
|
return LayoutBuilder(builder: (BuildContext context, BoxConstraints viewportConstraints) {
|
||||||
|
@ -84,16 +79,11 @@ class _ProfileServersView extends State<ProfileServersView> {
|
||||||
isAlwaysShown: true,
|
isAlwaysShown: true,
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
child:
|
child: Container(
|
||||||
Container(
|
|
||||||
margin: EdgeInsets.fromLTRB(5, 0, 5, 10),
|
margin: EdgeInsets.fromLTRB(5, 0, 5, 10),
|
||||||
padding: EdgeInsets.fromLTRB(5, 0, 5, 10),
|
padding: EdgeInsets.fromLTRB(5, 0, 5, 10),
|
||||||
child: Column(children: [
|
child: Column(children: [if (importServerList.length > 1) importCard, Column(children: divided)]))));
|
||||||
|
});
|
||||||
if (importServerList.length > 1) importCard,
|
|
||||||
|
|
||||||
Column( children: divided )
|
|
||||||
]))));});
|
|
||||||
|
|
||||||
return ListView(children: divided);
|
return ListView(children: divided);
|
||||||
},
|
},
|
||||||
|
@ -102,7 +92,7 @@ class _ProfileServersView extends State<ProfileServersView> {
|
||||||
|
|
||||||
showImportConfirm(BuildContext context, String profileHandle, String serverHandle, String serverDesc, String bundle) {
|
showImportConfirm(BuildContext context, String profileHandle, String serverHandle, String serverDesc, String bundle) {
|
||||||
var serverLabel = serverDesc.isNotEmpty ? serverDesc : serverHandle;
|
var serverLabel = serverDesc.isNotEmpty ? serverDesc : serverHandle;
|
||||||
serverHandle = serverHandle.substring(0, serverHandle.length-6 ); // remove '.onion'
|
serverHandle = serverHandle.substring(0, serverHandle.length - 6); // remove '.onion'
|
||||||
// set up the buttons
|
// set up the buttons
|
||||||
Widget cancelButton = ElevatedButton(
|
Widget cancelButton = ElevatedButton(
|
||||||
child: Text(AppLocalizations.of(context)!.cancel),
|
child: Text(AppLocalizations.of(context)!.cancel),
|
||||||
|
@ -118,15 +108,9 @@ class _ProfileServersView extends State<ProfileServersView> {
|
||||||
Future.delayed(const Duration(milliseconds: 500), () {
|
Future.delayed(const Duration(milliseconds: 500), () {
|
||||||
var profile = Provider.of<ProfileInfoState>(context);
|
var profile = Provider.of<ProfileInfoState>(context);
|
||||||
if (profile.serverList.getServer(serverHandle) != null) {
|
if (profile.serverList.getServer(serverHandle) != null) {
|
||||||
profile.serverList.getServer(serverHandle)?.updateDescription(
|
profile.serverList.getServer(serverHandle)?.updateDescription(serverDesc);
|
||||||
serverDesc);
|
|
||||||
|
|
||||||
Provider
|
Provider.of<FlwtchState>(context, listen: false).cwtch.SetConversationAttribute(profile.onion, profile.serverList.getServer(serverHandle)!.identifier, "server.description", serverDesc);
|
||||||
.of<FlwtchState>(context, listen: false)
|
|
||||||
.cwtch
|
|
||||||
.SetConversationAttribute(profile.onion, profile.serverList
|
|
||||||
.getServer(serverHandle)
|
|
||||||
!.identifier, "server.description", serverDesc);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
|
@ -149,7 +133,4 @@ class _ProfileServersView extends State<ProfileServersView> {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -50,9 +50,7 @@ class _RemoteServerViewState extends State<RemoteServerView> {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Consumer3<ProfileInfoState, RemoteServerInfoState, Settings>(builder: (context, profile, serverInfoState, settings, child) {
|
return Consumer3<ProfileInfoState, RemoteServerInfoState, Settings>(builder: (context, profile, serverInfoState, settings, child) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(title: Text(ctrlrDesc.text.isNotEmpty ? ctrlrDesc.text : serverInfoState.onion)),
|
||||||
title: Text(ctrlrDesc.text.isNotEmpty ? ctrlrDesc.text : serverInfoState.onion)
|
|
||||||
),
|
|
||||||
body: Container(
|
body: Container(
|
||||||
margin: EdgeInsets.fromLTRB(30, 0, 30, 10),
|
margin: EdgeInsets.fromLTRB(30, 0, 30, 10),
|
||||||
padding: EdgeInsets.fromLTRB(20, 0, 20, 10),
|
padding: EdgeInsets.fromLTRB(20, 0, 20, 10),
|
||||||
|
@ -64,9 +62,7 @@ class _RemoteServerViewState extends State<RemoteServerView> {
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
SelectableText(
|
SelectableText(serverInfoState.onion),
|
||||||
serverInfoState.onion
|
|
||||||
),
|
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
@ -93,15 +89,18 @@ class _RemoteServerViewState extends State<RemoteServerView> {
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
|
|
||||||
Padding(padding: EdgeInsets.all(8), child: Text( AppLocalizations.of(context)!.groupsOnThisServerLabel),),
|
Padding(
|
||||||
|
padding: EdgeInsets.all(8),
|
||||||
|
child: Text(AppLocalizations.of(context)!.groupsOnThisServerLabel),
|
||||||
|
),
|
||||||
Expanded(child: _buildGroupsList(serverInfoState))
|
Expanded(child: _buildGroupsList(serverInfoState))
|
||||||
])));
|
])));
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildGroupsList(RemoteServerInfoState serverInfoState) {
|
Widget _buildGroupsList(RemoteServerInfoState serverInfoState) {
|
||||||
final tiles = serverInfoState.groups.map((ContactInfoState group) {
|
final tiles = serverInfoState.groups.map(
|
||||||
|
(ContactInfoState group) {
|
||||||
return ChangeNotifierProvider<ContactInfoState>.value(
|
return ChangeNotifierProvider<ContactInfoState>.value(
|
||||||
value: group,
|
value: group,
|
||||||
builder: (context, child) => RepaintBoundary(child: _buildGroupRow(group)), // ServerRow()),
|
builder: (context, child) => RepaintBoundary(child: _buildGroupRow(group)), // ServerRow()),
|
||||||
|
@ -126,8 +125,7 @@ class _RemoteServerViewState extends State<RemoteServerView> {
|
||||||
Widget _buildGroupRow(ContactInfoState group) {
|
Widget _buildGroupRow(ContactInfoState group) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(6.0), //border size
|
padding: const EdgeInsets.all(6.0), //border size
|
||||||
child: Column(
|
child: Column(children: [
|
||||||
children: [
|
|
||||||
Text(
|
Text(
|
||||||
group.nickname,
|
group.nickname,
|
||||||
style: Provider.of<FlwtchState>(context).biggerFont.apply(color: Provider.of<Settings>(context).theme.portraitOnlineBorderColor),
|
style: Provider.of<FlwtchState>(context).biggerFont.apply(color: Provider.of<Settings>(context).theme.portraitOnlineBorderColor),
|
||||||
|
@ -143,9 +141,6 @@ class _RemoteServerViewState extends State<RemoteServerView> {
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(color: Provider.of<Settings>(context).theme.portraitOnlineBorderColor),
|
style: TextStyle(color: Provider.of<Settings>(context).theme.portraitOnlineBorderColor),
|
||||||
)))
|
)))
|
||||||
])
|
]));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,7 @@ class SplashView extends StatelessWidget {
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(20.0),
|
padding: const EdgeInsets.all(20.0),
|
||||||
child: Text(appState.appError == "" ? "Loading Cwtch..." : appState.appError,
|
child: Text(appState.appError == "" ? "Loading Cwtch..." : appState.appError,
|
||||||
style: TextStyle(
|
style: TextStyle(fontSize: 16.0, color: appState.appError == "" ? Provider.of<Settings>(context).theme.mainTextColor : Provider.of<Settings>(context).theme.textfieldErrorColor)),
|
||||||
fontSize: 16.0, color: appState.appError == "" ? Provider.of<Settings>(context).theme.mainTextColor : Provider.of<Settings>(context).theme.textfieldErrorColor)),
|
|
||||||
),
|
),
|
||||||
Image(image: AssetImage("assets/Open_Privacy_Logo_lightoutline.png")),
|
Image(image: AssetImage("assets/Open_Privacy_Logo_lightoutline.png")),
|
||||||
])),
|
])),
|
||||||
|
|
|
@ -115,8 +115,7 @@ class FileBubbleState extends State<FileBubble> {
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: fromMe ? Provider.of<Settings>(context).theme.messageFromMeBackgroundColor : Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor,
|
color: fromMe ? Provider.of<Settings>(context).theme.messageFromMeBackgroundColor : Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor,
|
||||||
border:
|
border: Border.all(color: fromMe ? Provider.of<Settings>(context).theme.messageFromMeBackgroundColor : Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor, width: 1),
|
||||||
Border.all(color: fromMe ? Provider.of<Settings>(context).theme.messageFromMeBackgroundColor : Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor, width: 1),
|
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
topLeft: Radius.circular(borderRadiousEh),
|
topLeft: Radius.circular(borderRadiousEh),
|
||||||
topRight: Radius.circular(borderRadiousEh),
|
topRight: Radius.circular(borderRadiousEh),
|
||||||
|
|
|
@ -97,8 +97,7 @@ class InvitationBubbleState extends State<InvitationBubble> {
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: fromMe ? Provider.of<Settings>(context).theme.messageFromMeBackgroundColor : Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor,
|
color: fromMe ? Provider.of<Settings>(context).theme.messageFromMeBackgroundColor : Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor,
|
||||||
border:
|
border: Border.all(color: fromMe ? Provider.of<Settings>(context).theme.messageFromMeBackgroundColor : Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor, width: 1),
|
||||||
Border.all(color: fromMe ? Provider.of<Settings>(context).theme.messageFromMeBackgroundColor : Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor, width: 1),
|
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
topLeft: Radius.circular(borderRadiousEh),
|
topLeft: Radius.circular(borderRadiousEh),
|
||||||
topRight: Radius.circular(borderRadiousEh),
|
topRight: Radius.circular(borderRadiousEh),
|
||||||
|
|
|
@ -95,9 +95,7 @@ class MessageBubbleState extends State<MessageBubble> {
|
||||||
child: Container(
|
child: Container(
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: error
|
color: error ? malformedColor : (fromMe ? Provider.of<Settings>(context).theme.messageFromMeBackgroundColor : Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor),
|
||||||
? malformedColor
|
|
||||||
: (fromMe ? Provider.of<Settings>(context).theme.messageFromMeBackgroundColor : Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor),
|
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: error
|
color: error
|
||||||
? malformedColor
|
? malformedColor
|
||||||
|
|
|
@ -25,8 +25,7 @@ class _MessageBubbleDecoration extends State<MessageBubbleDecoration> {
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Text(widget.prettyDate,
|
Text(widget.prettyDate,
|
||||||
style:
|
style: TextStyle(fontSize: 9.0, color: widget.fromMe ? Provider.of<Settings>(context).theme.messageFromMeTextColor : Provider.of<Settings>(context).theme.messageFromOtherTextColor),
|
||||||
TextStyle(fontSize: 9.0, color: widget.fromMe ? Provider.of<Settings>(context).theme.messageFromMeTextColor : Provider.of<Settings>(context).theme.messageFromOtherTextColor),
|
|
||||||
textAlign: widget.fromMe ? TextAlign.right : TextAlign.left),
|
textAlign: widget.fromMe ? TextAlign.right : TextAlign.left),
|
||||||
!widget.fromMe
|
!widget.fromMe
|
||||||
? SizedBox(width: 1, height: 1)
|
? SizedBox(width: 1, height: 1)
|
||||||
|
|
|
@ -90,9 +90,7 @@ class QuotedMessageBubbleState extends State<QuotedMessageBubble> {
|
||||||
child: Container(
|
child: Container(
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: error
|
color: error ? malformedColor : (fromMe ? Provider.of<Settings>(context).theme.messageFromMeBackgroundColor : Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor),
|
||||||
? malformedColor
|
|
||||||
: (fromMe ? Provider.of<Settings>(context).theme.messageFromMeBackgroundColor : Provider.of<Settings>(context).theme.messageFromOtherBackgroundColor),
|
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: error
|
color: error
|
||||||
? malformedColor
|
? malformedColor
|
||||||
|
|
|
@ -25,28 +25,25 @@ class _RemoteServerRowState extends State<RemoteServerRow> {
|
||||||
var server = Provider.of<RemoteServerInfoState>(context);
|
var server = Provider.of<RemoteServerInfoState>(context);
|
||||||
var description = server.description.isNotEmpty ? server.description : server.onion;
|
var description = server.description.isNotEmpty ? server.description : server.onion;
|
||||||
var running = server.status == "Synced";
|
var running = server.status == "Synced";
|
||||||
return Consumer<ProfileInfoState>(
|
return Consumer<ProfileInfoState>(builder: (context, profile, child) {
|
||||||
builder: (context, profile, child) {
|
return Card(
|
||||||
return Card(clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
margin: EdgeInsets.all(0.0),
|
margin: EdgeInsets.all(0.0),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
child: Row(
|
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(6.0), //border size
|
padding: const EdgeInsets.all(6.0), //border size
|
||||||
child: Icon(CwtchIcons.dns_24px,
|
child: Icon(CwtchIcons.dns_24px,
|
||||||
color: running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor,
|
color: running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor, size: 64)),
|
||||||
size: 64)
|
|
||||||
|
|
||||||
),
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
description,
|
description,
|
||||||
semanticsLabel: description,
|
semanticsLabel: description,
|
||||||
style: Provider.of<FlwtchState>(context).biggerFont.apply(color: running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor),
|
style: Provider.of<FlwtchState>(context)
|
||||||
|
.biggerFont
|
||||||
|
.apply(color: running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor),
|
||||||
softWrap: true,
|
softWrap: true,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
|
@ -61,7 +58,6 @@ class _RemoteServerRowState extends State<RemoteServerRow> {
|
||||||
)))
|
)))
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
|
|
||||||
]),
|
]),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.of(context).push(MaterialPageRoute<void>(
|
Navigator.of(context).push(MaterialPageRoute<void>(
|
||||||
|
@ -72,7 +68,7 @@ class _RemoteServerRowState extends State<RemoteServerRow> {
|
||||||
child: RemoteServerView(),
|
child: RemoteServerView(),
|
||||||
);
|
);
|
||||||
}));
|
}));
|
||||||
}
|
}));
|
||||||
));});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,8 +76,7 @@ class _ServerRowState extends State<ServerRow> {
|
||||||
]),
|
]),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
_pushEditServer(server);
|
_pushEditServer(server);
|
||||||
}
|
}));
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _pushEditServer(ServerInfoState server) {
|
void _pushEditServer(ServerInfoState server) {
|
||||||
|
|
|
@ -47,7 +47,6 @@ class _CwtchTextFieldState extends State<CwtchTextField> {
|
||||||
filled: true,
|
filled: true,
|
||||||
focusedBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(15.0), borderSide: BorderSide(color: theme.current().textfieldBorderColor, width: 3.0)),
|
focusedBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(15.0), borderSide: BorderSide(color: theme.current().textfieldBorderColor, width: 3.0)),
|
||||||
focusedErrorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(15.0), borderSide: BorderSide(color: theme.current().textfieldErrorColor, width: 3.0)),
|
focusedErrorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(15.0), borderSide: BorderSide(color: theme.current().textfieldErrorColor, width: 3.0)),
|
||||||
|
|
||||||
errorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(15.0), borderSide: BorderSide(color: theme.current().textfieldErrorColor, width: 3.0)),
|
errorBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(15.0), borderSide: BorderSide(color: theme.current().textfieldErrorColor, width: 3.0)),
|
||||||
errorStyle: TextStyle(
|
errorStyle: TextStyle(
|
||||||
color: theme.current().textfieldErrorColor,
|
color: theme.current().textfieldErrorColor,
|
||||||
|
|
Loading…
Reference in New Issue