aliyigitbireroglu / flutter-spring-button Goto Github PK
View Code? Open in Web Editor NEWA simple widget for having UI elements that respond to taps with a spring animation.
License: MIT License
A simple widget for having UI elements that respond to taps with a spring animation.
License: MIT License
Hi, how can I change the duration of the animation please?
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.
Hello
Any plans to migrate to null safety?
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: (_) => {
},
)
)
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.