Skip to content

Instantly share code, notes, and snippets.

@anmolseth06
Created September 30, 2020 18:27
Show Gist options
  • Save anmolseth06/8a3b32424a7572ad3764301b9bb533be to your computer and use it in GitHub Desktop.
Save anmolseth06/8a3b32424a7572ad3764301b9bb533be to your computer and use it in GitHub Desktop.
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
class AnimatedAppBar extends StatelessWidget {
AnimationController colorAnimationController;
Animation colorTween, homeTween, workOutTween, iconTween, drawerTween;
Function onPressed;
AnimatedAppBar({
@required this.colorAnimationController,
@required this.onPressed,
@required this.colorTween,
@required this.homeTween,
@required this.iconTween,
@required this.drawerTween,
@required this.workOutTween,
});
@override
Widget build(BuildContext context) {
return Container(
height: 80,
child: AnimatedBuilder(
animation: colorAnimationController,
builder: (context, child) => AppBar(
leading: IconButton(
icon: Icon(
Icons.dehaze,
color: drawerTween.value,
),
onPressed: onPressed,
),
backgroundColor: colorTween.value,
elevation: 0,
titleSpacing: 0.0,
title: Row(
children: <Widget>[
Text(
"Hello ",
style: TextStyle(
color: homeTween.value,
fontWeight: FontWeight.bold,
fontSize: 16,
letterSpacing: 1),
),
Text(
'username',
style: TextStyle(
color: workOutTween.value,
fontWeight: FontWeight.bold,
fontSize: 16,
letterSpacing: 1),
),
],
),
actions: <Widget>[
Icon(
Icons.notifications,
color: iconTween.value,
),
Padding(
padding: const EdgeInsets.all(7),
child: CircleAvatar(
backgroundImage:
NetworkImage('image_url'),
),
),
],
),
),
);
}
}
@isAlmogK
Copy link

Is there a way to see the full example, ie entire code base

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment