Code Monkey home page Code Monkey logo

flutter-spring-button's People

Contributors

aliyigitbireroglu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

flutter-spring-button's Issues

Change duration

Hi, how can I change the duration of the animation please?

Add possibility to specify scale

Right now, a SpringButton will scale to a predefined value when being pressed on. It would be great if we could specify a scale of our own.

NULL SAFETY

Hello
Any plans to migrate to null safety?

Can't change the Spring button color

Can't change the Spring button color dynamically,
if i have some color intiallly and want to change later with setState, it doesn't reflect to the button child: SpringButton(

Source Code:

  SpringButton(  
    SpringButtonType.OnlyScale,
    Container(
      height: ScreenUtil.getInstance().setHeight(50),
      width: MediaQuery.of(context).size.width * 0.78,
      decoration:BoxDecoration(
        shape: BoxShape.rectangle,
        color: dynamicButtonColor,
        borderRadius: BorderRadius.circular(5.0),
      ) ,
      child: Center(
        child: Text(
         "ABC",
          style: GoogleFonts.openSans(
            fontWeight: FontWeight.w600,
            fontSize: ScreenUtil(allowFontScaling: true).setSp(14),
            color: AppColors.whiteText,
          ),
          textScaleFactor: 1.0,
        ),
      ),
    ),
    onTapDown: (_) => {
  

    },
  )

)

Data not being updated in stateful widget.

first of all Thanks for the great Library
when trying to change its data after button pressed nothing happens in the UI. onPress() works correctly and changes the data I want (I can see it is changed using print()) but in the UI the button stays the same as it was since the beginning. or maybe im not using the library properly...

heres the code:


                              ...options.map((option) =>
                                  SpringButton(
                                    SpringButtonType.WithOpacity,
                                    Padding(
                                      padding: EdgeInsets.symmetric(vertical: 4.0, horizontal: 30.0),
                                      child: Container(
                                        height: 40.0,
                                        width: clickedOption,
                                        decoration: BoxDecoration(
                                          color: btnColor,
                                          borderRadius: const BorderRadius.all(const Radius.circular(30.0)),
                                          boxShadow: [
                                            BoxShadow(
                                              color: Color(0x80000000),
                                              blurRadius: 10.0,
                                              offset: Offset(0.0, 5.0),
                                            ),
                                          ],
                                        ),
                                        child: Center(
                                          child: Text(option,
                                            style: TextStyle(
                                                fontSize: 18.0,
                                                fontWeight: FontWeight.bold,
                                                color: Colors.white),
                                          ),
                                        ),
                                      ),
                                    ),
                                    onTapDown: (_) {
                                      setState(() {
                                        _answers[_currentIndex] = option;
                                        print(_answers[_currentIndex]);
                                        btnColor = Colors.yellowAccent;
                                        print(option);
                                      });
                                    },
//                                            onLongPress: () ,
                                    onLongPressEnd: (_) {
                                      setState(() {
                                        _answers[_currentIndex] = option;
                                        print(_answers[_currentIndex]);
                                        print(option);
                                      });
                                      },
                                  ),
                              ),

the options is the data coming from the database and after each click should change but what happens is that data updates in options but nothing happens in UI.

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.