Skip to content

A pub package helps you to make nice bouncing illustration on flutter web at an hover .

License

Notifications You must be signed in to change notification settings

iamabhishek229313/bouncing_character

Repository files navigation

bouncing_character

pub package

A flutter plugin to make elegant illustration of bouncing character on flutter web

README

Github: https://github.com/iamabhishek229313/bouncing_character

Update log

Usage:

Add dependency:

Please check the latest version before installation.

dependencies:
  flutter:
    sdk: flutter
  # add bouncing_character
  bouncing_character: ^1.0.0

Add the following imports to your Dart code:

import 'package:bouncing_character/bouncing_character.dart';

API

Too simple example

    Container(
        width : 600.0,
        height : 300.0,
        child : BouncingCharacter(
            text : "I'm a developer" , // it is @required
            duration : Duration(milliseconds : 200) , // it's too
        )       
    )

All functionaries

    
  // Initializing some custom attributes .
  const BgColor = Color.fromRGBO(27, 26, 31, 1.0);
  const TextStyle customStyle = TextStyle(fontSize: 44.0, fontFamily: 'BioRhyme', color: Colors.grey);
  const Duration customDuration = Duration(milliseconds: 200);
  Matrix4 customTransform = Matrix4.identity()..translate(0, -10, 0);   
  
   BouncingCharacter(
        text: "I'm a developer",
        duration: customDuration,
        style: customStyle,
        onHoverTranslate: customTransform,
    )

##Example main.dart

import 'package:bouncing_character_example/home_page.dart';
import 'package:flutter/material.dart';
import 'package:bouncing_character/bouncing_character.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: HomePage()
    );
  }
}

home_page.dart

import 'package:bouncing_character/bouncing_character.dart';
import 'package:flutter/material.dart';

// Initializing some custom attributes .

const BgColor = Color.fromRGBO(27, 26, 31, 1.0);
const TextStyle customStyle = TextStyle(fontSize: 44.0, fontFamily: 'BioRhyme', color: Colors.grey);
const Duration customDuration = Duration(milliseconds: 200);
Matrix4 customTransform = Matrix4.identity()..translate(0, -10, 0);


class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: BgColor,
        body: Center(
            child: BouncingCharacter(
              text: "I'm an developer",
              duration: customDuration,
              style: customStyle,
              onHoverTranslate: customTransform,
            )));
  }
}
To give you an idea ...

Created and Maintained by.

Abhishek Kumar

About

A pub package helps you to make nice bouncing illustration on flutter web at an hover .

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published