text stringlengths 1 372 |
|---|
final string name; |
final string price; |
final ImageProvider photoProvider; |
final bool isDepressed; |
@override |
widget build(BuildContext context) { |
return material( |
elevation: 12, |
borderRadius: BorderRadius.circular(20), |
child: padding( |
padding: const EdgeInsets.all(12), |
child: row( |
mainAxisSize: MainAxisSize.max, |
children: [ |
ClipRRect( |
borderRadius: BorderRadius.circular(12), |
child: SizedBox( |
width: 120, |
height: 120, |
child: center( |
child: AnimatedContainer( |
duration: const duration(milliseconds: 100), |
curve: Curves.easeInOut, |
height: isDepressed ? 115 : 120, |
width: isDepressed ? 115 : 120, |
child: image( |
image: photoProvider, |
fit: BoxFit.cover, |
), |
), |
), |
), |
), |
const SizedBox(width: 30), |
expanded( |
child: column( |
crossAxisAlignment: CrossAxisAlignment.start, |
children: [ |
text( |
name, |
style: Theme.of(context).textTheme.titleMedium?.copyWith( |
fontSize: 18, |
), |
), |
const SizedBox(height: 10), |
text( |
price, |
style: Theme.of(context).textTheme.titleMedium?.copyWith( |
fontWeight: FontWeight.bold, |
fontSize: 18, |
), |
), |
], |
), |
), |
], |
), |
), |
); |
} |
} |
class DraggingListItem extends StatelessWidget { |
const DraggingListItem({ |
super.key, |
required this.dragKey, |
required this.photoProvider, |
}); |
final GlobalKey dragKey; |
final ImageProvider photoProvider; |
@override |
widget build(BuildContext context) { |
return FractionalTranslation( |
translation: const offset(-0.5, -0.5), |
child: ClipRRect( |
key: dragKey, |
borderRadius: BorderRadius.circular(12), |
child: SizedBox( |
height: 150, |
width: 150, |
child: opacity( |
opacity: 0.85, |
child: image( |
image: photoProvider, |
fit: BoxFit.cover, |
), |
), |
), |
), |
); |
} |
} |
@immutable |
class item { |
const item({ |
required this.totalPriceCents, |
required this.name, |
required this.uid, |
required this.imageProvider, |
}); |
final int totalPriceCents; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.