mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-27 17:29:50 +08:00
Migrate away from deprecated buttons
There are still some outlined buttons which need to be migrated, but those aren't so trivial.
This commit is contained in:
@ -95,7 +95,7 @@ class EditorBottomBar extends StatelessWidget {
|
||||
icon: const Icon(Icons.undo),
|
||||
onPressed: undoAllowed ? onUndoSelected : null,
|
||||
),
|
||||
FlatButton.icon(
|
||||
TextButton.icon(
|
||||
icon: const Icon(Icons.folder),
|
||||
label: Text(parentFolder.publicName),
|
||||
onPressed: () {
|
||||
|
@ -38,13 +38,13 @@ class OAuthAppState extends State<OAuthApp> {
|
||||
title: const Text('OAuth Test'),
|
||||
),
|
||||
body: Column(children: <Widget>[
|
||||
RaisedButton(
|
||||
ElevatedButton(
|
||||
child: const Text("Open OAuth URL"),
|
||||
onPressed: () {
|
||||
githost.launchOAuthScreen();
|
||||
},
|
||||
),
|
||||
RaisedButton(
|
||||
ElevatedButton(
|
||||
child: const Text("List Repos"),
|
||||
onPressed: () async {
|
||||
try {
|
||||
@ -57,7 +57,7 @@ class OAuthAppState extends State<OAuthApp> {
|
||||
}
|
||||
},
|
||||
),
|
||||
RaisedButton(
|
||||
ElevatedButton(
|
||||
child: const Text("Create Repo"),
|
||||
onPressed: () async {
|
||||
try {
|
||||
@ -68,7 +68,7 @@ class OAuthAppState extends State<OAuthApp> {
|
||||
}
|
||||
},
|
||||
),
|
||||
RaisedButton(
|
||||
ElevatedButton(
|
||||
child: const Text("Add Deploy Key"),
|
||||
onPressed: () async {
|
||||
try {
|
||||
|
@ -47,14 +47,14 @@ class _FileSystemScreenState extends State<FileSystemScreen> {
|
||||
title: Text(tr("screens.filesystem.ignoredFile.title")),
|
||||
content: Text(ignoredFile.reason.toString()),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
Navigator.of(context).pop(false);
|
||||
_renameFile(ignoredFile.filePath);
|
||||
},
|
||||
child: Text(tr('screens.filesystem.ignoredFile.rename')),
|
||||
),
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: Text(tr('screens.filesystem.ignoredFile.ok')),
|
||||
),
|
||||
|
@ -228,11 +228,11 @@ class _CreateFolderAlertDialogState extends State<CreateFolderAlertDialog> {
|
||||
return AlertDialog(
|
||||
title: Text(tr("screens.folders.dialog.title")),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: Text(tr("screens.folders.dialog.discard")),
|
||||
),
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
var newFolderName = _textController.text;
|
||||
return Navigator.of(context).pop(newFolderName);
|
||||
@ -262,7 +262,7 @@ class FolderErrorDialog extends StatelessWidget {
|
||||
title: Text(tr("screens.folders.errorDialog.title")),
|
||||
content: Text(content),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
child: Text(tr("screens.folders.errorDialog.ok")),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
|
@ -158,7 +158,7 @@ class OnBoardingBottomButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return FlatButton(
|
||||
return TextButton(
|
||||
key: key,
|
||||
child: Text(
|
||||
text,
|
||||
|
@ -99,7 +99,7 @@ class _PurchaseScreenState extends State<PurchaseScreen> {
|
||||
child: Wrap(
|
||||
children: [
|
||||
RestorePurchaseButton(),
|
||||
OutlineButton(
|
||||
OutlinedButton(
|
||||
child: Text(tr("feature_timeline.title")),
|
||||
onPressed: () {
|
||||
var route = MaterialPageRoute(
|
||||
|
@ -151,7 +151,7 @@ class _PasswordForm extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
child: const Text('Ok'),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
|
@ -279,11 +279,11 @@ class IrreversibleActionConfirmationDialog extends StatelessWidget {
|
||||
title: Text(title),
|
||||
content: Text(tr("settings.gitRemote.changeHost.subtitle")),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
child: Text(tr("settings.gitRemote.changeHost.ok")),
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
),
|
||||
FlatButton(
|
||||
TextButton(
|
||||
child: Text(tr("settings.gitRemote.changeHost.cancel")),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
|
@ -391,11 +391,11 @@ class _CustomMetDataTileState extends State<CustomMetDataTile> {
|
||||
return AlertDialog(
|
||||
title: Text(tr("settings.noteMetaData.customMetaData.title")),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(widget.value),
|
||||
child: Text(tr("settings.cancel")),
|
||||
),
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
var text = _textController.text.trim();
|
||||
var map = MarkdownYAMLCodec.parseYamlText(text);
|
||||
|
@ -45,7 +45,7 @@ class ListPreference extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
child: Text(tr('settings.cancel')),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
|
@ -95,7 +95,7 @@ class KeyEditor extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
OutlineButton(
|
||||
OutlinedButton(
|
||||
child: Text(tr("setup.keyEditors.load")),
|
||||
onPressed: _pickAndLoadFile,
|
||||
),
|
||||
|
@ -8,11 +8,11 @@ class NoteDeleteDialog extends StatelessWidget {
|
||||
return AlertDialog(
|
||||
title: Text(tr('widgets.NoteDeleteDialog.title')),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: Text(tr('widgets.NoteDeleteDialog.no')),
|
||||
),
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
child: Text(tr('widgets.NoteDeleteDialog.yes')),
|
||||
),
|
||||
|
@ -299,7 +299,7 @@ class PurchaseFailedDialog extends StatelessWidget {
|
||||
title: Text(tr('widgets.PurchaseWidget.failed')),
|
||||
content: Text(text),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
child: Text(tr('settings.ok')),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
@ -320,7 +320,7 @@ class _RestorePurchaseButtonState extends State<RestorePurchaseButton> {
|
||||
Widget build(BuildContext context) {
|
||||
var text = computing ? '...' : tr('purchase_screen.restore');
|
||||
|
||||
return OutlineButton(
|
||||
return OutlinedButton(
|
||||
child: Text(text),
|
||||
onPressed: () async {
|
||||
setState(() {
|
||||
|
@ -68,11 +68,11 @@ class _RenameDialogState extends State<RenameDialog> {
|
||||
return AlertDialog(
|
||||
title: Text(widget.dialogTitle),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: Text(tr('widgets.rename.no')),
|
||||
),
|
||||
FlatButton(
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
if (_formKey.currentState.validate()) {
|
||||
var newName = _textController.text;
|
||||
|
@ -43,14 +43,14 @@ class _SortingModeSelectorState extends State<SortingModeSelector> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
),
|
||||
actions: [
|
||||
OutlineButton(
|
||||
OutlinedButton(
|
||||
key: const ValueKey("Cancel"),
|
||||
child: Text(tr('settings.cancel')),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
OutlineButton(
|
||||
OutlinedButton(
|
||||
key: const ValueKey("Ok"),
|
||||
child: Text(tr('settings.ok')),
|
||||
onPressed: () {
|
||||
|
Reference in New Issue
Block a user