Code Monkey home page Code Monkey logo

Comments (6)

letsar avatar letsar commented on May 23, 2024 1

Hi @recepbuyukfirat, sorry but I cannot run the code you provided. It's not independent of the rest of your code.
Can you please, write a sample that I could simply copy and paste in a file and run it?

from flutter_slidable.

recepbuyukfirat avatar recepbuyukfirat commented on May 23, 2024

and this out put
AnimationController.stop (package:flutter/src/animation/animation_controller.dart:499:13

from flutter_slidable.

letsar avatar letsar commented on May 23, 2024

Hi @recepbuyukfirat, can you paste the minimal code to reproduce this issue?

from flutter_slidable.

recepbuyukfirat avatar recepbuyukfirat commented on May 23, 2024

Sory. i could not answer because i had another jops. write my flutter_slidable code the following:

               ` return new Slidable(`
                     ` key: new Key(_messages[index].toString()),`
                     ` controller: slidableController,`
                      `direction:Axis.horizontal,`
                      `delegate: _getDelegate(item.id),`
                      `actionExtentRatio: 0.25,`
                      `child: new Column(`
                        `crossAxisAlignment: isReceived`
                            `? CrossAxisAlignment.start`
                            `: CrossAxisAlignment.end,`
                        `mainAxisAlignment: isReceived`
                            `? MainAxisAlignment.start`
                            `: MainAxisAlignment.end,`
                       ` children: <Widget>[`
                          `new Container(`
                            `margin: isReceived ? new EdgeInsets.only(`
                                `left: 10.0, right: MediaQuery`
                                `.of(context)`
                                `.size`
                                `.width / 4, top: 5.0, bottom: 5.0) :`
                            `new EdgeInsets.only(left: MediaQuery`
                                `.of(context)`
                                `.size`
                                `.width / 4, right: 10.0, top: 5.0, bottom: 5.0),`
                           ` padding: new EdgeInsets.only(`
                                `left: 20.0, right: 20.0, top: 10.0, bottom: 10.0),`
                            `decoration: new BoxDecoration(`
                              `color: Colors.grey.withOpacity(0.1),`
                              `borderRadius: BorderRadius.circular(10.0),`
                            `),`
                            `child: new Column(`
                              `crossAxisAlignment: CrossAxisAlignment.start,`
                              `children: <Widget>[`
                                `new Text(isReceived ? senderName : "Siz", style: TextStyle(`
                                    `color: isReceived ? Colors.red : Colors.green),),`
                                `new Text(content, style: TextStyle(color: Colors.white),),`
                               ` SizedBox(height: 6.0,),`
                                `new Text(`
                                  `date.toString().substring(0, 16),`
                                  `style: TextStyle(color: Colors.grey, fontSize: 12.0),`
                                  `textAlign: TextAlign.end,`
                           ```
 ),
                              ],
                            ),
                          ),
                        ],
                      ),
                          `actions: <Widget>[`
                            `new IconSlideAction(`
                          ```
    caption: 'Delete',
                              color: Colors.red,
                          ```

icon: Icons.delete,
onTap: () => deleteMessage(),
),
],

                         ```
 secondaryActions: <Widget>[
                            new IconSlideAction(
                              caption: 'Delete',
                              color: Colors.red,
                              icon: Icons.delete,
                              onTap: () => deleteMessage(),
                            ),
                          ],
                        );

from flutter_slidable.

recepbuyukfirat avatar recepbuyukfirat commented on May 23, 2024

I think this problem is caused by the change of APIs, so tanks for your interest

from flutter_slidable.

matiasfdevecchi avatar matiasfdevecchi commented on May 23, 2024

Hi, I had the same error. In my case, the problem wasn't the TextFormField. It was because of the key inside the Form widget. If you use a key, the general widget must be StatefulWidget, not StatelessWidget.

Wrong code

    class MyWidget extends StatelessWidget{
      final GlobalKey<FormState> _formKey = GlobalKey<FormState>(); 
      @override
      Widget build(BuildContext context) {
        // TODO: implement build
        return Scaffold(
          body: Form(
            key: _formKey,
            child: TextFormField(),
          ),
        );
      }
    }

Right Code

class MyWidget extends StatefulWidget{
      @override
      State<StatefulWidget> createState() {
        // TODO: implement createState
        return _MyWidgetState();
      }
    }
    
    class _MyWidgetState extends State<MyWidget>{
      final GlobalKey<FormState> _formKey = GlobalKey<FormState>(); 
      @override
      Widget build(BuildContext context) {
        // TODO: implement build
        return Scaffold(
          body: Form(
            key: _formKey,
            child: TextFormField(),
          ),
        );
      }
    }

from flutter_slidable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.