food_list 0.1.0 copy "food_list: ^0.1.0" to clipboard
food_list: ^0.1.0 copied to clipboard

A flutter package for show a beautiful list Foods .

List Foods Package #

pub version Platform

A Flutter package to display a beautiful, customizable list of food cards with images, titles, prices, and interaction callbacks.

✨ Features #

  • Horizontal & Vertical Lists: Easily switch between horizontal and vertical scrolling layouts.
  • Customizable Food Card: Display food image, name, price, and currency.
  • Interaction Callback: Handle taps with a controller callback.
  • Lightweight & Dependency-Free: Pure Dart/Flutter implementation.

🖼 Screenshots #

Screen 1 Screen 2
Screen 3 Screen 4
Screen 5 Screen 6
Screen 7

🚀 Installation #

Add the latest version of food_list to your pubspec.yaml dependencies:

dependencies:
  food_list: ^1.0.0

Then run:

flutter pub get

💻 Usage #

Import the package and use one of two main widgets:

import 'package:flutter/material.dart';
import 'package:food_list/food_list.dart';

class MyFoodDemo extends StatelessWidget {
  const MyFoodDemo({Key? key}) : super(key: key);

  void _onFoodSelected(FoodCardController controller) {
    debugPrint(
      'Selected: ${controller.foodName} - ${controller.price} ${controller.currency.currency}',
    );
    // Access image via controller.foodImage.image
  }

  @override
  Widget build(BuildContext context) {
    final items = <FoodCard>[
      FoodCard(
        foodName: 'Burger',
        foodImage: ImageFoods.burger,
        price: '10',
        currency: CurrencyFood.dollar,
        listen: _onFoodSelected,
      ),
      // Add more FoodCard items...
    ];

    return Column(
      children: [
        // Horizontal list
        ListFoodsHorizontal(
          itemCount: items.length,
          items: items,
          color: Colors.white70,
        ),

        const SizedBox(height: 24),

        // Vertical list
        ListFoodsVertical(
          itemCount: items.length,
          items: items,
          color: Colors.white70,
        ),
      ],
    );
  }
}

Widget Parameters #

Widget Parameter Type Description
ListFoodsHorizontal itemCount int Number of items
items List<FoodCard> List of FoodCard models
color Color Background color for cards
ListFoodsVertical itemCount int Number of items
items List<FoodCard> List of FoodCard models
color Color Background color for cards

🤝 Contributing #

Contributions, issues, and feature requests are welcome! Feel free to open an issue or submit a pull request.

📄 License #

This project is licensed under the MIT License - see the LICENSE file for details.


Made with ❤️ by NanoLifeM

2
likes
30
points
57
downloads

Publisher

unverified uploader

Weekly Downloads

A flutter package for show a beautiful list Foods .

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

flutter, visibility_detector

More

Packages that depend on food_list