Merge pull request 'Modal Menu UI Fixes' (#467) from marcia_fixes into trunk
continuous-integration/drone/push Build is pending
Details
continuous-integration/drone/push Build is pending
Details
Reviewed-on: #467 Reviewed-by: Dan Ballard <dan@openprivacy.ca>
This commit is contained in:
commit
c8e896fa51
|
@ -87,7 +87,7 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: EdgeInsets.all(30),
|
margin: EdgeInsets.all(30),
|
||||||
padding: EdgeInsets.all(20),
|
padding: EdgeInsets.all(20),
|
||||||
child: Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.stretch, children: [
|
child: Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: Provider.of<ProfileInfoState>(context).onion.isNotEmpty,
|
visible: Provider.of<ProfileInfoState>(context).onion.isNotEmpty,
|
||||||
child: Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
|
child: Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
|
||||||
|
@ -127,6 +127,9 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
|
||||||
badgeEdit: Provider.of<Settings>(context).isExperimentEnabled(ImagePreviewsExperiment))))
|
badgeEdit: Provider.of<Settings>(context).isExperimentEnabled(ImagePreviewsExperiment))))
|
||||||
])),
|
])),
|
||||||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
CwtchLabel(label: AppLocalizations.of(context)!.displayNameLabel),
|
CwtchLabel(label: AppLocalizations.of(context)!.displayNameLabel),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
|
@ -273,64 +276,71 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
Row(
|
ElevatedButton(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
onPressed: _createPressed,
|
||||||
children: [
|
style: ElevatedButton.styleFrom(
|
||||||
Expanded(
|
minimumSize: Size(400, 50),
|
||||||
child: ElevatedButton(
|
maximumSize: Size(800, 50),
|
||||||
onPressed: _createPressed,
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.horizontal(left: Radius.circular(180), right: Radius.circular(180))),
|
||||||
child: Text(
|
),
|
||||||
Provider.of<ProfileInfoState>(context).onion.isEmpty ? AppLocalizations.of(context)!.addNewProfileBtn : AppLocalizations.of(context)!.saveProfileBtn,
|
child: Text(
|
||||||
textAlign: TextAlign.center,
|
Provider.of<ProfileInfoState>(context).onion.isEmpty ? AppLocalizations.of(context)!.addNewProfileBtn : AppLocalizations.of(context)!.saveProfileBtn,
|
||||||
),
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
SizedBox(
|
||||||
|
height: 20,
|
||||||
),
|
),
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: Provider.of<ProfileInfoState>(context, listen: false).onion.isNotEmpty,
|
visible: Provider.of<ProfileInfoState>(context, listen: false).onion.isNotEmpty,
|
||||||
child: Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.end, children: [
|
child: Tooltip(
|
||||||
SizedBox(
|
message: AppLocalizations.of(context)!.exportProfileTooltip,
|
||||||
height: 20,
|
child: ElevatedButton.icon(
|
||||||
),
|
style: ElevatedButton.styleFrom(
|
||||||
Tooltip(
|
minimumSize: Size(400, 50),
|
||||||
message: AppLocalizations.of(context)!.exportProfileTooltip,
|
maximumSize: Size(800, 50),
|
||||||
child: ElevatedButton.icon(
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.horizontal(left: Radius.circular(180), right: Radius.circular(180))),
|
||||||
onPressed: () {
|
),
|
||||||
if (Platform.isAndroid) {
|
onPressed: () {
|
||||||
Provider.of<FlwtchState>(context, listen: false).cwtch.ExportProfile(ctrlrOnion.value.text, ctrlrOnion.value.text + ".tar.gz");
|
if (Platform.isAndroid) {
|
||||||
final snackBar = SnackBar(content: Text(AppLocalizations.of(context)!.fileSavedTo + " " + ctrlrOnion.value.text + ".tar.gz"));
|
Provider.of<FlwtchState>(context, listen: false).cwtch.ExportProfile(ctrlrOnion.value.text, ctrlrOnion.value.text + ".tar.gz");
|
||||||
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
final snackBar = SnackBar(content: Text(AppLocalizations.of(context)!.fileSavedTo + " " + ctrlrOnion.value.text + ".tar.gz"));
|
||||||
} else {
|
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||||
showCreateFilePicker(context).then((name) {
|
} else {
|
||||||
if (name != null) {
|
showCreateFilePicker(context).then((name) {
|
||||||
Provider.of<FlwtchState>(context, listen: false).cwtch.ExportProfile(ctrlrOnion.value.text, name);
|
if (name != null) {
|
||||||
final snackBar = SnackBar(content: Text(AppLocalizations.of(context)!.fileSavedTo + " " + name));
|
Provider.of<FlwtchState>(context, listen: false).cwtch.ExportProfile(ctrlrOnion.value.text, name);
|
||||||
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
final snackBar = SnackBar(content: Text(AppLocalizations.of(context)!.fileSavedTo + " " + name));
|
||||||
}
|
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
},
|
}
|
||||||
icon: Icon(Icons.import_export),
|
},
|
||||||
label: Text(AppLocalizations.of(context)!.exportProfile),
|
icon: Icon(Icons.import_export),
|
||||||
))
|
label: Text(AppLocalizations.of(context)!.exportProfile),
|
||||||
])),
|
))),
|
||||||
|
SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: Provider.of<ProfileInfoState>(context, listen: false).onion.isNotEmpty,
|
visible: Provider.of<ProfileInfoState>(context, listen: false).onion.isNotEmpty,
|
||||||
child: Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.end, children: [
|
child: Tooltip(
|
||||||
SizedBox(
|
message: AppLocalizations.of(context)!.enterCurrentPasswordForDelete,
|
||||||
height: 20,
|
child: ElevatedButton.icon(
|
||||||
),
|
style: ElevatedButton.styleFrom(
|
||||||
Tooltip(
|
minimumSize: Size(400, 50),
|
||||||
message: AppLocalizations.of(context)!.enterCurrentPasswordForDelete,
|
maximumSize: Size(800, 50),
|
||||||
child: ElevatedButton.icon(
|
shape: RoundedRectangleBorder(
|
||||||
onPressed: () {
|
side: BorderSide(color: Provider.of<Settings>(context).theme.defaultButtonActiveColor, width: 2.0),
|
||||||
showAlertDialog(context);
|
borderRadius: BorderRadius.horizontal(left: Radius.circular(180), right: Radius.circular(180))),
|
||||||
},
|
primary: Provider.of<Settings>(context).theme.backgroundMainColor,
|
||||||
icon: Icon(Icons.delete_forever),
|
),
|
||||||
label: Text(AppLocalizations.of(context)!.deleteBtn),
|
onPressed: () {
|
||||||
))
|
showAlertDialog(context);
|
||||||
]))
|
},
|
||||||
|
icon: Icon(Icons.delete_forever),
|
||||||
|
label: Text(AppLocalizations.of(context)!.deleteBtn),
|
||||||
|
)))
|
||||||
]))))));
|
]))))));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -254,61 +254,86 @@ class _ContactsViewState extends State<ContactsView> {
|
||||||
height: 200, // bespoke value courtesy of the [TextField] docs
|
height: 200, // bespoke value courtesy of the [TextField] docs
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.all(10.0),
|
padding: EdgeInsets.all(2.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
mainAxisSize: MainAxisSize.min,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
|
|
||||||
Spacer(),
|
|
||||||
Expanded(
|
|
||||||
child: Tooltip(
|
|
||||||
message: AppLocalizations.of(context)!.tooltipAddContact,
|
|
||||||
child: ElevatedButton(
|
|
||||||
child: Text(AppLocalizations.of(context)!.addContact, semanticsLabel: AppLocalizations.of(context)!.addContact),
|
|
||||||
onPressed: () {
|
|
||||||
_pushAddContact(false);
|
|
||||||
},
|
|
||||||
))),
|
|
||||||
Spacer()
|
|
||||||
]),
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
|
Expanded(
|
||||||
Spacer(),
|
|
||||||
Expanded(
|
|
||||||
child: Tooltip(
|
child: Tooltip(
|
||||||
message: groupsEnabled ? AppLocalizations.of(context)!.addServerTooltip : AppLocalizations.of(context)!.thisFeatureRequiresGroupExpermientsToBeEnabled,
|
message: AppLocalizations.of(context)!.tooltipAddContact,
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
child: Text(AppLocalizations.of(context)!.addServerTitle, semanticsLabel: AppLocalizations.of(context)!.addServerTitle),
|
style: ElevatedButton.styleFrom(
|
||||||
|
minimumSize: Size.fromWidth(double.infinity),
|
||||||
|
maximumSize: Size.fromWidth(400),
|
||||||
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.horizontal(left: Radius.circular(180), right: Radius.circular(180))),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
AppLocalizations.of(context)!.addContact,
|
||||||
|
semanticsLabel: AppLocalizations.of(context)!.addContact,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
_pushAddContact(false);
|
||||||
|
},
|
||||||
|
))),
|
||||||
|
SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Tooltip(
|
||||||
|
message: groupsEnabled ? AppLocalizations.of(context)!.addServerTooltip : AppLocalizations.of(context)!.thisFeatureRequiresGroupExpermientsToBeEnabled,
|
||||||
|
child: ElevatedButton(
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
minimumSize: Size.fromWidth(double.infinity),
|
||||||
|
maximumSize: Size.fromWidth(400),
|
||||||
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.horizontal(left: Radius.circular(180), right: Radius.circular(180))),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
AppLocalizations.of(context)!.addServerTitle,
|
||||||
|
semanticsLabel: AppLocalizations.of(context)!.addServerTitle,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
onPressed: groupsEnabled
|
||||||
|
? () {
|
||||||
|
_pushAddContact(false);
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Tooltip(
|
||||||
|
message: groupsEnabled ? AppLocalizations.of(context)!.createGroupTitle : AppLocalizations.of(context)!.thisFeatureRequiresGroupExpermientsToBeEnabled,
|
||||||
|
child: ElevatedButton(
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
minimumSize: Size.fromWidth(double.infinity),
|
||||||
|
maximumSize: Size.fromWidth(400),
|
||||||
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.horizontal(left: Radius.circular(180), right: Radius.circular(180))),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
AppLocalizations.of(context)!.createGroupTitle,
|
||||||
|
semanticsLabel: AppLocalizations.of(context)!.createGroupTitle,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
onPressed: groupsEnabled
|
onPressed: groupsEnabled
|
||||||
? () {
|
? () {
|
||||||
_pushAddContact(false);
|
_pushAddContact(true);
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
)),
|
))),
|
||||||
),
|
|
||||||
Spacer()
|
|
||||||
]),
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
|
|
||||||
Spacer(),
|
|
||||||
Expanded(
|
|
||||||
child: Tooltip(
|
|
||||||
message: groupsEnabled ? AppLocalizations.of(context)!.createGroupTitle : AppLocalizations.of(context)!.thisFeatureRequiresGroupExpermientsToBeEnabled,
|
|
||||||
child: ElevatedButton(
|
|
||||||
child: Text(AppLocalizations.of(context)!.createGroupTitle, semanticsLabel: AppLocalizations.of(context)!.createGroupTitle),
|
|
||||||
onPressed: groupsEnabled
|
|
||||||
? () {
|
|
||||||
_pushAddContact(true);
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
))),
|
|
||||||
Spacer()
|
|
||||||
]),
|
|
||||||
],
|
],
|
||||||
))),
|
))),
|
||||||
)));
|
)));
|
||||||
|
|
|
@ -81,7 +81,7 @@ class _MessageViewState extends State<MessageView> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// After leaving a conversation the selected conversation is set to null...
|
// After leaving a conversation the selected conversation is set to null...
|
||||||
if (Provider.of<ContactInfoState>(context).profileOnion == "") {
|
if (Provider.of<ContactInfoState>(context, listen: false).profileOnion == "") {
|
||||||
return Card(child: Center(child: Text(AppLocalizations.of(context)!.addContactFirst)));
|
return Card(child: Center(child: Text(AppLocalizations.of(context)!.addContactFirst)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -194,49 +194,66 @@ class _ProfileMgrViewState extends State<ProfileMgrView> {
|
||||||
padding: EdgeInsets.all(10.0),
|
padding: EdgeInsets.all(10.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
|
|
||||||
Spacer(),
|
|
||||||
Expanded(
|
|
||||||
child: ElevatedButton(
|
|
||||||
child: Text(AppLocalizations.of(context)!.addProfileTitle, semanticsLabel: AppLocalizations.of(context)!.addProfileTitle),
|
|
||||||
onPressed: () {
|
|
||||||
_pushAddProfile(context);
|
|
||||||
},
|
|
||||||
)),
|
|
||||||
Spacer()
|
|
||||||
]),
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
|
Expanded(
|
||||||
Spacer(),
|
child: ElevatedButton(
|
||||||
Expanded(
|
style: ElevatedButton.styleFrom(
|
||||||
child: Tooltip(
|
minimumSize: Size(double.infinity, 20),
|
||||||
message: AppLocalizations.of(context)!.importProfileTooltip,
|
maximumSize: Size(400, 20),
|
||||||
child: ElevatedButton(
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.horizontal(left: Radius.circular(180), right: Radius.circular(180))),
|
||||||
child: Text(AppLocalizations.of(context)!.importProfile, semanticsLabel: AppLocalizations.of(context)!.importProfile),
|
),
|
||||||
onPressed: () {
|
child: Text(
|
||||||
// 10GB profiles should be enough for anyone?
|
AppLocalizations.of(context)!.addProfileTitle,
|
||||||
showFilePicker(context, MaxGeneralFileSharingSize, (file) {
|
semanticsLabel: AppLocalizations.of(context)!.addProfileTitle,
|
||||||
showPasswordDialog(context, AppLocalizations.of(context)!.importProfile, AppLocalizations.of(context)!.importProfile, (password) {
|
style: TextStyle(fontWeight: FontWeight.bold),
|
||||||
Navigator.popUntil(context, (route) => route.isFirst);
|
),
|
||||||
Provider.of<FlwtchState>(context, listen: false).cwtch.ImportProfile(file.path, password).then((value) {
|
onPressed: () {
|
||||||
if (value == "") {
|
_pushAddProfile(context);
|
||||||
final snackBar = SnackBar(content: Text(AppLocalizations.of(context)!.successfullyImportedProfile.replaceFirst("%profile", file.path)));
|
},
|
||||||
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
)),
|
||||||
} else {
|
SizedBox(
|
||||||
final snackBar = SnackBar(content: Text(AppLocalizations.of(context)!.failedToImportProfile));
|
height: 20,
|
||||||
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
),
|
||||||
}
|
Expanded(
|
||||||
});
|
child: Tooltip(
|
||||||
|
message: AppLocalizations.of(context)!.importProfileTooltip,
|
||||||
|
child: ElevatedButton(
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
minimumSize: Size(double.infinity, 20),
|
||||||
|
maximumSize: Size(400, 20),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
side: BorderSide(color: Provider.of<Settings>(context).theme.defaultButtonActiveColor, width: 2.0),
|
||||||
|
borderRadius: BorderRadius.horizontal(left: Radius.circular(180), right: Radius.circular(180))),
|
||||||
|
primary: Provider.of<Settings>(context).theme.backgroundMainColor,
|
||||||
|
),
|
||||||
|
child:
|
||||||
|
Text(AppLocalizations.of(context)!.importProfile, semanticsLabel: AppLocalizations.of(context)!.importProfile, style: TextStyle(fontWeight: FontWeight.bold)),
|
||||||
|
onPressed: () {
|
||||||
|
// 10GB profiles should be enough for anyone?
|
||||||
|
showFilePicker(context, MaxGeneralFileSharingSize, (file) {
|
||||||
|
showPasswordDialog(context, AppLocalizations.of(context)!.importProfile, AppLocalizations.of(context)!.importProfile, (password) {
|
||||||
|
Navigator.popUntil(context, (route) => route.isFirst);
|
||||||
|
Provider.of<FlwtchState>(context, listen: false).cwtch.ImportProfile(file.path, password).then((value) {
|
||||||
|
if (value == "") {
|
||||||
|
final snackBar = SnackBar(content: Text(AppLocalizations.of(context)!.successfullyImportedProfile.replaceFirst("%profile", file.path)));
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||||
|
} else {
|
||||||
|
final snackBar = SnackBar(content: Text(AppLocalizations.of(context)!.failedToImportProfile));
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}, () {}, () {});
|
});
|
||||||
},
|
}, () {}, () {});
|
||||||
))),
|
},
|
||||||
Spacer()
|
))),
|
||||||
]),
|
SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
))),
|
))),
|
||||||
)));
|
)));
|
||||||
|
|
Loading…
Reference in New Issue