adaptive_appbar 1.0.2
adaptive_appbar: ^1.0.2 copied to clipboard
A model for an adaptive AppBar. Created to easily make an app bar that changes size for both mobile and web development.
import 'package:adaptive_appbar/adaptive_appbar.dart';
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
//Theme
theme: ThemeData(
useMaterial3: true,
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green),
),
//Home
home: const HomePage()
);
}
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
// Implementation !!!
appBar: AdaptiveAppBar(
context,
title: "Awesome AppBar",
onBackPressed: () {},
//Extras:
// Title for back button (Shows only on big screens)
//backButtonTitle: "Discard",
// Custom background color
//backgroundColor: Colors.white,
// Custom foreground color
//foregroundColor: Colors.blue,
// Custom elevation
//elevation: 1,
// Custom widget at the end of the AppBar
//widget: const Icon(Icons.access_alarm),
),
);
}
}