-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
4 changed files
with
90 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
lib/ui/screens/chat_room/controls/chat_components/point_blink.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class PointBlink extends StatefulWidget { | ||
const PointBlink({super.key}); | ||
|
||
@override | ||
State<PointBlink> createState() => _PointBlinkState(); | ||
} | ||
|
||
class _PointBlinkState extends State<PointBlink> | ||
with SingleTickerProviderStateMixin<PointBlink> { | ||
late AnimationController controller; | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
controller = AnimationController( | ||
vsync: this, | ||
duration: const Duration(seconds: 1), | ||
); | ||
controller.forward(); | ||
controller.repeat(); | ||
} | ||
|
||
@override | ||
void dispose() { | ||
controller.dispose(); | ||
super.dispose(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return AnimatedBuilder( | ||
animation: controller, | ||
builder: (context, child) { | ||
return Container( | ||
width: 20 * controller.value, | ||
height: 20, | ||
decoration: const BoxDecoration( | ||
color: Colors.greenAccent, | ||
), | ||
); | ||
}, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters