rise_bite_ui 0.1.0
rise_bite_ui: ^0.1.0 copied to clipboard
Reusable Flutter UI components for food cards, animated detail screens, and image-rich product browsing experiences.
import 'package:flutter/material.dart';
import 'package:rise_bite_ui/rise_bite_ui.dart';
void main() {
runApp(const ExampleApp());
}
class ExampleApp extends StatelessWidget {
const ExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Rise Bite UI Example',
theme: AppTheme.lightTheme,
home: const ExampleHomeScreen(),
);
}
}
class ExampleHomeScreen extends StatelessWidget {
const ExampleHomeScreen({super.key});
@override
Widget build(BuildContext context) {
final items = _demoItems;
final textTheme = Theme.of(context).textTheme;
return Scaffold(
backgroundColor: AppTheme.backgroundColor,
appBar: AppBar(
title: const Text('Rise Bite UI'),
),
body: ListView.builder(
padding: const EdgeInsets.all(20),
itemCount: items.length,
itemBuilder: (context, index) {
final item = items[index];
return Padding(
padding: EdgeInsets.only(bottom: index == items.length - 1 ? 0 : 16),
child: FoodCard(
item: item,
onTap: () {
Navigator.push(
context,
MaterialPageRoute<void>(
builder: (_) => FoodDetailScreen(
item: item,
actionsBuilder: (context, currentItem) => IconButton(
onPressed: () {},
icon: const Icon(
Icons.favorite_border_rounded,
color: Colors.white,
),
),
ctaBuilder: (_, currentItem) {
return FilledButton(
onPressed: () {},
child: Text(
'Order ${currentItem.name.split(' ').first}',
),
);
},
),
),
);
},
),
);
},
),
bottomNavigationBar: SafeArea(
child: Padding(
padding: const EdgeInsets.fromLTRB(20, 0, 20, 20),
child: Text(
'Tap any card to open the reusable detail screen.',
textAlign: TextAlign.center,
style: textTheme.bodyMedium?.copyWith(
color: AppTheme.mutedTextColor,
),
),
),
),
);
}
}
const List<FoodItem> _demoItems = [
FoodItem(
id: '1',
name: 'Avocado Poached Egg Toast',
description:
'Sourdough toast layered with smashed avocado, perfectly poached eggs, chili flakes, and lemon zest for a protein-packed morning bite.',
price: 8.99,
rating: '4.9',
duration: '15-20 min',
image:
'https://images.unsplash.com/photo-1525351484163-7529414344d8?w=500&q=80',
images: [
'https://images.unsplash.com/photo-1525351484163-7529414344d8?w=1200&q=80',
'https://images.unsplash.com/photo-1482049016688-2d3e1b311543?w=1200&q=80',
'https://images.unsplash.com/photo-1509440159596-0249088772ff?w=1200&q=80',
],
),
FoodItem(
id: '2',
name: 'Fluffy Berry Pancakes',
description:
'Stacked buttermilk pancakes topped with fresh strawberries, blueberries, whipped cream, and a warm maple drizzle.',
price: 10.49,
rating: '4.8',
duration: '20-25 min',
image:
'https://images.unsplash.com/photo-1528207776546-365bb710ee93?auto=format&fit=crop&w=1200&q=80',
images: [
'https://images.unsplash.com/photo-1528207776546-365bb710ee93?auto=format&fit=crop&w=1200&q=80',
'https://images.unsplash.com/photo-1506084868230-bb9d95c24759?auto=format&fit=crop&w=1200&q=80',
'https://images.unsplash.com/photo-1519676867240-f03562e64548?auto=format&fit=crop&w=1200&q=80',
],
),
];