diff --git a/lib/Constants.dart b/lib/Constants.dart index b192c08..2c2bc7e 100644 --- a/lib/Constants.dart +++ b/lib/Constants.dart @@ -2,5 +2,5 @@ import 'package:flutter/material.dart'; class LibACFlutterConstants { static const Color TITLEBAR_COLOR = Color.fromARGB(255, 99, 0, 0); - static const VERSION = "1.0.013125+0327"; + static const VERSION = "1.0.013125+0358"; } diff --git a/lib/Prompt.dart b/lib/Prompt.dart index 0361db6..9f0534c 100644 --- a/lib/Prompt.dart +++ b/lib/Prompt.dart @@ -1,21 +1,25 @@ import 'package:flutter/material.dart'; -/// +enum InputPromptType { Text, Number } + +/// Prompt which enables the input of data class InputPrompt extends StatefulWidget { String title; String prompt; String currentValue; + InputPromptType type; InputPrompt( {super.key, required this.title, required this.prompt, - required this.currentValue}); + required this.currentValue, + required this.type}); @override State createState() { return InputPromptState( - title: title, prompt: prompt, currentValue: currentValue); + title: title, prompt: prompt, currentValue: currentValue, type: type); } } @@ -23,10 +27,14 @@ class InputPromptState extends State { String title; String prompt; String currentValue; + InputPromptType type; TextEditingController textField = TextEditingController(); InputPromptState( - {required this.title, required this.prompt, required this.currentValue}) { + {required this.title, + required this.prompt, + required this.currentValue, + required this.type}) { textField.text = currentValue; } @@ -40,9 +48,15 @@ class InputPromptState extends State { child: Column( children: [ Text(prompt), - TextField( - controller: textField, - ) + if (type == InputPromptType.Text) + TextField( + controller: textField, + ), + if (type == InputPromptType.Number) + TextField( + controller: textField, + keyboardType: TextInputType.number, + ) ], ), ), diff --git a/pubspec.yaml b/pubspec.yaml index 05966ce..a4d54bf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: libacflutter description: "A new Flutter package project." -version: 1.0.013125+0327 +version: 1.0.013125+0358 homepage: https://zontreck.com publish_to: https://git.zontreck.com/api/packages/AriasCreations/pub diff --git a/test/testPrompt.dart b/test/testPrompt.dart index 5b6d789..c128c8b 100644 --- a/test/testPrompt.dart +++ b/test/testPrompt.dart @@ -51,6 +51,7 @@ class TestPromptState extends State { title: "Test", prompt: "Enter a value", currentValue: "", + type: InputPromptType.Text, ); });