import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:food_health/api/dto/food_scan_dto.dart';

import 'widget/detailed_analysis.dart';
import 'widget/health_recommend.dart';
import 'widget/result_chip.dart';

class RecordDetailPage extends StatefulWidget {
  final FoodScanDto detail;

  const RecordDetailPage({super.key, required this.detail});

  @override
  State<RecordDetailPage> createState() => _RecordDetailPageState();
}

class _RecordDetailPageState extends State<RecordDetailPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.transparent,
        systemOverlayStyle: SystemUiOverlayStyle(
          statusBarIconBrightness: Brightness.dark, // 状态栏图标深色
          statusBarBrightness: Brightness.light, // iOS
        ),
      ),
      body: ListView(
        padding: const EdgeInsets.only(left: 15, right: 15, bottom: 15),
        children: [
          ResultChip(detail: widget.detail),
          DetailedAnalysis(detail: widget.detail),
          HealthRecommend(
            detail: widget.detail,
          ),
        ],
      ),
    );
  }
}
