apptomate_custom_silver_appbar 0.0.1 copy "apptomate_custom_silver_appbar: ^0.0.1" to clipboard
apptomate_custom_silver_appbar: ^0.0.1 copied to clipboard

A highly customizable `SliverAppBar` widget that provides a flexible app bar for scrollable views with built-in best practices and sensible defaults.

example/lib/main.dart

import 'package:apptomate_custom_silver_appbar/apptomate_custom_silver_appbar.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const CustomSliverAppBarWidget(),
    );
  }
}

class CustomSliverAppBarWidget extends StatelessWidget {
  const CustomSliverAppBarWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: CustomScrollView(
        slivers: [
          CustomSliverAppBar(
            title: 'Dynamic SliverAppBar',
            pinned: true, // Stays on top when scrolled
            floating: true, // Appears while scrolling
            expandedHeight: 250.0,

            // Leading Widget
            leading: IconButton(
              icon: const Icon(Icons.menu, color: Colors.white),
              onPressed: () => Navigator.pop(context),
            ),

            // Action Buttons
            actions: [
              IconButton(
                icon: const Icon(Icons.favorite, color: Colors.white),
                onPressed: () => print('Favorite pressed'),
              ),
              IconButton(
                icon: const Icon(Icons.more_vert, color: Colors.white),
                onPressed: () => print('More options pressed'),
              ),
            ],

            // Custom Background
            background: Image.network(
              'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT32i0ouh_ZU8PqQpPaSzWytuaOgqQOam_P2w&s',
              fit: BoxFit.cover,
            ),

            backgroundColor: Colors.deepPurple,
          ),

          // Example List
          SliverList(
            delegate: SliverChildBuilderDelegate(
                  (context, index) => ListTile(
                title: Text('Item ${index + 1}'),
                leading: const Icon(Icons.list),
              ),
              childCount: 20,
            ),
          ),
        ],
      ),
    );
  }
}
0
likes
150
points
31
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A highly customizable `SliverAppBar` widget that provides a flexible app bar for scrollable views with built-in best practices and sensible defaults.

Homepage

License

MIT (license)

Dependencies

flutter

More

Packages that depend on apptomate_custom_silver_appbar