drink_detail.dart 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_cocktail/model/config.dart';
  3. class DrinkDetail extends StatelessWidget {
  4. final drink;
  5. const DrinkDetail({super.key, required this.drink});
  6. @override
  7. Widget build(BuildContext context) {
  8. return Container(
  9. decoration: const BoxDecoration(
  10. gradient: LinearGradient(colors: [
  11. myColor,
  12. Colors.orange,
  13. ])),
  14. child: Scaffold(
  15. backgroundColor: Colors.transparent,
  16. appBar: AppBar(
  17. backgroundColor: Colors.transparent,
  18. title: Text(drink["strDrink"]),
  19. elevation: 0.0,
  20. ),
  21. body: Center(
  22. child: Column(
  23. mainAxisAlignment: MainAxisAlignment.center,
  24. children: <Widget>[
  25. Hero(
  26. tag: drink["idDrink"],
  27. child: CircleAvatar(
  28. radius: 100.0,
  29. backgroundImage: NetworkImage(
  30. drink["strDrinkThumb"],
  31. ),
  32. ),
  33. ),
  34. const SizedBox(
  35. height: 30.0,
  36. ),
  37. Text(
  38. "ID: ${drink["idDrink"]}",
  39. style: const TextStyle(
  40. color: Colors.white,
  41. ),
  42. ),
  43. const SizedBox(
  44. height: 30.0,
  45. ),
  46. Text(
  47. "${drink["strDrink"]}",
  48. style: const TextStyle(
  49. fontSize: 22,
  50. color: Colors.white,
  51. ),
  52. )
  53. ],
  54. ),
  55. ),
  56. ),
  57. );
  58. }
  59. }