Skip to content

Instantly share code, notes, and snippets.

View vijayinyoutube's full-sized avatar
👋
vijaycreations

Vijay R vijayinyoutube

👋
vijaycreations
View GitHub Profile
void initState() {
_controller = AnimationController(
duration: Duration(seconds: 3),
vsync: this,
lowerBound: 1,
upperBound: 40,
)..repeat(reverse: true);
super.initState();
}
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Flexible(
child: Container(
alignment: Alignment.centerRight,
color: Colors.red,
width: MediaQuery.of(context).size.width,
height: 50,
class AnimateOffer extends AnimatedWidget {
const AnimateOffer({size}) : super(listenable: size);
Animation<double> get _size => listenable;
[...]
[...]
[...]
Widget build(BuildContext context) {
return Scaffold(
body: ClipPath(
clipper: MyClipper(),
[...]
[...]
[...]
class MyClipper extends CustomClipper<Path> {
@override
Path getClip(Size size) {
var path = Path();
path.lineTo(0, size.height);
path.quadraticBezierTo(
size.width / 3, size.height / 3, size.width, size.height / 5);
path.lineTo(size.width, 0);
path.close();
return path;
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
class MyClipper extends CustomClipper<Path> {
@override
Path getClip(Size size) {
var path = Path();
path.lineTo(0, size.height - 80);
path.quadraticBezierTo(
size.width / 2, size.height, size.width, size.height - 80);
path.lineTo(size.width, 0);
path.close();
return path;
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
if (state is FormLoaded) {
Navigator.push(
context, MaterialPageRoute(builder: (context) => MyPage2()));
}
if (state is FormLoading) {
return loadingwidget();
}