aboutsummaryrefslogtreecommitdiff
path: root/lib/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'lib/widgets')
-rw-r--r--lib/widgets/input_box.dart36
-rw-r--r--lib/widgets/snackbar.dart19
2 files changed, 55 insertions, 0 deletions
diff --git a/lib/widgets/input_box.dart b/lib/widgets/input_box.dart
new file mode 100644
index 0000000..c035635
--- /dev/null
+++ b/lib/widgets/input_box.dart
@@ -0,0 +1,36 @@
+import 'package:flutter/material.dart';
+
+class FormInputBox extends StatefulWidget {
+ const FormInputBox({
+ super.key,
+ //this.textInputType,
+ required this.controller,
+ this.hintText = "",
+ this.obscureText = false,
+ });
+
+ //final TextInputType textInputType;
+ final String hintText;
+ final TextEditingController controller;
+ final bool obscureText;
+
+ @override
+ FormInputBoxState createState() => FormInputBoxState();
+}
+
+class FormInputBoxState extends State<FormInputBox> {
+ @override
+ Widget build(BuildContext context) {
+ return Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 14),
+ child: TextFormField(
+ obscureText: widget.obscureText,
+ controller: widget.controller,
+ decoration: InputDecoration(
+ border: const OutlineInputBorder(),
+ hintText: widget.hintText,
+ ),
+ ),
+ );
+ }
+} \ No newline at end of file
diff --git a/lib/widgets/snackbar.dart b/lib/widgets/snackbar.dart
new file mode 100644
index 0000000..8da41a1
--- /dev/null
+++ b/lib/widgets/snackbar.dart
@@ -0,0 +1,19 @@
+import 'package:flutter/material.dart';
+
+class MySnackBar {
+ final String message;
+
+ const MySnackBar({
+ required this.message,
+ });
+
+ static show(BuildContext context, String message) {
+ ScaffoldMessenger.of(context).showSnackBar(
+ SnackBar(
+ content: Text(message),
+ behavior: SnackBarBehavior.floating,
+ width: 400.0,
+ ),
+ );
+ }
+} \ No newline at end of file