### ======================== Bloc State Management =====================

**_Equatable Bloc Package_**

- hashcode => Its give you hashcode value where your variable || Instance store

### ========================== ListView ============================

- There are 4 main types of ListView you should know. Each one is used for a different situation.

1. **_ListView (Default Constructor)_**

- You have a small number of items
- All items are already known
- The list won't change dynamically
- Ex:-

```dart
  ListView(
      children: [
          ListTile(title: Text("Apple")),
          ListTile(title: Text("Banana")),
          ListTile(title: Text("Mango")),
      ],
  )
```

- Why? - Simple - Easy to write - But not memory efficient for large lists

2. **_ListView.builder (Most Important)_**

- The list is large
- Data comes from API / database
- Items are dynamic
- Ex:-

```dart
        ListView.builder(
            itemCount: 100,
            itemBuilder: (context, index) {
                return ListTile(
                title: Text("Item $index"),
                );
        },
    )
```

- Why? - Best performance - Builds items only when they appear on screen - Saves memory and CPU
- Examples - Chat apps - Product lists - News feeds - Instagram -like feeds

3. **_ListView.separated_**

- Use this when you need space or divider between items.
- Ex:-

```dart
      ListView.separated(
          itemCount: 10,
          itemBuilder: (context, index) {
              return ListTile(
                  title: Text("Item $index"),
              );
          },
          separatorBuilder: (context, index) {
              return Divider();
          },
      )
```

- Why? - Automatically adds separator widgets - Cleaner than manually adding dividers
- Examples - Settings screens - Contact lists - Menu lists

4. **_ListView.custom (Advanced)_**

- You need full control
- Working with Slivers
- Building highly optimized or complex lists
- Ex:-

```dart
      ListView.custom(
          childrenDelegate: SliverChildBuilderDelegate(
              (context, index) => ListTile(title: Text("Item $index")),
              childCount: 50,
          ),
      )
```

- Links['https://chatgpt.com/c/69b25cd9-a17c-8321-a7c7-831496b8117e'] - study about that
- Why? - Advanced control - Used in custom scrolling behaviors
- Examples - Settings screens - Contact lists - Menu lists

5. **_ListView.custom (Advanced)_** - Search About That and Understand
6. **_GridView.builder_** - Search About That and Understand

@override
void didUpdateWidget(covariant AppDownUpPanel oldWidget) {
super.didUpdateWidget(oldWidget);

    if (oldWidget.minHeightFactor != widget.minHeightFactor ||
        oldWidget.maxHeightFactor != widget.maxHeightFactor) {
      _currentHeightFactor = widget.minHeightFactor;

      WidgetsBinding.instance.addPostFrameCallback((_) {
        _animateTo(widget.minHeightFactor);
      });
    }

}

check this na

- LayoutBuilder -> check this also

- Quick Navigation Rules
  Method Behavior
  pushNamed keeps previous screen (best for TabBar apps)
  pushReplacementNamed replaces previous screen
  pop go back
  pushAndRemoveUntil clear stack

