flutter format
continuous-integration/drone/pr Build is pending Details

This commit is contained in:
Dan Ballard 2021-12-15 17:29:27 -05:00
parent b29bb1e4dc
commit abf4d79e80
30 changed files with 322 additions and 368 deletions

View File

@ -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...

View File

@ -35,7 +35,7 @@ class ProfileServerListState extends ChangeNotifier {
// online v offline // online v offline
if (a.status == "Synced" && b.status != "Synced") { if (a.status == "Synced" && b.status != "Synced") {
return -1; return -1;
} else if (a.status != "Synced" && b.status == "Synced") { } else if (a.status != "Synced" && b.status == "Synced") {
return 1; return 1;
} }
@ -73,7 +73,7 @@ class RemoteServerInfoState extends ChangeNotifier {
List<ContactInfoState> _groups = []; List<ContactInfoState> _groups = [];
RemoteServerInfoState({required this.onion, required this.identifier, required this.description, required this.status}); RemoteServerInfoState({required this.onion, required this.identifier, required this.description, required this.status});
void updateDescription(String newDescription) { void updateDescription(String newDescription) {
this.description = newDescription; this.description = newDescription;
notifyListeners(); notifyListeners();

View File

@ -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,

View File

@ -93,7 +93,7 @@ class CwtchLight extends OpaqueThemeType {
get backgroundPaneColor => header; //softPurple; get backgroundPaneColor => header; //softPurple;
get backgroundHilightElementColor => softPurple; get backgroundHilightElementColor => softPurple;
get mainTextColor => settings; get mainTextColor => settings;
get sendHintTextColor => purple; get sendHintTextColor => purple;
get hilightElementColor => purple; //darkPurple; // todo shouldn't be this, too dark, makes font unreadable get hilightElementColor => purple; //darkPurple; // todo shouldn't be this, too dark, makes font unreadable
get defaultButtonColor => accent; // hotPink; get defaultButtonColor => accent; // hotPink;
get defaultButtonTextColor => whitePurple; // ? get defaultButtonTextColor => whitePurple; // ?
@ -118,4 +118,4 @@ class CwtchLight extends OpaqueThemeType {
get messageFromMeTextColor => font; //mainTextColor; get messageFromMeTextColor => font; //mainTextColor;
get messageFromOtherBackgroundColor => peerBubble; //purple; get messageFromOtherBackgroundColor => peerBubble; //purple;
get messageFromOtherTextColor => font; //darkPurple; get messageFromOtherTextColor => font; //darkPurple;
} }

View File

@ -64,4 +64,4 @@ class GhostLight extends CwtchLight {
get messageFromMeTextColor => font; //mainTextColor; get messageFromMeTextColor => font; //mainTextColor;
get messageFromOtherBackgroundColor => peerBubble; //purple; get messageFromOtherBackgroundColor => peerBubble; //purple;
get messageFromOtherTextColor => font; //darkPurple; get messageFromOtherTextColor => font; //darkPurple;
} }

View File

@ -64,4 +64,4 @@ class MermaidLight extends CwtchLight {
get messageFromMeTextColor => font; //mainTextColor; get messageFromMeTextColor => font; //mainTextColor;
get messageFromOtherBackgroundColor => peerBubble; //purple; get messageFromOtherBackgroundColor => peerBubble; //purple;
get messageFromOtherTextColor => font; //darkPurple; get messageFromOtherTextColor => font; //darkPurple;
} }

View File

@ -64,4 +64,4 @@ class MidnightLight extends CwtchLight {
get messageFromMeTextColor => font; //mainTextColor; get messageFromMeTextColor => font; //mainTextColor;
get messageFromOtherBackgroundColor => peerBubble; //purple; get messageFromOtherBackgroundColor => peerBubble; //purple;
get messageFromOtherTextColor => font; //darkPurple; get messageFromOtherTextColor => font; //darkPurple;
} }

View File

@ -64,4 +64,4 @@ class Neon1Light extends CwtchLight {
get messageFromMeTextColor => font; //mainTextColor; get messageFromMeTextColor => font; //mainTextColor;
get messageFromOtherBackgroundColor => peerBubble; //purple; get messageFromOtherBackgroundColor => peerBubble; //purple;
get messageFromOtherTextColor => font; //darkPurple; get messageFromOtherTextColor => font; //darkPurple;
} }

View File

@ -64,4 +64,4 @@ class Neon2Light extends CwtchLight {
get messageFromMeTextColor => font; //mainTextColor; get messageFromMeTextColor => font; //mainTextColor;
get messageFromOtherBackgroundColor => peerBubble; //purple; get messageFromOtherBackgroundColor => peerBubble; //purple;
get messageFromOtherTextColor => font; //darkPurple; get messageFromOtherTextColor => font; //darkPurple;
} }

View File

@ -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),
); );

View File

@ -64,4 +64,4 @@ class PumpkinLight extends CwtchLight {
get messageFromMeTextColor => font; //mainTextColor; get messageFromMeTextColor => font; //mainTextColor;
get messageFromOtherBackgroundColor => peerBubble; //purple; get messageFromOtherBackgroundColor => peerBubble; //purple;
get messageFromOtherTextColor => font; //darkPurple; get messageFromOtherTextColor => font; //darkPurple;
} }

View File

@ -64,4 +64,4 @@ class VampireLight extends CwtchLight {
get messageFromMeTextColor => font; //mainTextColor; get messageFromMeTextColor => font; //mainTextColor;
get messageFromOtherBackgroundColor => peerBubble; //purple; get messageFromOtherBackgroundColor => peerBubble; //purple;
get messageFromOtherTextColor => font; //darkPurple; get messageFromOtherTextColor => font; //darkPurple;
} }

View File

@ -64,4 +64,4 @@ class WitchLight extends CwtchLight {
get messageFromMeTextColor => font; //mainTextColor; get messageFromMeTextColor => font; //mainTextColor;
get messageFromOtherBackgroundColor => peerBubble; //purple; get messageFromOtherBackgroundColor => peerBubble; //purple;
get messageFromOtherTextColor => font; //darkPurple; get messageFromOtherTextColor => font; //darkPurple;
} }

View File

@ -107,7 +107,7 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
hintText: AppLocalizations.of(context)!.yourDisplayName, hintText: AppLocalizations.of(context)!.yourDisplayName,
validator: (value) { validator: (value) {
if (value.isEmpty) { if (value.isEmpty) {
return AppLocalizations.of(context)!.displayNameTooltip; return AppLocalizations.of(context)!.displayNameTooltip;
} }
return null; return null;
}, },

View File

@ -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: [ Text(AppLocalizations.of(context)!.serverTotalMessagesLabel),
Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ ]),
Text(AppLocalizations.of(context)!.serverTotalMessagesLabel), Text(serverInfoState.totalMessages.toString())
]), ]),
Text(serverInfoState.totalMessages.toString()) Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
]), Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
Text(AppLocalizations.of(context)!.serverConnectionsLabel),
Row( ]),
mainAxisAlignment: MainAxisAlignment.spaceBetween, Text(serverInfoState.connections.toString())
children: [ ]),
Row( crossAxisAlignment: CrossAxisAlignment.start, children: [
Text(AppLocalizations.of(context)!.serverConnectionsLabel),
]),
Text(serverInfoState.connections.toString())
]),
])), ])),
// ***** Password ***** // ***** Password *****

View File

@ -117,7 +117,7 @@ class _ContactsViewState extends State<ContactsView> {
if (Provider.of<Settings>(context, listen: false).isExperimentEnabled(TapirGroupsExperiment) || Provider.of<Settings>(context, listen: false).isExperimentEnabled(ServerManagementExperiment)) { if (Provider.of<Settings>(context, listen: false).isExperimentEnabled(TapirGroupsExperiment) || Provider.of<Settings>(context, listen: false).isExperimentEnabled(ServerManagementExperiment)) {
actions.add(IconButton( actions.add(IconButton(
icon: Icon(CwtchIcons.dns_24px), icon: Icon(CwtchIcons.dns_24px),
tooltip: AppLocalizations.of(context)!.manageKnownServersButton, tooltip: AppLocalizations.of(context)!.manageKnownServersButton,
onPressed: () { onPressed: () {
_pushServers(); _pushServers();
})); }));

View File

@ -91,21 +91,21 @@ class _GlobalSettingsViewState extends State<GlobalSettingsView> {
secondary: Icon(CwtchIcons.change_theme, color: settings.current().mainTextColor), secondary: Icon(CwtchIcons.change_theme, color: settings.current().mainTextColor),
), ),
ListTile( ListTile(
title: Text(AppLocalizations.of(context)!.themeColorLabel), title: Text(AppLocalizations.of(context)!.themeColorLabel),
trailing: DropdownButton<String>( trailing: DropdownButton<String>(
value: Provider.of<Settings>(context).theme.theme, value: Provider.of<Settings>(context).theme.theme,
onChanged: (String? newValue) { onChanged: (String? newValue) {
setState(() { setState(() {
settings.setTheme(newValue!, settings.theme.mode); settings.setTheme(newValue!, settings.theme.mode);
saveSettings(context); saveSettings(context);
}); });
}, },
items: themes.keys.map<DropdownMenuItem<String>>((String themeId) { items: themes.keys.map<DropdownMenuItem<String>>((String themeId) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: themeId, value: themeId,
child: Text(getThemeName(context, themeId)), child: Text(getThemeName(context, themeId)),
); );
}).toList()), }).toList()),
leading: Icon(CwtchIcons.change_theme, color: settings.current().mainTextColor), leading: Icon(CwtchIcons.change_theme, color: settings.current().mainTextColor),
), ),
ListTile( ListTile(
@ -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;
} }

View File

@ -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...

View File

@ -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,25 +36,22 @@ 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(
return ChangeNotifierProvider<RemoteServerInfoState>.value( (RemoteServerInfoState server) {
value: server, return ChangeNotifierProvider<RemoteServerInfoState>.value(
builder: (context, child) => RepaintBoundary(child: RemoteServerRow()), value: server,
); builder: (context, child) => RepaintBoundary(child: RemoteServerRow()),
}, );
},
); );
final divided = ListTile.divideTiles( final divided = ListTile.divideTiles(
@ -63,37 +59,31 @@ class _ProfileServersView extends State<ProfileServersView> {
tiles: tiles, tiles: tiles,
).toList(); ).toList();
final importCard = Card( child: ListTile( final importCard = Card(
title: Text(AppLocalizations.of(context)!.importLocalServerLabel), child: ListTile(
leading: Icon(CwtchIcons.add_circle_24px , color: Provider.of<Settings>(context).current().mainTextColor), title: Text(AppLocalizations.of(context)!.importLocalServerLabel),
trailing: DropdownButton( leading: Icon(CwtchIcons.add_circle_24px, color: Provider.of<Settings>(context).current().mainTextColor),
onChanged: (String? importServer) { trailing: DropdownButton(
if (importServer!.isNotEmpty) { onChanged: (String? importServer) {
var server = Provider.of<ServerListState>(context).getServer(importServer)!; if (importServer!.isNotEmpty) {
showImportConfirm(context, profile.onion, server.onion, server.description, server.serverBundle); var server = Provider.of<ServerListState>(context).getServer(importServer)!;
} 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) {
return Scrollbar( return Scrollbar(
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: [if (importServerList.length > 1) importCard, Column(children: divided)]))));
child: Column(children: [ });
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> {
}, },
); );
} }
}
}

View File

@ -50,63 +50,62 @@ 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(
), margin: EdgeInsets.fromLTRB(30, 0, 30, 10),
body: Container( padding: EdgeInsets.fromLTRB(20, 0, 20, 10),
margin: EdgeInsets.fromLTRB(30, 0, 30, 10), child: Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [
padding: EdgeInsets.fromLTRB(20, 0, 20, 10), SizedBox(
child: Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ height: 20,
SizedBox( ),
height: 20, CwtchLabel(label: AppLocalizations.of(context)!.serverAddress),
), SizedBox(
CwtchLabel(label: AppLocalizations.of(context)!.serverAddress), height: 20,
SizedBox( ),
height: 20, SelectableText(serverInfoState.onion),
),
SelectableText(
serverInfoState.onion
),
// Description // Description
SizedBox( SizedBox(
height: 20, height: 20,
), ),
CwtchLabel(label: AppLocalizations.of(context)!.serverDescriptionLabel), CwtchLabel(label: AppLocalizations.of(context)!.serverDescriptionLabel),
Text(AppLocalizations.of(context)!.serverDescriptionDescription), Text(AppLocalizations.of(context)!.serverDescriptionDescription),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
CwtchButtonTextField( CwtchButtonTextField(
controller: ctrlrDesc, controller: ctrlrDesc,
readonly: false, readonly: false,
tooltip: AppLocalizations.of(context)!.saveBtn, tooltip: AppLocalizations.of(context)!.saveBtn,
labelText: AppLocalizations.of(context)!.fieldDescriptionLabel, labelText: AppLocalizations.of(context)!.fieldDescriptionLabel,
icon: Icon(Icons.save), icon: Icon(Icons.save),
onPressed: () { onPressed: () {
Provider.of<FlwtchState>(context, listen: false).cwtch.SetConversationAttribute(profile.onion, serverInfoState.identifier, "server.description", ctrlrDesc.text); Provider.of<FlwtchState>(context, listen: false).cwtch.SetConversationAttribute(profile.onion, serverInfoState.identifier, "server.description", ctrlrDesc.text);
serverInfoState.updateDescription(ctrlrDesc.text); serverInfoState.updateDescription(ctrlrDesc.text);
}, },
), ),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Padding(padding: EdgeInsets.all(8), child: Text( AppLocalizations.of(context)!.groupsOnThisServerLabel),), Padding(
Expanded(child: _buildGroupsList(serverInfoState)) padding: EdgeInsets.all(8),
]))); child: Text(AppLocalizations.of(context)!.groupsOnThisServerLabel),
),
}); Expanded(child: _buildGroupsList(serverInfoState))
])));
});
} }
Widget _buildGroupsList(RemoteServerInfoState serverInfoState) { Widget _buildGroupsList(RemoteServerInfoState serverInfoState) {
final tiles = serverInfoState.groups.map((ContactInfoState group) { final tiles = serverInfoState.groups.map(
return ChangeNotifierProvider<ContactInfoState>.value( (ContactInfoState group) {
value: group, return ChangeNotifierProvider<ContactInfoState>.value(
builder: (context, child) => RepaintBoundary(child: _buildGroupRow(group)), // ServerRow()), value: group,
); builder: (context, child) => RepaintBoundary(child: _buildGroupRow(group)), // ServerRow()),
}, );
},
); );
final divided = ListTile.divideTiles( final divided = ListTile.divideTiles(
@ -126,26 +125,22 @@ 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), softWrap: true,
softWrap: true, overflow: TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis, ),
), Visibility(
Visibility( visible: !Provider.of<Settings>(context).streamerMode,
visible: !Provider.of<Settings>(context).streamerMode, child: ExcludeSemantics(
child: ExcludeSemantics( child: Text(
child: Text( group.onion,
group.onion, softWrap: true,
softWrap: true, overflow: TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis, style: TextStyle(color: Provider.of<Settings>(context).theme.portraitOnlineBorderColor),
style: TextStyle(color: Provider.of<Settings>(context).theme.portraitOnlineBorderColor), )))
))) ]));
])
);
} }
} }

View File

@ -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")),
])), ])),

View File

@ -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),

View File

@ -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),

View File

@ -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

View File

@ -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)

View File

@ -37,64 +37,64 @@ class _MessageListState extends State<MessageList> {
child: Container( child: Container(
color: Provider.of<Settings>(context).theme.backgroundMainColor, color: Provider.of<Settings>(context).theme.backgroundMainColor,
child: Column(children: [ child: Column(children: [
Visibility( Visibility(
visible: showMessageWarning, visible: showMessageWarning,
child: Container( child: Container(
padding: EdgeInsets.all(5.0), padding: EdgeInsets.all(5.0),
color: Provider.of<Settings>(context).theme.defaultButtonActiveColor, color: Provider.of<Settings>(context).theme.defaultButtonActiveColor,
child: DefaultTextStyle( child: DefaultTextStyle(
style: TextStyle(color: Provider.of<Settings>(context).theme.defaultButtonTextColor), style: TextStyle(color: Provider.of<Settings>(context).theme.defaultButtonTextColor),
child: showSyncing child: showSyncing
? Text(AppLocalizations.of(context)!.serverNotSynced, textAlign: TextAlign.center) ? Text(AppLocalizations.of(context)!.serverNotSynced, textAlign: TextAlign.center)
: showOfflineWarning : showOfflineWarning
? Text(Provider.of<ContactInfoState>(context).isGroup ? AppLocalizations.of(context)!.serverConnectivityDisconnected : AppLocalizations.of(context)!.peerOfflineMessage, ? Text(Provider.of<ContactInfoState>(context).isGroup ? AppLocalizations.of(context)!.serverConnectivityDisconnected : AppLocalizations.of(context)!.peerOfflineMessage,
textAlign: TextAlign.center) textAlign: TextAlign.center)
// Only show the ephemeral status for peer conversations, not for groups... // Only show the ephemeral status for peer conversations, not for groups...
: (showEphemeralWarning : (showEphemeralWarning
? Text(AppLocalizations.of(context)!.chatHistoryDefault, textAlign: TextAlign.center) ? Text(AppLocalizations.of(context)!.chatHistoryDefault, textAlign: TextAlign.center)
: :
// We are not allowed to put null here, so put an empty text widget // We are not allowed to put null here, so put an empty text widget
Text("")), Text("")),
))), ))),
Expanded( Expanded(
child: Container( child: Container(
// Only show broken heart is the contact is offline... // Only show broken heart is the contact is offline...
decoration: BoxDecoration( decoration: BoxDecoration(
image: Provider.of<ContactInfoState>(outerContext).isOnline() image: Provider.of<ContactInfoState>(outerContext).isOnline()
? null ? null
: DecorationImage( : DecorationImage(
fit: BoxFit.scaleDown, fit: BoxFit.scaleDown,
alignment: Alignment.center, alignment: Alignment.center,
image: AssetImage("assets/core/negative_heart_512px.png"), image: AssetImage("assets/core/negative_heart_512px.png"),
colorFilter: ColorFilter.mode(Provider.of<Settings>(context).theme.hilightElementColor, BlendMode.srcIn))), colorFilter: ColorFilter.mode(Provider.of<Settings>(context).theme.hilightElementColor, BlendMode.srcIn))),
// Don't load messages for syncing server... // Don't load messages for syncing server...
child: loadMessages child: loadMessages
? ScrollablePositionedList.builder( ? ScrollablePositionedList.builder(
itemPositionsListener: widget.scrollListener, itemPositionsListener: widget.scrollListener,
itemScrollController: widget.scrollController, itemScrollController: widget.scrollController,
initialScrollIndex: initi > 4 ? initi - 4 : 0, initialScrollIndex: initi > 4 ? initi - 4 : 0,
itemCount: Provider.of<ContactInfoState>(outerContext).totalMessages, itemCount: Provider.of<ContactInfoState>(outerContext).totalMessages,
reverse: true, // NOTE: There seems to be a bug in flutter that corrects the mouse wheel scroll, but not the drag direction... reverse: true, // NOTE: There seems to be a bug in flutter that corrects the mouse wheel scroll, but not the drag direction...
itemBuilder: (itemBuilderContext, index) { itemBuilder: (itemBuilderContext, index) {
var profileOnion = Provider.of<ProfileInfoState>(outerContext, listen: false).onion; var profileOnion = Provider.of<ProfileInfoState>(outerContext, listen: false).onion;
var contactHandle = Provider.of<ContactInfoState>(outerContext, listen: false).identifier; var contactHandle = Provider.of<ContactInfoState>(outerContext, listen: false).identifier;
var messageIndex = index; var messageIndex = index;
return FutureBuilder( return FutureBuilder(
future: messageHandler(outerContext, profileOnion, contactHandle, messageIndex), future: messageHandler(outerContext, profileOnion, contactHandle, messageIndex),
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasData) { if (snapshot.hasData) {
var message = snapshot.data as Message; var message = snapshot.data as Message;
var key = Provider.of<ContactInfoState>(outerContext, listen: false).getMessageKey(contactHandle, message.getMetadata().messageID); var key = Provider.of<ContactInfoState>(outerContext, listen: false).getMessageKey(contactHandle, message.getMetadata().messageID);
return message.getWidget(context, key); return message.getWidget(context, key);
} else { } else {
return MessageLoadingBubble(); return MessageLoadingBubble();
} }
}, },
); );
}, },
) )
: null)) : null))
]))); ])));
} }
} }

View File

@ -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

View File

@ -23,46 +23,42 @@ class _RemoteServerRowState extends State<RemoteServerRow> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
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, Padding(
padding: const EdgeInsets.all(6.0), //border size
child: Icon(CwtchIcons.dns_24px,
color: running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor, size: 64)),
Expanded(
child: Column(
children: [ children: [
Padding( Text(
padding: const EdgeInsets.all(6.0), //border size description,
child: Icon(CwtchIcons.dns_24px, semanticsLabel: description,
color: running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor, style: Provider.of<FlwtchState>(context)
size: 64) .biggerFont
.apply(color: running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor),
softWrap: true,
overflow: TextOverflow.ellipsis,
), ),
Expanded( Visibility(
child: Column( visible: !Provider.of<Settings>(context).streamerMode,
children: [ child: ExcludeSemantics(
Text( child: Text(
description, server.onion,
semanticsLabel: description, softWrap: true,
style: Provider.of<FlwtchState>(context).biggerFont.apply(color: running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor), overflow: TextOverflow.ellipsis,
softWrap: true, style: TextStyle(color: running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor),
overflow: TextOverflow.ellipsis, )))
), ],
Visibility( )),
visible: !Provider.of<Settings>(context).streamerMode, ]),
child: ExcludeSemantics(
child: Text(
server.onion,
softWrap: true,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor),
)))
],
)),
]),
onTap: () { onTap: () {
Navigator.of(context).push(MaterialPageRoute<void>( Navigator.of(context).push(MaterialPageRoute<void>(
settings: RouteSettings(name: "remoteserverview"), settings: RouteSettings(name: "remoteserverview"),
@ -72,7 +68,7 @@ class _RemoteServerRowState extends State<RemoteServerRow> {
child: RemoteServerView(), child: RemoteServerView(),
); );
})); }));
} }));
));}); });
} }
} }

View File

@ -26,58 +26,57 @@ class _ServerRowState extends State<ServerRow> {
margin: EdgeInsets.all(0.0), margin: EdgeInsets.all(0.0),
child: InkWell( child: InkWell(
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ child: Row(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: server.running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor, size: 64)), color: server.running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor, size: 64)),
Expanded( Expanded(
child: Column( child: Column(
children: [ children: [
Text( Text(
server.description, server.description,
semanticsLabel: server.description, semanticsLabel: server.description,
style: Provider.of<FlwtchState>(context) style: Provider.of<FlwtchState>(context)
.biggerFont .biggerFont
.apply(color: server.running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor), .apply(color: server.running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor),
softWrap: true,
overflow: TextOverflow.ellipsis,
),
Visibility(
visible: !Provider.of<Settings>(context).streamerMode,
child: ExcludeSemantics(
child: Text(
server.onion,
softWrap: true, softWrap: true,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle(color: server.running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor), ),
))) Visibility(
], visible: !Provider.of<Settings>(context).streamerMode,
)), child: ExcludeSemantics(
child: Text(
server.onion,
softWrap: true,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: server.running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor),
)))
],
)),
// Copy server button // Copy server button
IconButton( IconButton(
enableFeedback: true, enableFeedback: true,
tooltip: AppLocalizations.of(context)!.copyServerKeys, tooltip: AppLocalizations.of(context)!.copyServerKeys,
icon: Icon(CwtchIcons.address_copy_2, color: Provider.of<Settings>(context).current().mainTextColor), icon: Icon(CwtchIcons.address_copy_2, color: Provider.of<Settings>(context).current().mainTextColor),
onPressed: () { onPressed: () {
Clipboard.setData(new ClipboardData(text: server.serverBundle)); Clipboard.setData(new ClipboardData(text: server.serverBundle));
}, },
), ),
// Edit button // Edit button
IconButton( IconButton(
enableFeedback: true, enableFeedback: true,
tooltip: AppLocalizations.of(context)!.editServerTitle, tooltip: AppLocalizations.of(context)!.editServerTitle,
icon: Icon(Icons.create, color: Provider.of<Settings>(context).current().mainTextColor), icon: Icon(Icons.create, color: Provider.of<Settings>(context).current().mainTextColor),
onPressed: () { onPressed: () {
_pushEditServer(server);
},
)
]),
onTap: () {
_pushEditServer(server); _pushEditServer(server);
}, }));
)
]),
onTap: () {
_pushEditServer(server);
}
));
} }
void _pushEditServer(ServerInfoState server) { void _pushEditServer(ServerInfoState server) {

View File

@ -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,