NetflixAppBar constructor
NetflixAppBar(
- List<
DrTextTransitionTitleObject> titles, - int duration, {
- Widget? header,
- double headerHeight = 0,
- Color? background = Colors.transparent,
- Color? appBarColor,
- int dumping = 100,
- double titlePaddingLeft = 16,
- double titlePaddingRight = 15,
- double titleActiveFontSize = 20,
- double maxOpacity = 0.6,
- double initialOpacity = 0,
- bool pinned = false,
- TextStyle titleStyles = const TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold),
- Widget? leading,
- dynamic onScreenChange()?,
- MainAxisAlignment? mainAxisAlignment,
Implementation
NetflixAppBar(this.titles, this.duration,
{Widget? header,
double headerHeight = 0,
Color? background = Colors.transparent,
Color? appBarColor,
int dumping = 100,
double titlePaddingLeft = 16,
double titlePaddingRight = 15,
double titleActiveFontSize = 20,
double maxOpacity = 0.6,
double initialOpacity = 0,
bool pinned = false,
TextStyle titleStyles = const TextStyle(
color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold),
Widget? leading,
Function(ScrollController, String, NetflixAppBar)? onScreenChange,
MainAxisAlignment? mainAxisAlignment}) {
if (titles.isEmpty)
throw new Exception("NetflixAppBar error: titles cannot be empty!");
if (appBarColor == null) appBarColor = Colors.purpleAccent.withOpacity(0.7);
this.onScreenChange = onScreenChange;
this.header = header;
this.headerHeight = headerHeight;
this.appBarColor = appBarColor;
this.titleStyles = titleStyles;
this.titlePaddingLeft = titlePaddingLeft;
this.titlePaddingRight = titlePaddingRight;
this.titleActiveFontSize = titleActiveFontSize;
this.background = background;
this.dumping = dumping;
this.titles = titles;
this.maxOpacity = maxOpacity;
this.initialOpacity = initialOpacity;
this.leading = leading;
this.pinned = pinned;
this.duration = duration;
this.mainAxisAlignment = mainAxisAlignment;
if (this.titles[0].header != null) {
this.header = this.titles[0].header;
this.headerHeight = this.titles[0].headerHeight ?? this.headerHeight;
}
}