Skip to content

Commit

Permalink
comment fixes (apache#25255)
Browse files Browse the repository at this point in the history
  • Loading branch information
darkhan.nausharipov committed Feb 7, 2023
1 parent bc4d930 commit 17b8c42
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 140 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,17 @@ class _Buttons extends StatelessWidget {
closeOverlayCallback();
showDialog(
context: context,
builder: (context) => Dialog(
backgroundColor: Colors.transparent,
child: BeamAlertDialog(
body: 'dialogs.deleteAccountWarning'.tr(),
continueLabel: 'ui.deleteMyAccount'.tr(),
title: 'ui.deleteTobAccount'.tr(),
onContinue: () {
authNotifier.deleteAccount().then(
(_) {
Navigator.pop(context);
},
);
},
),
builder: (context) => BeamAlertDialog(
text: 'dialogs.deleteAccountWarning'.tr(),
continueLabel: 'ui.deleteMyAccount'.tr(),
title: 'ui.deleteTobAccount'.tr(),
onContinue: () {
authNotifier.deleteAccount().then(
(_) {
Navigator.pop(context);
},
);
},
),
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,13 @@ class SolutionButton extends StatelessWidget {
// TODO(nausharipov): resolve the conflict with save user code
showDialog(
context: context,
builder: (context) => Dialog(
backgroundColor: Colors.transparent,
child: BeamAlertDialog(
continueLabel: 'pages.tour.showSolution'.tr(),
title: 'pages.tour.solveYourself'.tr(),
onContinue: () {
tourNotifier.toggleShowingSolution();
Navigator.pop(context);
},
),
builder: (context) => BeamAlertDialog(
continueLabel: 'pages.tour.showSolution'.tr(),
title: 'pages.tour.solveYourself'.tr(),
onContinue: () {
tourNotifier.toggleShowingSolution();
Navigator.pop(context);
},
),
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
# specific language governing permissions and limitations
# under the License.

dialogs:
cancel: Cancel

errors:
error: 'Error'
loading: 'Error while loading.'
Expand All @@ -35,7 +38,6 @@ intents:
reset: 'Reset Code'

widgets:

codeEditor:
label: 'Code Text Area'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,61 +16,64 @@
* limitations under the License.
*/

import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';

import '../../../playground_components.dart';

class BeamAlertDialog extends StatelessWidget {
final String? body;
final String? text;
final String continueLabel;
final VoidCallback onContinue;
final String title;

const BeamAlertDialog({
this.body,
required this.continueLabel,
required this.onContinue,
required this.title,
this.text,
});

@override
Widget build(BuildContext context) {
return OverlayBody(
child: Container(
width: BeamSizes.popupWidth,
padding: const EdgeInsets.all(BeamSizes.size16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
title,
style: Theme.of(context).textTheme.headlineMedium,
),
if (body != null)
Padding(
padding: const EdgeInsets.only(top: BeamSizes.size8),
child: Text(body!),
return Dialog(
backgroundColor: Colors.transparent,
child: OverlayBody(
child: Container(
width: BeamSizes.popupWidth,
padding: const EdgeInsets.all(BeamSizes.size16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
title,
style: Theme.of(context).textTheme.headlineMedium,
),
const SizedBox(height: BeamSizes.size8),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () {
Navigator.pop(context);
},
// TODO(nausharipov): review: translate in PGC?
child: const Text('Cancel'),
if (text != null)
Padding(
padding: const EdgeInsets.only(top: BeamSizes.size8),
child: Text(text!),
),
const SizedBox(width: BeamSizes.size8),
TextButton(
onPressed: onContinue,
child: Text(continueLabel),
),
],
),
],
const SizedBox(height: BeamSizes.size8),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () {
Navigator.pop(context);
},
child: const Text('dialogs.cancel').tr(),
),
const SizedBox(width: BeamSizes.size8),
TextButton(
onPressed: onContinue,
child: Text(continueLabel),
),
],
),
],
),
),
),
);
Expand Down

This file was deleted.

0 comments on commit 17b8c42

Please sign in to comment.