import 'package:flutter/material.dart'; import 'package:flutter_provider_demo/provider/car_provider.dart'; import 'package:flutter_provider_demo/views/carlist.dart'; import 'package:provider/provider.dart'; /// Description: /// Time : 09/04/2023 Monday /// Author : liuyuqi.gov@msn.cn class AllCarsTab extends StatelessWidget { const AllCarsTab({super.key}); @override Widget build(BuildContext context) { return Consumer( builder: (context, cars, _) => cars.allCars.isNotEmpty ? CarList( cars: cars.allCars, ) : const Center( child: Text( 'There are no cars', style: TextStyle( fontSize: 25.0, ), ), ), ); } }