diff --git a/CHANGELOG.md b/CHANGELOG.md index c131bc5..075d37e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ -## [0.7.6] Unreleased +## [0.7.6] August 18, 2024 +- [Regression] Programmatically change Index [Issue #57](https://github.com/maheshj01/navbar_router/issues/57) - Back button should call indexChangeListener [Issue #53](https://github.com/maheshmnj/navbar_router/issues/53) ## [0.7.5] July 12, 2024 diff --git a/README.md b/README.md index d430047..cbbb19d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## **navbar_router v0.7.5** +## **navbar_router v0.7.6** Flutter Platform Badge Pub diff --git a/example/lib/main.dart b/example/lib/main.dart index 50da747..2498110 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -194,7 +194,22 @@ class _HomePageState extends ConsumerState { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ const SizedBox( - width: 50, + + + + width: 60, + ), + FloatingActionButton.extended( + heroTag: 'RandomIndex', + onPressed: () { + int index = Random().nextInt(100); + NavbarNotifier.index = index % 4; + }, + label: const Text("Random Index"), + ), + const SizedBox( + width: 20, + ), FloatingActionButton.extended( heroTag: 'showSnackBar', @@ -383,9 +398,7 @@ class _HomeFeedsState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: const Text('Feeds'), - ), + appBar: AppBar(title: const Text('Feeds')), body: ListView.builder( controller: _scrollController, itemCount: 30, diff --git a/example/pubspec.yaml b/example/pubspec.yaml index cde9e3f..36305e6 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: "none" version: 1.0.0+1 environment: - sdk: ">=2.18.0 <3.0.0" + sdk: ">=2.18.0 <4.0.0" dependencies: navbar_router: diff --git a/lib/src/navbar_router.dart b/lib/src/navbar_router.dart index 1f85bb9..236b5e0 100644 --- a/lib/src/navbar_router.dart +++ b/lib/src/navbar_router.dart @@ -403,6 +403,7 @@ class _NavbarRouterState extends State child: AnimatedBuilder( animation: _navbarNotifier, builder: (context, child) { + _handleFadeAnimation(); return Stack( children: [ AnimatedPadding( diff --git a/pubspec.yaml b/pubspec.yaml index e14dd50..c884adc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: navbar_router description: A flutter package to build advanced bottomnavbar with minimal code and hassle -version: 0.7.5 +version: 0.7.6 homepage: https://github.com/maheshmnj/navbar_router repository: https://github.com/maheshmnj/navbar_router issue_tracker: https://github.com/maheshmnj/navbar_router/issues diff --git a/test/navbar_utils.dart b/test/navbar_utils.dart index 8bd8e33..d87467f 100644 --- a/test/navbar_utils.dart +++ b/test/navbar_utils.dart @@ -93,9 +93,7 @@ class _HomeFeedsState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: const Text('Feeds'), - ), + appBar: AppBar(title: const Text('Feeds')), body: ListView.builder( controller: _scrollController, itemCount: 30, @@ -131,26 +129,26 @@ class FeedTile extends StatelessWidget { margin: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 8), color: Theme.of(context).colorScheme.surface, child: Card( - child: Stack( + child: Column( children: [ - Positioned( - top: 4, - right: 4, - left: 4, - child: Container( - height: 180, - margin: - const EdgeInsets.symmetric(horizontal: 8.0, vertical: 8), + Container( + height: 180, + margin: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 12), + alignment: Alignment.center, + decoration: BoxDecoration( color: Theme.of(context).colorScheme.secondary, - alignment: Alignment.center, - child: Text('Feed $index card'), + borderRadius: BorderRadius.circular(8.0), ), + child: Text('Feed $index card'), ), - Positioned( - bottom: 12, - right: 12, - left: 12, - child: Text(placeHolderText.substring(0, 200))) + Container( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + alignment: Alignment.center, + child: const Text( + placeHolderText, + maxLines: 4, + overflow: TextOverflow.ellipsis, + )) ], ), ), @@ -233,6 +231,11 @@ class _ProductListState extends State { super.dispose(); } + @override + void initState() { + super.initState(); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -372,6 +375,17 @@ class UserProfile extends StatefulWidget { class _UserProfileState extends State { final GlobalKey iconKey = GlobalKey(); + final Uri _url = Uri.parse('https://docs.maheshjamdade.com/navbar_router/'); + + Future _launchUrl() async { + throw Exception('Could not launch $_url'); + } + + @override + void initState() { + super.initState(); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -379,6 +393,11 @@ class _UserProfileState extends State { appBar: AppBar( centerTitle: false, actions: [ + IconButton( + tooltip: 'show Docs', + icon: const Icon(Icons.edit_document), + onPressed: _launchUrl, + ), IconButton( key: iconKey, icon: const Icon(Icons.edit), @@ -391,7 +410,7 @@ class _UserProfileState extends State { offset: offset, transitionType: TransitionType.reveal); }, - ) + ), ], title: const Text('Hi User')), body: Center(