flutter_appbar 1.4.6+1 copy "flutter_appbar: ^1.4.6+1" to clipboard
flutter_appbar: ^1.4.6+1 copied to clipboard

This package implements the flexible appbar behavior, And we pursue higher performance and responsiveness than the appbar generally provided by Flutter.

example/main.dart

import 'package:flutter/material.dart' hide AppBar;
import 'package:flutter_appbar/flutter_appbar.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        backgroundColor: Colors.black,
        body: SafeArea(
          child: AppBarConnection(
            appBars: [
              AppBar(
                behavior: const MaterialAppBarBehavior(dragOnlyExpanding: true),
                alignment: AppBarAlignment.center,
                body: Container(
                  width: double.infinity,
                  height: 300,
                  color: Colors.red,
                  alignment: Alignment.center,
                  child: const Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      Text(
                        "Header",
                        style: TextStyle(
                          fontSize: 32,
                          fontWeight: FontWeight.bold,
                        ),
                      ),
                      Text(
                        "dragOnlyExpanding: true",
                        style: TextStyle(fontSize: 16),
                      ),
                    ],
                  ),
                ),
              ),
              AppBar(
                behavior: const MaterialAppBarBehavior(floating: true),
                body: Container(
                  width: double.infinity,
                  padding: const EdgeInsets.all(15),
                  color: Colors.blue,
                  alignment: Alignment.center,
                  child: const Column(
                    children: [
                      Text(
                        "AppBar",
                        style: TextStyle(
                          fontSize: 20,
                          fontWeight: FontWeight.bold,
                        ),
                      ),
                      Text("floating: true", style: TextStyle(fontSize: 16)),
                    ],
                  ),
                ),
              ),
            ],
            child: ListView.builder(
              itemCount: 100,
              itemBuilder: (context, index) {
                return Text(
                  "Hello, World! $index",
                  style: const TextStyle(color: Colors.white),
                );
              },
            ),
          ),
        ),
      ),
    );
  }
}
10
likes
160
points
147
downloads

Publisher

verified publisherttangkong.dev

Weekly Downloads

This package implements the flexible appbar behavior, And we pursue higher performance and responsiveness than the appbar generally provided by Flutter.

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on flutter_appbar