Skip to content

Commit

Permalink
fix linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
maheshj01 committed Apr 24, 2024
1 parent 816fc92 commit 2d8b802
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"url_launcher_ios","path":"/Users/mahesh/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.5/","native_build":true,"dependencies":[]}],"android":[{"name":"url_launcher_android","path":"/Users/mahesh/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.1/","native_build":true,"dependencies":[]}],"macos":[{"name":"url_launcher_macos","path":"/Users/mahesh/.pub-cache/hosted/pub.dev/url_launcher_macos-3.1.0/","native_build":true,"dependencies":[]}],"linux":[{"name":"url_launcher_linux","path":"/Users/mahesh/.pub-cache/hosted/pub.dev/url_launcher_linux-3.1.1/","native_build":true,"dependencies":[]}],"windows":[{"name":"url_launcher_windows","path":"/Users/mahesh/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.1/","native_build":true,"dependencies":[]}],"web":[{"name":"url_launcher_web","path":"/Users/mahesh/.pub-cache/hosted/pub.dev/url_launcher_web-2.3.1/","dependencies":[]}]},"dependencyGraph":[{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2024-04-21 23:40:05.192802","version":"3.19.3"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"url_launcher_ios","path":"/Users/mahesh/.pub-cache/hosted/pub.dev/url_launcher_ios-6.2.5/","native_build":true,"dependencies":[]}],"android":[{"name":"url_launcher_android","path":"/Users/mahesh/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.1/","native_build":true,"dependencies":[]}],"macos":[{"name":"url_launcher_macos","path":"/Users/mahesh/.pub-cache/hosted/pub.dev/url_launcher_macos-3.1.0/","native_build":true,"dependencies":[]}],"linux":[{"name":"url_launcher_linux","path":"/Users/mahesh/.pub-cache/hosted/pub.dev/url_launcher_linux-3.1.1/","native_build":true,"dependencies":[]}],"windows":[{"name":"url_launcher_windows","path":"/Users/mahesh/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.1/","native_build":true,"dependencies":[]}],"web":[{"name":"url_launcher_web","path":"/Users/mahesh/.pub-cache/hosted/pub.dev/url_launcher_web-2.3.1/","dependencies":[]}]},"dependencyGraph":[{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2024-04-24 09:13:08.481317","version":"3.19.3"}
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## [0.7.4] Unreleased

- Expose NavigationRail properties
- Adds Support for Navbarbadges #[PR 43](https://github.com/maheshmnj/navbar_router/pull/43/)
- Expose NavigationRail properties to NavbarRouter Part of [Issue #41](https://github.com/maheshmnj/navbar_router/issues/41)
- Improve closing and opening of NavigationRail on Window resize/programmatically

## [0.7.3] Dec 30, 2023

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## **navbar_router v0.7.4**
## **navbar_router v0.7.3**

<a href="https://pub.dev/packages/navbar_router"><img src="https://img.shields.io/pub/v/navbar_router.svg" alt="Pub"></a>

Expand Down
8 changes: 5 additions & 3 deletions example/lib/app_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class AppController {
final bool showFAB;
final bool extended;

AppController({
const AppController({
this.index = 0,
this.showFAB = true,
this.extended = true,
Expand Down Expand Up @@ -47,10 +47,12 @@ class AppController {

String toJson() => json.encode(toMap());

factory AppController.fromJson(String source) => AppController.fromMap(json.decode(source));
factory AppController.fromJson(String source) =>
AppController.fromMap(json.decode(source));

@override
String toString() => 'AppController(index: $index, showFAB: $showFAB, extended: $extended)';
String toString() =>
'AppController(index: $index, showFAB: $showFAB, extended: $extended)';

@override
bool operator ==(Object other) {
Expand Down
8 changes: 1 addition & 7 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void main() {
}

final appProvider = StateNotifierProvider<AppNotifier, AppController>(
(ref) => AppNotifier(AppController(
(ref) => AppNotifier(const AppController(
extended: false,
index: 0,
showFAB: true,
Expand Down Expand Up @@ -657,12 +657,6 @@ class UserProfile extends StatefulWidget {
class _UserProfileState extends State<UserProfile> {
final GlobalKey iconKey = GlobalKey();

@override
void initState() {
// TODO: implement initState
super.initState();
}

final Uri _url = Uri.parse('https://docs.maheshjamdade.com/navbar_router/');

Future<void> _launchUrl() async {
Expand Down
8 changes: 8 additions & 0 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.11.0"
badges:
dependency: "direct main"
description:
name: badges
sha256: a7b6bbd60dce418df0db3058b53f9d083c22cdb5132a052145dc267494df0b84
url: "https://pub.dev"
source: hosted
version: "3.1.2"
boolean_selector:
dependency: transitive
description:
Expand Down
66 changes: 31 additions & 35 deletions lib/src/animated_navbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ class _AnimatedNavBarState extends State<_AnimatedNavBar>
},
labelType: navigationRailDefaultDecoration.isExtended
? NavigationRailLabelType.none
: navigationRailDefaultDecoration.showUnselectedLabels!
: navigationRailDefaultDecoration.showUnselectedLabels
? NavigationRailLabelType.all
: NavigationRailLabelType.selected,
useIndicator: true,
Expand Down Expand Up @@ -896,24 +896,22 @@ class M3NavBarState extends State<M3NavBar> {
Widget build(BuildContext context) {
return Theme(
data: Theme.of(context).copyWith(
useMaterial3: true,
navigationBarTheme: NavigationBarThemeData(
backgroundColor: widget.decoration.backgroundColor ??
Theme.of(context).colorScheme.surface,
elevation: widget.elevation,
labelTextStyle: MaterialStateProperty.all(
widget.decoration.selectedLabelTextStyle),
indicatorShape: widget.decoration.indicatorShape ??
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
iconTheme:
MaterialStateProperty.all(widget.decoration.selectedIconTheme),
labelBehavior: widget.decoration.showUnselectedLabels
? NavigationDestinationLabelBehavior.alwaysShow
: NavigationDestinationLabelBehavior.onlyShowSelected,
indicatorColor: widget.decoration.indicatorColor,
height: widget.height,
)),
backgroundColor: widget.decoration.backgroundColor ??
Theme.of(context).colorScheme.surface,
elevation: widget.elevation,
labelTextStyle:
MaterialStateProperty.all(widget.decoration.selectedLabelTextStyle),
indicatorShape: widget.decoration.indicatorShape ??
RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
iconTheme:
MaterialStateProperty.all(widget.decoration.selectedIconTheme),
labelBehavior: widget.decoration.showUnselectedLabels
? NavigationDestinationLabelBehavior.alwaysShow
: NavigationDestinationLabelBehavior.onlyShowSelected,
indicatorColor: widget.decoration.indicatorColor,
height: widget.height,
)),
child: MediaQuery(
data: MediaQuery.of(context).removePadding(removeTop: true),
child: NavigationBar(
Expand Down Expand Up @@ -1017,24 +1015,22 @@ class FloatingNavbarState extends State<FloatingNavbar> {
final isDark = Theme.of(context).brightness == Brightness.dark;
return Theme(
data: Theme.of(context).copyWith(
useMaterial3: true,
navigationBarTheme: NavigationBarThemeData(
backgroundColor: widget.decoration.backgroundColor ??
Theme.of(context).colorScheme.surface,
elevation: widget.elevation,
labelTextStyle: MaterialStateProperty.all(
widget.decoration.selectedLabelTextStyle),
indicatorShape: widget.decoration.indicatorShape ??
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18.0)),
iconTheme: MaterialStateProperty.all(
widget.decoration.selectedIconTheme),
labelBehavior: widget.decoration.showSelectedLabels!
? NavigationDestinationLabelBehavior.onlyShowSelected
: NavigationDestinationLabelBehavior.alwaysShow,
indicatorColor: widget.decoration.indicatorColor,
height: widget.height,
)),
backgroundColor: widget.decoration.backgroundColor ??
Theme.of(context).colorScheme.surface,
elevation: widget.elevation,
labelTextStyle: MaterialStateProperty.all(
widget.decoration.selectedLabelTextStyle),
indicatorShape: widget.decoration.indicatorShape ??
RoundedRectangleBorder(borderRadius: BorderRadius.circular(18.0)),
iconTheme:
MaterialStateProperty.all(widget.decoration.selectedIconTheme),
labelBehavior: widget.decoration.showSelectedLabels!
? NavigationDestinationLabelBehavior.onlyShowSelected
: NavigationDestinationLabelBehavior.alwaysShow,
indicatorColor: widget.decoration.indicatorColor,
height: widget.height,
)),
child: Container(
height: widget.navbarHeight,
margin: widget.margin ??
Expand Down

1 comment on commit 2d8b802

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.