sooxt98 / google_nav_bar

A modern google style nav bar for flutter.
MIT License
735 stars 114 forks source link

Please fix set State errors please also make it work well with GETX and one more thing #63

Closed fisforfaheem closed 3 years ago

fisforfaheem commented 3 years ago

please please ad better and easier multiple examples of the Ui that is in the gif

sooxt98 commented 3 years ago

the gif example is at here :3 https://github.com/sooxt98/google_nav_bar/blob/master/example/lib/main_gallery.dart

sooxt98 commented 3 years ago

@fisforfaheem could you describe more why it doesn't work well with getx, maybe some provide some minimal code? im using it with getx in across multiple projects, it works fine

fisforfaheem commented 3 years ago

It works now ...after some tinkering...but the problem is that there is only one example that shows it;s design and working...please add more examples and tutorials to make it truly customized

On Sun, Jul 11, 2021 at 9:59 PM sooxt98 @.***> wrote:

@fisforfaheem https://github.com/fisforfaheem could you describe more why it doesn't work well with getx? im using with getx in across multiple projects, it works fine

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sooxt98/google_nav_bar/issues/63#issuecomment-877832211, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIRXJSHNC7AKANOL4X5I2YTTXHEXZANCNFSM5AEU3NBA .

sooxt98 commented 3 years ago

@fisforfaheem hmmm, there are 4 working example within the package, i think it's enough for showcasing the power of the package

fisforfaheem commented 3 years ago

Thanks, what i meant was in the extension page on pub., dev...i mean u have 4 designs showcase but code for only 1

On Sun, Jul 11, 2021 at 10:24 PM sooxt98 @.***> wrote:

@fisforfaheem https://github.com/fisforfaheem hmmm, there are 4 working example within the package, i think it's enough for showcasing the power of the package

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sooxt98/google_nav_bar/issues/63#issuecomment-877835275, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIRXJSED3I55P462WUTZIBTTXHHUPANCNFSM5AEU3NBA .

sooxt98 commented 3 years ago

@fisforfaheem its pub.dev limitations, i don't want to make the example over complex, so i choose to split it into 4 files

fisforfaheem commented 3 years ago

where are those fifles??? please link me ??? update pub. dev website??

On Tue, Jul 13, 2021 at 12:42 AM sooxt98 @.***> wrote:

Closed #63 https://github.com/sooxt98/google_nav_bar/issues/63.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sooxt98/google_nav_bar/issues/63#event-5009495936, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIRXJSESCIW7JTV6O3X7AMLTXNATRANCNFSM5AEU3NBA .

sooxt98 commented 3 years ago

It’s inside the example folder

On Sat, 17 Jul 2021 at 2:44 AM, Faheem Ahmad @.***> wrote:

where are those fifles??? please link me ??? update pub. dev website??

On Tue, Jul 13, 2021 at 12:42 AM sooxt98 @.***> wrote:

Closed #63 https://github.com/sooxt98/google_nav_bar/issues/63.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sooxt98/google_nav_bar/issues/63#event-5009495936, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AIRXJSESCIW7JTV6O3X7AMLTXNATRANCNFSM5AEU3NBA

.

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/sooxt98/google_nav_bar/issues/63#issuecomment-881645844, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGCEC2TFUKKBX74M767IXLTYB42FANCNFSM5AEU3NBA .

fisforfaheem commented 3 years ago

ok... i tried it out but with no luck to implement it :( i did get code but no luck..

this was my already used code..i wanted to add some more styles ...import 'package:flutter/material.dart'; import 'package:flutter_facebook_responsive_ui/screens/screens.dart'; import 'package:flutter_facebook_responsive_ui/screens/walls/walls.dart'; import 'package:get/get.dart'; import 'package:google_nav_bar/google_nav_bar.dart';

import 'walls/class_wall.dart'; import 'package:shared_preferences/shared_preferences.dart';

class CustomeNavbar extends StatefulWidget { final ind; const CustomeNavbar({Key key, this.ind}) : super(key: key);

@override _CustomeNavbarState createState() => _CustomeNavbarState(); }

class _CustomeNavbarState extends State { var type = ''; var fullName = ''; atStart() async { SharedPreferences pref = await SharedPreferences.getInstance(); type = pref.getString("UType"); fullName = pref.getString("FullName");

setState(() {});

}

@override void initState() { super.initState(); atStart(); }

@override Widget build(BuildContext context) { return type.toLowerCase() == 'e' ? Container( decoration: BoxDecoration( color: Colors.white, boxShadow: [ BoxShadow( blurRadius: 20, color: Colors.black.withOpacity(.1), ) ], ), child: GNav( backgroundColor: Colors.green.withOpacity(.09), selectedIndex: widget.ind, rippleColor: Colors.grey[300], // tab button ripple color when pressed hoverColor: Colors.grey[100], // tab button hover color haptic: true, // haptic feedback tabBorderRadius: 200, tabActiveBorder: Border.all( color: Colors.green, width: 0.03), // tab button border tabBorder: Border.all( color: Colors.green, width: 0.01), // tab button border curve: Curves.bounceInOut, // tab animation curves duration: Duration(milliseconds: 300), // tab animation duration // gap: 1, // the tab button gap between icon and text color: Colors.green[900], // unselected icon color activeColor: Colors.black, // selected icon and text color padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15), iconSize: 25, // tab button icon size

          tabShadow: [
            BoxShadow(blurRadius: 20, color: Colors.black.withOpacity(.1

)) ], tabBackgroundColor: Colors.grey[100], // selected tab background color // padding: EdgeInsets.symmetric(horizontal: 12, vertical: 5), tabs: [ GButton( icon: Icons.home_outlined, text: 'BIIT Wall', ), GButton( icon: Icons.group_outlined, text: 'Session', ), GButton( icon: Icons.book_outlined, text: 'Diary ', ), GButton( icon: Icons.more_horiz_outlined, text: 'More', ), ], onTabChange: (i) { switch (i) { case 0: Get.offAll(() => HomeScreen());

                break;
              case 1:
                // Get.offAll(() => HomeScreen());
                Get.offAll(() => SessionWall());

                break;

              case 2:
                //  Get.offAll(() => HomeScreen());
                Get.offAll(() => PersonalDiary());
                break;

              case 3:
                //Get.offAll(() => HomeScreen());
                Get.offAll(() => MoreOptions());

                break;

              // default:
            }
          },
        ),
      )
    : Container(
        decoration: BoxDecoration(
          color: Colors.white,
          boxShadow: [
            // BoxShadow(
            //   blurRadius: 20,
            //   color: Colors.black.withOpacity(.1),
            // )
            BoxShadow(
              spreadRadius: -10,
              blurRadius: 60,
              color: Colors.black.withOpacity(.20),
              offset: Offset(0, 15),
            )
          ],
        ),
        child: GNav(
          backgroundColor: Colors.green.withOpacity(.09),
          selectedIndex: widget.ind,
          rippleColor:
              Colors.grey[300], // tab button ripple color when pressed
          hoverColor: Colors.grey[100], // tab button hover color
          haptic: true, // haptic feedback
          tabBorderRadius: 200,
          tabActiveBorder: Border.all(
              color: Colors.green, width: 0.03), // tab button border
          tabBorder: Border.all(
              color: Colors.green, width: 0.01), // tab button border
          curve: Curves.bounceInOut, // tab animation curves
          // gap: 1, // the tab button gap between icon and text
          color: Colors.green[900], // unselected icon color
          activeColor: Colors.black, // selected icon and text color
          padding: EdgeInsets.symmetric(horizontal: 20, vertical: 16.5),
          duration: Duration(milliseconds: 800),
          iconSize: 25, // tab button icon size

          tabShadow: [
            BoxShadow(blurRadius: 20, color: Colors.black.withOpacity(.1

)) ], tabBackgroundColor: Colors.grey[100], // selected tab background color // padding: EdgeInsets.symmetric(horizontal: 12, vertical: 5), tabs: [ GButton( icon: Icons.home_outlined, text: 'BIIT', ), GButton( icon: Icons.group_outlined, text: 'Session', ), GButton( icon: Icons.groups_outlined, text: 'Class Wall ', ), GButton( icon: Icons.account_box, text: 'Profile', leading: CircleAvatar( radius: 12, backgroundImage: NetworkImage( ' https://sooxt98.space/content/images/size/w100/2019/01/profile.png'), ), ), GButton( icon: Icons.more_horiz_outlined, text: 'More', ), // GButton( // icon: Icons.person_outlined, // // text: 'Profile', // ), // GButton( // icon: Icons.more_horiz_outlined, // // text: 'More', // ), ], onTabChange: (i) { switch (i) { case 0: Get.offAll(() => HomeScreen());

                break;
              case 1:
                Get.offAll(() => SessionWall());

                break;
              case 2:
                Get.offAll(() => ClassWall());
                break;

              case 3:
                Get.offAll(() => ProfilePage());
                break;

              case 4:
                Get.offAll(() => MoreOptions());

                break;
              // case 5:
              //   Get.offAll(ProfilePage());
              //   break;
              // case 6:
              //   Get.offAll(MoreOptions());
              //   break;
              // default:
            }
          },
        ),
      );

} }

//old nav // class NavScreen extends StatefulWidget { // @override // _NavScreenState createState() => _NavScreenState(); // }

// class _NavScreenState extends State { // final List _screens = [ // HomeScreen(), //Main Home Screen // SessionPage(), //session Wall // new PersonalDiary(), //Personal Diary // GroupsList(), //Groups List // MoreOptions(), // ]; // final List _icons = const [ // Icons.home_outlined, // MdiIcons.googleClassroom, // MdiIcons.accountCircleOutline, // MdiIcons.accountGroupOutline, // //MdiIcons.googleCirclesGroup, //disabling bcuz sir thinks it's weird. // // MdiIcons.bellOutline, // Icons.menu, // ]; // int _selectedIndex = 0;

// @override // void initState() { // super.initState(); // init(); // }

// init() async { // SharedPreferences prefs = await SharedPreferences.getInstance(); // var id = prefs.getString( // "userId", // ); // print("=====> $id"); // }

// @override // Widget build(BuildContext context) { // return DefaultTabController( // length: _icons.length, // child: Scaffold( // body: IndexedStack( // index: _selectedIndex, // children: _screens, // ), // bottomNavigationBar: Theme( // data: Theme.of(context).copyWith( // // sets the background color of the BottomNavigationBar // canvasColor: Theme.of(context).primaryColor, // // sets the active color of the BottomNavigationBar if Brightness is light // // ignore: deprecated_member_use // primaryColor: Theme.of(context).accentColor, // textTheme: Theme.of(context).textTheme.copyWith( // caption: TextStyle(color: Colors.grey[500]), // ), // ), // child: Container( // padding: const EdgeInsets.only(bottom: 12.0), // color: Colors.white70, // child: CustomTabBar( // icons: _icons, // selectedIndex: _selectedIndex, // onTap: (index) async { // //Vibration.vibrate(duration: 10, amplitude: 180); // setState(() => _selectedIndex = index); // }), // ), // ), // ), // ); // } // }

On Fri, Jul 16, 2021 at 11:46 PM sooxt98 @.***> wrote:

It’s inside the example folder

On Sat, 17 Jul 2021 at 2:44 AM, Faheem Ahmad @.***> wrote:

where are those fifles??? please link me ??? update pub. dev website??

On Tue, Jul 13, 2021 at 12:42 AM sooxt98 @.***> wrote:

Closed #63 https://github.com/sooxt98/google_nav_bar/issues/63.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <https://github.com/sooxt98/google_nav_bar/issues/63#event-5009495936 , or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AIRXJSESCIW7JTV6O3X7AMLTXNATRANCNFSM5AEU3NBA

.

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub < https://github.com/sooxt98/google_nav_bar/issues/63#issuecomment-881645844 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ADGCEC2TFUKKBX74M767IXLTYB42FANCNFSM5AEU3NBA

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sooxt98/google_nav_bar/issues/63#issuecomment-881646545, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIRXJSB5HBX6F76D4VEC2VTTYB473ANCNFSM5AEU3NBA .

fisforfaheem commented 3 years ago

????

sooxt98 commented 3 years ago

@fisforfaheem i dont know whats ur main issue, and your code is not clean which still depends on others lib

fisforfaheem commented 3 years ago

Ok, here is the link to my project please have a look, it works fine..UI .... please have a look at my navscreen .dart I am new to flutter that's why no clean code sorry :( \ https://github.com/fisforfaheem/social_media_application_flutter

On Sat, Jul 24, 2021 at 6:05 PM sooxt98 @.***> wrote:

@fisforfaheem https://github.com/fisforfaheem i dont know whats ur main issue, and your code is not clean which still depends on others lib

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sooxt98/google_nav_bar/issues/63#issuecomment-886051052, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIRXJSGT3TG3ND36M2TKQGDTZK3CHANCNFSM5AEU3NBA .