Skip to content

Commit 626d401

Browse files
authored
Merge pull request #28 from technoxx/added-colorize-text-animation
Added new Animation: Colorized text
2 parents c08245d + 894b062 commit 626d401

File tree

5 files changed

+97
-28
lines changed

5 files changed

+97
-28
lines changed

lib/Screens/colorize_text.dart

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import 'package:animated_text_kit/animated_text_kit.dart';
2+
import 'package:flutter/material.dart';
3+
import 'package:flutter_animations/helpers/colors.dart';
4+
import 'package:google_fonts/google_fonts.dart';
5+
import '../controllers/drawercontroller.dart';
6+
7+
class colorize_text extends StatefulWidget {
8+
const colorize_text({super.key});
9+
10+
@override
11+
State<colorize_text> createState() => _colorize_text();
12+
}
13+
14+
// The State class is responsible for two things: holding some data you can
15+
// update and building the UI using that data.
16+
class _colorize_text extends State<colorize_text> {
17+
// Whether the green box should be visible
18+
bool _visible = true;
19+
@override
20+
Widget build(BuildContext context) {
21+
return Scaffold(
22+
backgroundColor: mainpagecolor,
23+
appBar: AppBar(
24+
backgroundColor: mainpagecolor,
25+
title: const Text('Fade in / Fade out demo'),
26+
leading: IconButton(
27+
icon: const Icon(Icons.menu), // You can use any icon you prefer
28+
onPressed: () {
29+
MyDrawerController.to.toggleDrawer();
30+
MyDrawerController.to.update();
31+
},
32+
hoverColor: Colors.white,
33+
),
34+
elevation: 0,
35+
),
36+
body: Center(
37+
child: AnimatedTextKit(
38+
repeatForever: true,
39+
animatedTexts: [
40+
ColorizeAnimatedText(
41+
'Hello Aliens!',
42+
textStyle: GoogleFonts.cabin(
43+
color: const Color.fromARGB(255, 174, 176, 229),
44+
fontSize: 50,
45+
fontWeight: FontWeight.bold),
46+
colors: [
47+
Colors.red,
48+
Colors.yellow,
49+
Colors.blue,
50+
Colors.teal,
51+
],
52+
),
53+
],
54+
),
55+
),
56+
floatingActionButton: FloatingActionButton(
57+
onPressed: () {
58+
// Call setState. This tells Flutter to rebuild the
59+
// UI with the changes.
60+
setState(() {
61+
_visible = !_visible;
62+
});
63+
},
64+
tooltip: 'Toggle Opacity',
65+
child: const Icon(Icons.flip),
66+
),
67+
);
68+
}
69+
}

lib/Screens/menuscreen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class MenuScreen extends GetView<MyDrawerController> {
2424
"FlipCounter Animation",
2525
"Loading Animation",
2626
"Hero-Animation",
27-
27+
"Colorize Text Animation"
2828
];
2929

3030
@override

lib/controllers/drawercontroller.dart

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:flutter/widgets.dart';
2+
import 'package:flutter_animations/Screens/colorize_text.dart';
23
import 'package:flutter_animations/Screens/explicit_animation.dart';
34
import 'package:flutter_animations/Screens/fade_in_fade_out.dart';
45
import 'package:flutter_animations/Screens/flip_counter.dart';
@@ -29,8 +30,9 @@ class MyDrawerController extends GetxController {
2930
final mainScreen7 = ExplicitAnimations();
3031
final mainScreen8 = AnimatedDialog();
3132
final mainScreen9 = flip();
32-
final mainScreen10=loadingAnimation();
33+
final mainScreen10 = loadingAnimation();
3334
final mainScreen11 = HeroAnimation();
35+
final mainScreen12 = colorize_text();
3436

3537
// Getter to get the current main screen based on the selectedMenuItem
3638
Widget get currentMainScreen {
@@ -45,18 +47,20 @@ class MyDrawerController extends GetxController {
4547
return mainScreen4;
4648
case 4:
4749
return mainScreen5;
48-
case 5 :
49-
return mainScreen6 ;
50-
case 6 :
51-
return mainScreen7 ;
52-
case 7 :
53-
return mainScreen8 ;
54-
case 8 :
55-
return mainScreen9;
56-
case 9 :
57-
return mainScreen10 ;
58-
case 10 :
59-
return mainScreen11 ;
50+
case 5:
51+
return mainScreen6;
52+
case 6:
53+
return mainScreen7;
54+
case 7:
55+
return mainScreen8;
56+
case 8:
57+
return mainScreen9;
58+
case 9:
59+
return mainScreen10;
60+
case 10:
61+
return mainScreen11;
62+
case 11:
63+
return mainScreen12;
6064

6165
default:
6266
return mainScreen1; // Default to mainScreen1 if the selection is not recognized

macos/Flutter/GeneratedPluginRegistrant.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import FlutterMacOS
66
import Foundation
77

8+
import path_provider_foundation
89

910
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
11+
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
1012
}

pubspec.yaml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,16 @@ environment:
2828
# the latest version available on pub.dev. To see which dependencies have newer
2929
# versions available, run `flutter pub outdated`.
3030
dependencies:
31+
animated_flip_counter: ^0.2.6
32+
animated_text_kit: ^4.2.2
33+
cupertino_icons: ^1.0.2
3134
flutter:
3235
sdk: flutter
33-
34-
35-
# The following adds the Cupertino Icons font to your application.
36-
# Use with the CupertinoIcons class for iOS style icons.
37-
cupertino_icons: ^1.0.2
36+
google_fonts: ^6.1.0
3837
lottie: ^2.6.0
3938
vector_math: ^2.1.4
40-
animated_flip_counter: ^0.2.6
4139

4240
dev_dependencies:
43-
flutter_test:
44-
sdk: flutter
45-
flutter_zoom_drawer: ^3.1.1
46-
get: ^4.6.6
4741
flutter_launcher_icons: "^0.13.1"
4842

4943
# The "flutter_lints" package below contains a set of recommended lints to
@@ -52,6 +46,10 @@ dev_dependencies:
5246
# package. See that file for information about deactivating specific lint
5347
# rules and activating additional ones.
5448
flutter_lints: ^2.0.0
49+
flutter_test:
50+
sdk: flutter
51+
flutter_zoom_drawer: ^3.1.1
52+
get: ^4.6.6
5553

5654
flutter_icons:
5755
android: "launcher_icon"
@@ -60,7 +58,6 @@ flutter_icons:
6058

6159
# For information on the generic Dart part of this file, see the
6260
# following page: https://dart.dev/tools/pub/pubspec
63-
6461
# The following section is specific to Flutter packages.
6562
flutter:
6663

@@ -75,13 +72,10 @@ flutter:
7572
- assets/icons/flutter_animations_icon.png
7673
# - images/a_dot_burr.jpeg
7774
# - images/a_dot_ham.jpeg
78-
7975
# An image asset can refer to one or more resolution-specific "variants", see
8076
# https://flutter.dev/assets-and-images/#resolution-aware
81-
8277
# For details regarding adding assets from package dependencies, see
8378
# https://flutter.dev/assets-and-images/#from-packages
84-
8579
# To add custom fonts to your application, add a fonts section here,
8680
# in this "flutter" section. Each entry in this list should have a
8781
# "family" key with the font family name, and a "fonts" key with a

0 commit comments

Comments
 (0)