FLUTTER ECOSYSTEM

RoundedInfinity/cupertino_sidebar

iOS 사이드바와 플로팅 탭 바를 추가하는 Flutter 패키지입니다.

cupertino_sidebar 프로젝트 이미지
Stars
28
Forks
2
최근 푸시(UTC)
2024. 11. 9.
프로젝트 상태
활성
Ruben Gullatz GitHub avatar
GITHUB User

Ruben Gullatz ↗

B.Sc. Student in Medical Informatics

Germany
언어DartC++CMakeSwiftCHTMLKotlinObjective-C

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 3 개
  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}
  • very_good_analysis개발 의존성^6.0.0

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

Cupertino Sidebar

cupertino_sidebar brings iOS-style sidebars and floating tab bars to Flutter, providing a sleek, native feel for iPadOS-style navigation in your app.

Features

Cupertino Sidebar

Cupertino Sidebar

A iOS-style sidebar that can be used to navigate through your app.

Cupertino Floating Tab Bar

Cupertino Floating Tab Bar

A iPadOS-style floating tab bar that can also be used to navigate through your app.

📖 Usage

Sidebar

The CupertinoSidebar works very similar to Flutter's NavigationDrawer. It accepts a list of destinations, a selected index, and a callback function triggered when a destination is tapped.

CupertinoSidebar(
  selectedIndex: _selectedIndex,
  onDestinationSelected: (value) {
    setState(() {
      // Update the selected index when a destination is selected.
      _selectedIndex = value;
    });
  },
  children: [
    // index 0
    SidebarDestination(
      icon: Icon(CupertinoIcons.home),
      label: Text('Home'),
    ),
    // index 1
    SidebarDestination(
      icon: Icon(CupertinoIcons.person),
      label: Text('Items'),
    ),
    // index 2
    SidebarDestination(
      icon: Icon(CupertinoIcons.search),
      label: Text('Search'),
    ),
  ],
);

CupertinoSidebar also supports expandable sections, allowing you to group destinations.

...
children: [
    ...
   SidebarSection(
      label: Text('My section'),
      children: [
        SidebarDestination(
          icon: Icon(CupertinoIcons.settings),
          label: Text('Settings'),
        ),
        ...
      ],
    ),
]

For a full example, see the Sidebar example.

Floating Tab Bar

The CupertinoFloatingTabBar is managed by a TabController, with options to add tabs and specify a callback function.

CupertinoFloatingTabBar(
  onDestinationSelected: (value) {},
  controller: _myTabController,
  tabs: const [
    CupertinoFloatingTab(
      child: Text('Today'),
    ),
    CupertinoFloatingTab(
      child: Text('Library'),
    ),
    CupertinoFloatingTab.icon(
      icon: Icon(CupertinoIcons.search),
    ),
  ],
)

For a full example, see the Tab Bar example.

Additional examples

📅 Roadmap

This package is actively being developed. Planned features include:

  • Tab bar to sidebar transition
  • Adaptive scaffold that switches between a sidebar and a floating tab bar and a bottom tab bar depending on the screen size.

🤝 Contributing

Contributions are welcome! Feel free to submit issues, ideas, or pull requests. Together, we can make cupertino_sidebar even better!