Hooks up rename prompt
This commit is contained in:
parent
2bc99f6bd9
commit
dc6dffc3ba
4 changed files with 121 additions and 3 deletions
42
lib/pages/RenamePrompt.dart
Normal file
42
lib/pages/RenamePrompt.dart
Normal file
|
@ -0,0 +1,42 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class RenamePrompt extends StatefulWidget {
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
return RenameState();
|
||||
}
|
||||
}
|
||||
|
||||
class RenameState extends State<RenamePrompt> {
|
||||
TextEditingController name = TextEditingController();
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
var args = ModalRoute.of(context)!.settings.arguments as String;
|
||||
|
||||
name.text = args;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AlertDialog(
|
||||
icon: Icon(Icons.edit_attributes),
|
||||
title: Text("Edit Tag Name"),
|
||||
actions: [
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context, name.text);
|
||||
},
|
||||
child: Text("SUBMIT")),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: const Text("CANCEL"),
|
||||
)
|
||||
],
|
||||
content: TextField(
|
||||
controller: name,
|
||||
));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue