NetflixAppBar constructor

NetflixAppBar(
  1. List<DrTextTransitionTitleObject> titles,
  2. int duration, {
  3. Widget? header,
  4. double headerHeight = 0,
  5. Color? background = Colors.transparent,
  6. Color? appBarColor,
  7. int dumping = 100,
  8. double titlePaddingLeft = 16,
  9. double titlePaddingRight = 15,
  10. double titleActiveFontSize = 20,
  11. double maxOpacity = 0.6,
  12. double initialOpacity = 0,
  13. bool pinned = false,
  14. TextStyle titleStyles = const TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold),
  15. Widget? leading,
  16. dynamic onScreenChange(
    1. ScrollController,
    2. String,
    3. NetflixAppBar
    )?,
  17. 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;
  }
}