Adjust layout

This commit is contained in:
Hillel Coren 2020-03-27 16:50:04 +03:00
parent 8da3615125
commit 506f337b7f
1 changed files with 47 additions and 49 deletions

View File

@ -76,55 +76,6 @@ class _AccountManagementState extends State<AccountManagement>
ListView( ListView(
children: <Widget>[ children: <Widget>[
SizedBox(height: 14), SizedBox(height: 14),
//if (isSelfHosted(context))
//if (false)
Padding(
padding: const EdgeInsets.all(14),
child: Row(
children: <Widget>[
Expanded(
child: ElevatedButton(
label: localization.purchaseLicense,
iconData: Icons.cloud_download,
onPressed: () async {
if (await canLaunch(kWhiteLabelUrl)) {
launch(kWhiteLabelUrl, forceSafariVC: false);
}
},
),
),
SizedBox(width: 14),
Expanded(
child: ElevatedButton(
label: localization.applyLicense,
iconData: Icons.cloud_done,
onPressed: () {
fieldCallback(
context: context,
title: localization.applyLicense,
field: localization.license,
maxLength: 24,
callback: (value) {
final state = viewModel.state;
final credentials = state.credentials;
final url = formatApiUrl(credentials.url) +
'/claim_license?license_key=$value';
WebClient().post(
url,
credentials.token,
).then((dynamic response) {
viewModel.onAppliedLicense();
}).catchError((dynamic error) {
showErrorDialog(
context: context, message: '$error');
});
});
},
),
),
],
),
),
/* /*
Padding( Padding(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
@ -147,6 +98,53 @@ class _AccountManagementState extends State<AccountManagement>
), ),
), ),
*/ */
Padding(
padding: const EdgeInsets.all(16),
child: ElevatedButton(
label: localization.purchaseLicense,
iconData: Icons.cloud_download,
onPressed: () async {
if (await canLaunch(kWhiteLabelUrl)) {
launch(kWhiteLabelUrl, forceSafariVC: false);
}
},
),
),
Padding(
padding: const EdgeInsets.all(16),
child: ElevatedButton(
label: localization.applyLicense,
iconData: Icons.cloud_done,
onPressed: () {
fieldCallback(
context: context,
title: localization.applyLicense,
field: localization.license,
maxLength: 24,
callback: (value) {
final state = viewModel.state;
final credentials = state.credentials;
final url = formatApiUrl(credentials.url) +
'/claim_license?license_key=$value';
WebClient()
.post(
url,
credentials.token,
)
.then((dynamic response) {
viewModel.onAppliedLicense();
}).catchError((dynamic error) {
showErrorDialog(
context: context, message: '$error');
});
});
},
),
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 16),
child: Divider(),
),
Padding( Padding(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
child: ElevatedButton( child: ElevatedButton(