Animated Default text style for flutter.
AnimatedDefaultTextStyle(
duration: const Duration(milliseconds: 300),
style: TextStyle(
fontSize: 25, //Set Your Value
color: Colors.blue, // Set Your Color
fontWeight:FontWeight.bold, // Set your Value
),
child: Text('Animated'),
),
Flutter Text Animation:-
AnimatedDefalutTextStyle() Code Example:
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
bool _myFirst = true;
double _myFontSize = 60;
Color _myColor = Colors.blue;
FontWeight _myfontWeight = FontWeight.bold;
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: ""MyTestApp"",
home: Scaffold(
body: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: 120,
child: AnimatedDefaultTextStyle(
duration: const Duration(milliseconds: 300),
style: TextStyle(
fontSize: _myFontSize,
color: _myColor,
fontWeight: _myfontWeight,
),
child: Text('Animated'),
),
),
FlatButton(
onPressed: () {
setState(() {
_myFontSize = _myFirst ? 70 : 50;
_myColor = _myFirst ? Colors.blue : Colors.red;
_myfontWeight = _myFirst ? FontWeight.bold : FontWeight.w100;
_myFirst = !_myFirst;
});
},
child: Text(
""SHOW!"",
),
)
],
),
),
)
);
}
}
Text Animation:
Flutter Animation Code Example:
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
bool _myFirst = true;
double _myFontSize = 60;
Color _myColor = Colors.blue;
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: ""MyTestApp"",
home: Scaffold(
body: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: 120,
child: AnimatedDefaultTextStyle(
duration: const Duration(milliseconds: 300),
style: TextStyle(
fontSize: _myFontSize,
color: _myColor,
fontWeight: _myfontWeight,
),
child: Text('Animated'),
),
),
FlatButton(
onPressed: () {
setState(() {
_myFontSize = _myFirst ? 70 : 50;
_myColor = _myFirst ? Colors.blue : Colors.red;
_myFirst = !_myFirst;
});
},
child: Text(
""SHOW!"",
),
)
],
),
),
)
);
}
}
- Boost WooCommerce Security: Set Up OTP Login in WordPressPasswords, while essential for security, can be vulnerable to hacking and breaches. To add an extra layer of protection for your WooCommerce store, consider implementing …
- How to Create Woocommerce Flutter App for WordPress freeAbsolutely! Let’s break down how to create a WooCommerce Flutter app for your WordPress store. Here’s a comprehensive outline of the process and essential considerations: …
- How to Add a Link to Your Facebook Story in 2024Facebook Stories have become an integral part of our social media experience, allowing us to share moments and updates with our friends and followers. But …
- Troubleshooting “Failed to download Laravel from dist” ErrorIf you encounter the “Failed to download Laravel from dist” error while working with Laravel 10, it is likely due to the absence of the …
- Solutions for “The file is too large for the destination file system” Error on PendriveIf you have ever encountered the frustrating error message “The file is too large for the destination file system” when trying to transfer files to …