Skip to content

Instantly share code, notes, and snippets.

@ryanhanks
Last active July 10, 2024 20:01
Show Gist options
  • Save ryanhanks/09844780dea96d15a9d5b5188e428f39 to your computer and use it in GitHub Desktop.
Save ryanhanks/09844780dea96d15a9d5b5188e428f39 to your computer and use it in GitHub Desktop.
A minimal application of SuperAppBar
import 'package:flutter/cupertino.dart';
import 'package:super_cupertino_navigation_bar/super_cupertino_navigation_bar.dart';
void main() => runApp(const NavBarSample());
class NavBarSample extends StatelessWidget {
const NavBarSample({
super.key,
});
@override
Widget build(BuildContext context) => const CupertinoApp(
home: HomeScreen(),
);
}
class HomeScreen extends StatelessWidget {
const HomeScreen({super.key});
@override
Widget build(BuildContext context) => CupertinoPageScaffold(
child: SuperScaffold(
appBar: SuperAppBar(
automaticallyImplyLeading: false,
title: const Text('Home'),
actions: CupertinoButton(
onPressed: () {},
child: const Icon(CupertinoIcons.add),
),
searchBar: SuperSearchBar(
scrollBehavior: SearchBarScrollBehavior.pinned,
searchResult: ListView(
padding: EdgeInsets.zero,
children: List.generate(
10,
(index) => CupertinoListTile(
title: Text('Item $index'),
),
),
),
),
largeTitle: SuperLargeTitle(
textStyle:
CupertinoTheme.of(context).textTheme.navLargeTitleTextStyle,
largeTitle: 'Home',
),
),
body: Container(),
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment