How do I add a tap gesture to a SwiftUI button?

I’m new to SwiftUI and trying to set a specific font size for the text in a TextField. I’ve tried using the font() modifier, but it doesn’t seem to be working. Here is the relevant code: … TextField("Enter your name", text: $name) .font(.system(size: 16)) .padding() .background(Color.gray.opacity(0.2)) .cornerRadius(8) … I’ve also tried setting the font size… Read More How do I add a tap gesture to a SwiftUI button?

Add or remove specific borders of a Textfield

I want to remove the topBorder and keep the rest of the borders (leftBorder, rightBorder, bottomBorder) for a Textfield. Is there any way to do this? If it’s not possible for Textfield then is it possible for TextFormField or any other similar widget? TextField used :- TextField( decoration: InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: primaryColor)), border:… Read More Add or remove specific borders of a Textfield

Reusable TextField doesn't send data Flutter

I have a custom textField like this : import ‘package:flutter/material.dart’; import ‘package:sizer/sizer.dart’; class CustomTextField extends StatefulWidget { TextEditingController controller; String label; String textValue; int maxLines; TextInputType keybordType; CustomTextField( {Key? key, required this.controller, required this.textValue, required this.label, this.maxLines = 1, this.keybordType = TextInputType.text}) : super(key: key); @override State<CustomTextField> createState() => _CustomTextFieldState(); } class _CustomTextFieldState extends State<CustomTextField>… Read More Reusable TextField doesn't send data Flutter

Custom text input formatting on TextField not working

Any sort of custom TextInputFormatter is not working. Whenever I specify one, the TextField stops taking input. class LowerCaseFormatter extends TextInputFormatter { @override TextEditingValue formatEditUpdate( TextEditingValue oldValue, TextEditingValue newValue) { return oldValue; } } @override Widget build(BuildContext context) { return Scaffold( body: Center( child: Column( children: [ TextField( controller: _inputController, inputFormatters: [ LowerCaseFormatter() ], ),… Read More Custom text input formatting on TextField not working

how to remove error text below my textfield in flutter

hey i am trying to remove the error this condition is working for me to remove the error but it does not change border color border color still remain same means border color remain red so how to change the border color to normal color TextField( controller: userName, onChanged: (value){}, decoration: InputDecoration( hintText: "Email", errorText:… Read More how to remove error text below my textfield in flutter

I can't get product vendor id in django

I am working on an e-commerce project. But the product vendor id is not registered in the database. I’ve tried many ways. I would be glad if you help. seller_id always comes empty What are your suggestions? models.py class Product(models.Model): name = models.CharField(verbose_name="Məhsulun adı", max_length=150) description = models.TextField( verbose_name="Məhsul haqda məlumat", null=True) price = models.FloatField(verbose_name="Məhsulun… Read More I can't get product vendor id in django