Skip to content

Commit fd28fd7

Browse files
authored
Merge pull request #30 from KaustubhBiswas/text_interpolation
Text interpolation implementation added.
2 parents 626d401 + b3d957f commit fd28fd7

File tree

3 files changed

+59
-2
lines changed

3 files changed

+59
-2
lines changed

lib/Screens/menuscreen.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class MenuScreen extends GetView<MyDrawerController> {
2424
"FlipCounter Animation",
2525
"Loading Animation",
2626
"Hero-Animation",
27-
"Colorize Text Animation"
27+
"Colorize Text Animation",
28+
"Text Interpolation",
2829
];
2930

3031
@override
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:flutter_animations/controllers/drawercontroller.dart';
3+
import 'package:flutter_animations/helpers/colors.dart';
4+
5+
class text_interpolation extends StatefulWidget {
6+
const text_interpolation({super.key});
7+
8+
@override
9+
State<text_interpolation> createState() => _text_interpolation();
10+
}
11+
12+
class _text_interpolation extends State<text_interpolation> {
13+
bool refresh = false;
14+
@override
15+
Widget build(BuildContext context) {
16+
return Scaffold(
17+
backgroundColor: mainpagecolor,
18+
appBar: AppBar(
19+
actions: [
20+
IconButton(onPressed: () {
21+
setState(() {
22+
refresh = !refresh;
23+
});
24+
}, icon: const Icon(Icons.refresh_rounded))
25+
],
26+
backgroundColor: mainpagecolor,
27+
title: const Text('Fade in / Fade out demo'),
28+
leading: IconButton(
29+
icon: const Icon(Icons.menu), // You can use any icon you prefer
30+
onPressed: () {
31+
MyDrawerController.to.toggleDrawer();
32+
MyDrawerController.to.update();
33+
},
34+
hoverColor: Colors.white,
35+
),
36+
elevation: 0,
37+
),
38+
body: Center(
39+
key: Key(refresh.toString()),
40+
child: TweenAnimationBuilder(
41+
tween: Tween<double>(begin: 1.0, end: 30.0),
42+
duration: const Duration(seconds: 2),
43+
builder: (BuildContext context, double value, Widget? child) {
44+
return Text('Text Interpolation',
45+
style:
46+
TextStyle(fontWeight: FontWeight.bold, fontSize: value));
47+
},
48+
),
49+
));
50+
}
51+
}

lib/controllers/drawercontroller.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ import 'package:flutter_animations/Screens/fade_in_fade_out.dart';
55
import 'package:flutter_animations/Screens/flip_counter.dart';
66
import 'package:flutter_animations/Screens/hero_animation/master_page.dart';
77
import 'package:flutter_animations/Screens/loading_animation.dart';
8-
import 'package:flutter_animations/Screens/water_drop_effect.dart';
98
import 'package:flutter_animations/Screens/ripple_animation.dart';
9+
import 'package:flutter_animations/Screens/text_interpolation.dart';
10+
import 'package:flutter_animations/Screens/water_drop_effect.dart';
1011
import 'package:flutter_animations/Text/tex_screen.dart';
1112
import 'package:flutter_animations/screens/bounce_animation.dart';
1213
import 'package:flutter_zoom_drawer/flutter_zoom_drawer.dart';
1314
import 'package:get/get.dart';
15+
1416
import '../Screens/animated_dialog.dart';
1517
import '../Screens/mainscreen.dart';
1618

@@ -33,6 +35,7 @@ class MyDrawerController extends GetxController {
3335
final mainScreen10 = loadingAnimation();
3436
final mainScreen11 = HeroAnimation();
3537
final mainScreen12 = colorize_text();
38+
final mainScreen13 = text_interpolation();
3639

3740
// Getter to get the current main screen based on the selectedMenuItem
3841
Widget get currentMainScreen {
@@ -61,6 +64,8 @@ class MyDrawerController extends GetxController {
6164
return mainScreen11;
6265
case 11:
6366
return mainScreen12;
67+
case 12:
68+
return mainScreen13;
6469

6570
default:
6671
return mainScreen1; // Default to mainScreen1 if the selection is not recognized

0 commit comments

Comments
 (0)