Restructure some things
This commit is contained in:
parent
99f15fda36
commit
d4bbca6405
9 changed files with 174 additions and 81 deletions
58
lib/tests/prompt.dart
Normal file
58
lib/tests/prompt.dart
Normal file
|
@ -0,0 +1,58 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:libacflutter/Alert.dart';
|
||||
import 'package:libacflutter/Constants.dart';
|
||||
import 'package:libacflutter/Prompt.dart';
|
||||
|
||||
class TestPrompt extends StatefulWidget {
|
||||
const TestPrompt({super.key});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
return TestPromptState();
|
||||
}
|
||||
}
|
||||
|
||||
class TestPromptState extends State<TestPrompt> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Input Prompt Test"),
|
||||
backgroundColor: LibACFlutterConstants.TITLEBAR_COLOR,
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
var reply = await showAdaptiveDialog(
|
||||
context: context,
|
||||
builder: (buildx) {
|
||||
return InputPrompt(
|
||||
title: "Test",
|
||||
prompt: "Enter a value",
|
||||
currentValue: "",
|
||||
type: InputPromptType.Text,
|
||||
);
|
||||
});
|
||||
|
||||
// Show a alert dialog with the reply content
|
||||
showAdaptiveDialog(
|
||||
context: context,
|
||||
builder: (buildx) {
|
||||
return Alert(
|
||||
title: "Test Result",
|
||||
body: reply,
|
||||
dismissAction: () {
|
||||
exit(0);
|
||||
},
|
||||
);
|
||||
});
|
||||
},
|
||||
child: Text("Show prompt"))
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue