navbar_router icon indicating copy to clipboard operation
navbar_router copied to clipboard

Load BreakPoint Specific UI

Open maheshj01 opened this issue 1 year ago • 0 comments

Right now we only expose a boolean to determine whether we would like to switch to DesktopMode, Provided that there are devices of multiple viewport size we should expose a way to provide users with a breakpoint and build layouts for those viewports

So that the API can be easily used something like this

NavbarRouter(
   breakpoints: {
      xs: '320px',
      sm: '375px',
      md: '768px', // width >= 768
      lg: '1024px',
      xl: '1280px',
      2xl: '1536px',
   },

builder: (context, dimension){
 switch(dimension){
    case: dimensions.width >= 320 :
          return ExtraSmallUI();
    case: dimensions.width >= 375 :
          return SmallUI();
    case: dimensions.width >= 425 :
          return SmallUI();
    case: dimensions.width >= 768 :
          return LargeUI();
 
  }  
}
)

The UI will rebuild when the dimension changes The desktopMode should be deprecated after this and NavigationRail should be rendered on devices above md.

maheshj01 avatar Jul 20 '24 13:07 maheshj01