adar2378 / pin_code_fields

A flutter package which will help you to generate pin code fields with beautiful design and animations. Can be useful for OTP or pin code inputs 🤓🤓
https://pub.dev/packages/pin_code_fields
MIT License
699 stars 340 forks source link

Performance Issue: (Unnecessary widget builds 'rendering a lot of frames') despite disabling all Animations. #254

Closed xSuperMu closed 2 years ago

xSuperMu commented 2 years ago

https://user-images.githubusercontent.com/17935590/167401566-dee9afc4-348f-47fc-907e-bdd43e8c3c0c.mov

Here is the code:

import 'package:flutter/material.dart';
import 'package:pin_code_fields/pin_code_fields.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: PinCodeTextField(
          appContext: context,
          length: 4,
          mainAxisAlignment: MainAxisAlignment.spaceAround,
          pinTheme: PinTheme(
            shape: PinCodeFieldShape.box,
            borderRadius: BorderRadius.circular(5),
          ),
          beforeTextPaste: (_) => false,
          animationType: AnimationType.none,
          enablePinAutofill: false,
          autovalidateMode: AutovalidateMode.disabled,
          enableActiveFill: false,
          keyboardType: TextInputType.text,
          onChanged: (String value) {},
        ),
      ),
    );
  }
}
mo15hammed commented 2 years ago

I am facing the same issue 😢

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

fahami commented 2 years ago

same here