35 lines
1.2 KiB
Dart
35 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:gap/gap.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
class InputWidget extends StatelessWidget {
|
|
final String label;
|
|
final TextEditingController controller;
|
|
final bool? password;
|
|
|
|
const InputWidget({super.key, required this.label, required this.controller, this.password});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text('$label:',
|
|
style: GoogleFonts.outfit(
|
|
textStyle: const TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500),
|
|
)),
|
|
const Gap(8),
|
|
TextField(
|
|
controller: controller,
|
|
decoration: InputDecoration(
|
|
filled: true, // Enable filling the background
|
|
fillColor: Colors.white,
|
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
|
|
contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 24)),
|
|
style: GoogleFonts.outfit(textStyle: TextStyle(color: const Color.fromRGBO(0, 0, 0, 1), fontSize: 16)),
|
|
obscureText: password ?? false,
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|