Search
 
SCRIPT & CODE EXAMPLE
 

DART

flutter sliver persistent header example

class Delegate extends SliverPersistentHeaderDelegate {
  final Color backgroundColor;
  final String headerTitle;

  Delegate(this.backgroundColor, this.headerTitle);

  @override
  Widget build(
      BuildContext context, double shrinkOffset, bool overlapsContent) {
    return Container(
      color: backgroundColor,
      child: Center(
        child: Text(
          headerTitle,
          style: const TextStyle(
            color: Colors.black,
            fontSize: 20,
          ),
        ),
      ),
    );
  }

  @override
  double get maxExtent => 150;

  @override
  double get minExtent => 60;

  @override
  bool shouldRebuild(SliverPersistentHeaderDelegate oldDelegate) {
    return true;
  }
Comment

PREVIOUS NEXT
Code Example
Dart :: dart language asynchronous ?? 
Dart :: how to set device into autorotate in flutter 
Dart :: scrolling to top sliverlist flutter with back button 
Dart :: dart set union 
Dart :: dart break foreach 
Dart :: dart operator ?? 
Dart :: get value from map with key flutter 
Dart :: flutter pop to index 1 
Dart :: dictionary in dart 
Dart :: missingpluginexceptionno implementation found for method firebaseinitializecore 
Dart :: Flutter default device font PlatformChannel 
Dart :: flutter firebase_messaging 9 ios 
Dart :: flutter raised button shadow 
Swift :: swiftui width screen 
Swift :: change from Date to String swift 5 
Swift :: Unique device id ios swift 
Swift :: swiftui padding one line 
Swift :: cgrect swift 
Swift :: swift uibutton programmatically set ontap function 
Swift :: swift access appdelegate from viewcontroller 
Swift :: swift dispatch after 
Swift :: swift for loop 
Swift :: How to set back button text in Swift 
Swift :: string.format swift 
Swift :: display image from url swift 
Swift :: swift loop through 2 arrays at once 
Swift :: imageliteral swiftui 
Swift :: swift constructor 
Swift :: uilabel set font 
Swift :: Swift if..else if 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =