Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate NavbarItem updates to NavigationBar #45

Merged
merged 36 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
0d67e67
First commit: add navbar_badge and add main example
bebaoboy Apr 16, 2024
96dd927
fix: tap on the same item to hide badge + update comments
bebaoboy Apr 16, 2024
dd7eebb
added approproate tests for badges + make the badge class const
bebaoboy Apr 17, 2024
b21e4df
fix: issue #38
maheshj01 Apr 21, 2024
2da8ea7
index was getting reset on update
maheshj01 Apr 21, 2024
74337eb
fix deprecation and warning
maheshj01 Apr 21, 2024
104f3fd
update platform IOS
maheshj01 Apr 21, 2024
2844958
invoke didupdate first
maheshj01 Apr 21, 2024
ec5cb6f
deploy example using workflow
maheshj01 Apr 21, 2024
0ce0cd3
update script
maheshj01 Apr 21, 2024
1cf7153
update actions
maheshj01 Apr 21, 2024
79f1887
update script
maheshj01 Apr 21, 2024
fb99a97
add default working directory
maheshj01 Apr 21, 2024
152d8a2
update upload path
maheshj01 Apr 21, 2024
631b8e9
update prod branch
maheshj01 Apr 21, 2024
701aa60
Fix: issue #44
maheshj01 Apr 22, 2024
79a64ce
add tests
maheshj01 Apr 22, 2024
b500ddd
update for release
maheshj01 Apr 22, 2024
9ba5f48
Merge pull request #47 from maheshmnj/issue-44
maheshj01 Apr 22, 2024
94060c1
allow showing only selected labels
maheshj01 Apr 22, 2024
9b609ba
minor fix
maheshj01 Apr 22, 2024
a7ad5ad
Merge branch 'issue-44'
maheshj01 Apr 22, 2024
ce6a14d
update examplea
maheshj01 Apr 22, 2024
220ea41
update readme
maheshj01 Apr 22, 2024
9cbea0b
Update lib/src/navbar_notifier.dart as reviewed
bebaoboy Apr 22, 2024
2262eae
change to resolve reviews ;)
bebaoboy Apr 22, 2024
2335b6f
edit the test case to include different navbar type
bebaoboy Apr 24, 2024
816fc92
Merge pull request #43 from bebaoboy/navbar_badge
maheshj01 Apr 24, 2024
2d8b802
fix linter warnings
maheshj01 Apr 24, 2024
2ce7ef9
update readme
maheshj01 Apr 24, 2024
c7322e0
update changelog
maheshj01 Apr 24, 2024
e15e818
comment
maheshj01 Apr 24, 2024
0d19a04
add bottom padding for fab
maheshj01 Apr 24, 2024
2acb365
update readme
maheshj01 Apr 24, 2024
dc4c8dc
Merge branch 'main' into issue-38
maheshj01 Apr 30, 2024
47cd754
Prepare for release v0.7.4
maheshj01 Apr 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"dart.autoImportCompletions": true,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": "explicit"
},
"[dart]": {
"editor.tabSize": 2,
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
<string>12.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'
# platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
6 changes: 3 additions & 3 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/integration_test/ios"

SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
integration_test: 13825b8a9334a850581300559b8839134b124670

PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011

COCOAPODS: 1.11.3
COCOAPODS: 1.14.3
8 changes: 4 additions & 4 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -343,7 +343,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -421,7 +421,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -470,7 +470,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion 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
76 changes: 36 additions & 40 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'dart:async';
import 'dart:developer';

import 'package:example/app_controller.dart';
Expand All @@ -15,7 +14,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 @@ -100,33 +99,6 @@ class HomePage extends ConsumerStatefulWidget {
}

class _HomePageState extends ConsumerState<HomePage> {
List<NavbarItem> items = [
NavbarItem(Icons.home_outlined, 'Home',
backgroundColor: colors[0],
selectedIcon: const Icon(
Icons.home,
size: 26,
)),
NavbarItem(Icons.shopping_bag_outlined, 'Products',
backgroundColor: colors[1],
selectedIcon: const Icon(
Icons.shopping_bag,
size: 26,
)),
NavbarItem(Icons.person_outline, 'Me',
backgroundColor: colors[2],
selectedIcon: const Icon(
Icons.person,
size: 26,
)),
NavbarItem(Icons.settings_outlined, 'Settings',
backgroundColor: colors[0],
selectedIcon: const Icon(
Icons.settings,
size: 26,
)),
];

final Map<int, Map<String, Widget>> _routes = const {
0: {
'/': HomeFeeds(),
Expand All @@ -150,14 +122,14 @@ class _HomePageState extends ConsumerState<HomePage> {
DateTime newTime = DateTime.now();

/// This is only for demo purposes
void simulateTabChange({int times = 2, int delayInMs = 1000}) {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
for (int i = 0; i < items.length * times; i++) {
NavbarNotifier.index = i % items.length;
await Future.delayed(Duration(milliseconds: delayInMs));
}
});
}
// void simulateTabChange({int times = 2, int delayInMs = 1000}) {
// WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
// for (int i = 0; i < items.length * times; i++) {
// NavbarNotifier.index = i % items.length;
// await Future.delayed(Duration(milliseconds: delayInMs));
// }
// });
// }

@override
void initState() {
Expand All @@ -179,6 +151,33 @@ class _HomePageState extends ConsumerState<HomePage> {
final size = MediaQuery.of(context).size;
final appRef = ref.watch(appProvider);

List<NavbarItem> items = [
NavbarItem(Icons.home_outlined, 'Home',
backgroundColor: colors[0],
selectedIcon: const Icon(
Icons.home,
size: 26,
)),
NavbarItem(Icons.shopping_bag_outlined, 'Products',
backgroundColor: colors[1],
selectedIcon: const Icon(
Icons.shopping_bag,
size: 26,
)),
NavbarItem(Icons.person_outline, 'Me',
backgroundColor: colors[2],
selectedIcon: const Icon(
Icons.person,
size: 26,
)),
NavbarItem(Icons.settings_outlined, 'Settings',
backgroundColor: colors[0],
selectedIcon: Icon(
color: Theme.of(context).colorScheme.primary,
Icons.settings,
size: 26,
)),
];
return Scaffold(
resizeToAvoidBottomInset: false,
floatingActionButton: AnimatedBuilder(
Expand Down Expand Up @@ -501,7 +500,6 @@ class _ProductListState extends ConsumerState<ProductList> {
@override
void initState() {
super.initState();
print("productlist initState invoked");
}

@override
Expand Down Expand Up @@ -645,9 +643,7 @@ class _UserProfileState extends State<UserProfile> {

@override
void initState() {
// TODO: implement initState
super.initState();
print("profile initState invoked");
}

@override
Expand Down
Loading
Loading