Skip to content

Instantly share code, notes, and snippets.

View hemilpanchiwala's full-sized avatar
😊

Hemil Panchiwala hemilpanchiwala

😊
View GitHub Profile
class WavePainter extends CustomPainter {
Animation<double> waveAnimation;
double percentValue;
double boxHeight;
Color waveColor;
WavePainter(
{this.waveAnimation, this.percentValue, this.boxHeight, this.waveColor});
@override
@override
Widget build(BuildContext context) {
return Stack(
children: <Widget>[
SizedBox(
height: _boxHeight,
width: _boxWidth ?? MediaQuery.of(context).size.width,
child: AnimatedBuilder(
animation: _waveController,
builder: (BuildContext context, Widget child) {
@override
void initState() {
super.initState();
_textKey = GlobalKey();
_boxHeight = widget.boxHeight ?? 250;
_boxWidth = widget.boxWidth ?? 400;
class _TextLiquidFillState extends State<TextLiquidFill>
with TickerProviderStateMixin {
AnimationController _waveController, _loadController;
Duration _waveDuration, _loadDuration;
Animation _loadValue;
double _boxHeight, _boxWidth;
Color _boxBackgroundColor, _waveColor;
class TextLiquidFill extends StatefulWidget {
final TextStyle textStyle;
final Duration loadDuration;
final Duration waveDuration;
final double boxHeight;
final double boxWidth;
final String text;
final Color boxBackgroundColor;
final Color waveColor;
import 'package:flutter/material.dart';
import 'dart:math';
@hemilpanchiwala
hemilpanchiwala / typewriter_test.dart
Created December 22, 2019 06:47
Test file for Typewriter class
import 'package:flutter/material.dart';
import 'package:animated_text_kit/src/typewriter.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('TypewriterAnimatedTextKit', () {
testWidgets('animation works', (WidgetTester tester) async {
await tester.pumpWidget(createMaterialApp(TypewriterAnimatedTextKit(
@override
Widget build(BuildContext context) {
return Container(
color: Colors.black54,
child: Column(
children: <Widget>[
smoothSort,
RaisedButton(
child: Text("Sort By Price"),
onPressed: () {
@override
void initState() {
super.initState();
smoothSort = SmoothSort(
listType: 'grid',
itemList: [
Container(
color: Colors.white,
margin: EdgeInsets.fromLTRB(1.0, 1.0, 1.0, 1.0),