fixes for profile buttons
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Sarah Jamie Lewis 2022-06-09 14:54:48 -07:00
parent be8646e805
commit d1e8f71290
1 changed files with 64 additions and 54 deletions

View File

@ -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,29 +276,31 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Row( ElevatedButton(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: ElevatedButton(
onPressed: _createPressed, onPressed: _createPressed,
style: ElevatedButton.styleFrom(
minimumSize: Size(400, 50),
maximumSize: Size(800, 50),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.horizontal(left: Radius.circular(180), right: Radius.circular(180))),
),
child: Text( child: Text(
Provider.of<ProfileInfoState>(context).onion.isEmpty ? AppLocalizations.of(context)!.addNewProfileBtn : AppLocalizations.of(context)!.saveProfileBtn, Provider.of<ProfileInfoState>(context).onion.isEmpty ? AppLocalizations.of(context)!.addNewProfileBtn : AppLocalizations.of(context)!.saveProfileBtn,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
),
],
),
Visibility(
visible: Provider.of<ProfileInfoState>(context, listen: false).onion.isNotEmpty,
child: Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.end, children: [
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Tooltip( Visibility(
visible: Provider.of<ProfileInfoState>(context, listen: false).onion.isNotEmpty,
child: Tooltip(
message: AppLocalizations.of(context)!.exportProfileTooltip, message: AppLocalizations.of(context)!.exportProfileTooltip,
child: ElevatedButton.icon( child: ElevatedButton.icon(
style: ElevatedButton.styleFrom(
minimumSize: Size(400, 50),
maximumSize: Size(800, 50),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.horizontal(left: Radius.circular(180), right: Radius.circular(180))),
),
onPressed: () { onPressed: () {
if (Platform.isAndroid) { if (Platform.isAndroid) {
Provider.of<FlwtchState>(context, listen: false).cwtch.ExportProfile(ctrlrOnion.value.text, ctrlrOnion.value.text + ".tar.gz"); Provider.of<FlwtchState>(context, listen: false).cwtch.ExportProfile(ctrlrOnion.value.text, ctrlrOnion.value.text + ".tar.gz");
@ -313,24 +318,29 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
}, },
icon: Icon(Icons.import_export), icon: Icon(Icons.import_export),
label: Text(AppLocalizations.of(context)!.exportProfile), label: Text(AppLocalizations.of(context)!.exportProfile),
)) ))),
])),
Visibility(
visible: Provider.of<ProfileInfoState>(context, listen: false).onion.isNotEmpty,
child: Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.end, children: [
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Tooltip( Visibility(
visible: Provider.of<ProfileInfoState>(context, listen: false).onion.isNotEmpty,
child: Tooltip(
message: AppLocalizations.of(context)!.enterCurrentPasswordForDelete, message: AppLocalizations.of(context)!.enterCurrentPasswordForDelete,
child: ElevatedButton.icon( child: ElevatedButton.icon(
style: ElevatedButton.styleFrom(
minimumSize: Size(400, 50),
maximumSize: Size(800, 50),
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,
),
onPressed: () { onPressed: () {
showAlertDialog(context); showAlertDialog(context);
}, },
icon: Icon(Icons.delete_forever), icon: Icon(Icons.delete_forever),
label: Text(AppLocalizations.of(context)!.deleteBtn), label: Text(AppLocalizations.of(context)!.deleteBtn),
)) )))
]))
])))))); ]))))));
}); });
}); });