Я использую animate_do: ^3.1.2 и когда я использую Fadeinup в Textfield , например, анимация перезапускается, когда я пишу в одном, а затем в другом анимация перезапускает, однако текст, который я написал там, остается, следует отметить, что у меня есть точно такой же код в другом месте, и я не страдаю от той же проблемы. Код :
children: [
Column(
children: [
Text("Iniciar Sesión",
style: TextStyle(
fontSize: 30, fontWeight: FontWeight.bold)),
SizedBox(height: 2),
Text("Inicia sesión en tu cuenta",
style:
TextStyle(fontSize: 15, color: Colors.grey[700])),
],
),
FadeInUp(
delay: Duration(milliseconds: 100),
duration: Duration(milliseconds: 1500),
child: InputField(
maxLenght: 35,
labelText: "Email",
controller: _emailController,
icon: Iconsax.user,
hintText: "Correo electronico")),
FadeInUp(
delay: Duration(milliseconds: 100),
duration: Duration(milliseconds: 1500),
child: InputField(
isPassword: true,
maxLenght: 15,
controller: _passwordController,
labelText: "Password",
icon: Iconsax.key,
hintText: "Contraseña")),
FadeInUp(
delay: Duration(milliseconds: 100),
duration: Duration(milliseconds: 1500),
child: SubmitButton(
onPressed: _handleSubmit,
buttonText: "Iniciar Sesión")),
inputfieldwidget :
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class InputField extends StatelessWidget {
final String labelText;
final String hintText;
final int maxLenght;
final IconData? icon;
final double inputWidth;
final bool isPassword;
final TextEditingController? controller;
final List? inputFormatters;
final Function(String)? onChanged;
const InputField({
super.key,
required this.labelText,
this.hintText = "",
this.maxLenght = 20,
this.icon,
this.inputWidth = 0.9,
this.isPassword = false,
this.controller,
this.inputFormatters,
this.onChanged,
});
@override
Widget build(BuildContext context) {
return SizedBox(
width: MediaQuery.of(context).size.width *
inputWidth, // 90% del ancho de la pantalla (default)
child: TextField(
textCapitalization: TextCapitalization.sentences,
autocorrect: true,
enableSuggestions: true,
obscureText: isPassword,
maxLength: maxLenght,
controller: controller,
inputFormatters: inputFormatters,
onChanged: onChanged,
decoration: InputDecoration(
labelText: labelText,
hintText: hintText,
alignLabelWithHint: true,
labelStyle: TextStyle(
color: Colors.black,
fontSize: 14,
fontWeight: FontWeight.w400),
prefixIcon: icon != null
? Icon(
icon,
color: Colors.black,
size: 18,
)
: null,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: const Color.fromARGB(255, 224, 219, 219),
width: 2),
borderRadius: BorderRadius.circular(10)),
floatingLabelStyle:
TextStyle(color: Colors.black, fontSize: 18),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black, width: 1.5),
borderRadius: BorderRadius.circular(10)))));
}
}
Подробнее здесь: https://stackoverflow.com/questions/794 ... in-flutter
Анимация Fadeinup сбрасывается в трепетание ⇐ Android
Форум для тех, кто программирует под Android
-
Anonymous
1738874592
Anonymous
Я использую animate_do: ^3.1.2 и когда я использую Fadeinup в Textfield , например, анимация перезапускается, когда я пишу в одном, а затем в другом анимация перезапускает, однако текст, который я написал там, остается, следует отметить, что у меня есть точно такой же код в другом месте, и я не страдаю от той же проблемы. Код :
children: [
Column(
children: [
Text("Iniciar Sesión",
style: TextStyle(
fontSize: 30, fontWeight: FontWeight.bold)),
SizedBox(height: 2),
Text("Inicia sesión en tu cuenta",
style:
TextStyle(fontSize: 15, color: Colors.grey[700])),
],
),
FadeInUp(
delay: Duration(milliseconds: 100),
duration: Duration(milliseconds: 1500),
child: InputField(
maxLenght: 35,
labelText: "Email",
controller: _emailController,
icon: Iconsax.user,
hintText: "Correo electronico")),
FadeInUp(
delay: Duration(milliseconds: 100),
duration: Duration(milliseconds: 1500),
child: InputField(
isPassword: true,
maxLenght: 15,
controller: _passwordController,
labelText: "Password",
icon: Iconsax.key,
hintText: "Contraseña")),
FadeInUp(
delay: Duration(milliseconds: 100),
duration: Duration(milliseconds: 1500),
child: SubmitButton(
onPressed: _handleSubmit,
buttonText: "Iniciar Sesión")),
[b] inputfieldwidget [/b]:
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class InputField extends StatelessWidget {
final String labelText;
final String hintText;
final int maxLenght;
final IconData? icon;
final double inputWidth;
final bool isPassword;
final TextEditingController? controller;
final List? inputFormatters;
final Function(String)? onChanged;
const InputField({
super.key,
required this.labelText,
this.hintText = "",
this.maxLenght = 20,
this.icon,
this.inputWidth = 0.9,
this.isPassword = false,
this.controller,
this.inputFormatters,
this.onChanged,
});
@override
Widget build(BuildContext context) {
return SizedBox(
width: MediaQuery.of(context).size.width *
inputWidth, // 90% del ancho de la pantalla (default)
child: TextField(
textCapitalization: TextCapitalization.sentences,
autocorrect: true,
enableSuggestions: true,
obscureText: isPassword,
maxLength: maxLenght,
controller: controller,
inputFormatters: inputFormatters,
onChanged: onChanged,
decoration: InputDecoration(
labelText: labelText,
hintText: hintText,
alignLabelWithHint: true,
labelStyle: TextStyle(
color: Colors.black,
fontSize: 14,
fontWeight: FontWeight.w400),
prefixIcon: icon != null
? Icon(
icon,
color: Colors.black,
size: 18,
)
: null,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: const Color.fromARGB(255, 224, 219, 219),
width: 2),
borderRadius: BorderRadius.circular(10)),
floatingLabelStyle:
TextStyle(color: Colors.black, fontSize: 18),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black, width: 1.5),
borderRadius: BorderRadius.circular(10)))));
}
}
Подробнее здесь: [url]https://stackoverflow.com/questions/79415143/fadeinup-animation-resets-in-flutter[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия