import 'package:flutter/material.dart';
import 'package:netrain_flutter_app/xuehao/Car.dart';

/**
 * @author xuehao
 * on 2021/7/9
 */
class CarDetailsPage extends StatefulWidget {
  @override
  _CarDetailsState createState() => _CarDetailsState();
}

class _CarDetailsState extends State<CarDetailsPage> {
  Car args;
  @override
  Widget build(BuildContext context) {
    args = ModalRoute.of(context).settings.arguments;

    return MaterialApp(
      title: "car_details",
      home: Scaffold(
        appBar: AppBar(
          title: Text("汽车详情"),
          centerTitle: true,
          leading: new IconButton(
              onPressed: () {
                Navigator.pop(context);
              },
              icon: Icon(Icons.arrow_back_ios)),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text(args.name),
              Image.network(args.imageUrl),
            ],
          ),
        ),
      ),
    );
  }
}
