unready_cars.dart 755 B

123456789101112131415161718192021222324252627
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_provider_demo/provider/car_provider.dart';
  3. import 'package:flutter_provider_demo/views/carlist.dart';
  4. import 'package:provider/provider.dart';
  5. class UnReadyCarsTab extends StatelessWidget {
  6. const UnReadyCarsTab({super.key});
  7. @override
  8. Widget build(BuildContext context) {
  9. return Consumer<CarProvider>(
  10. builder: (context, cars, _) => cars.unStartedCars.isNotEmpty
  11. ? CarList(
  12. cars: cars.unStartedCars,
  13. )
  14. : const Center(
  15. child: Text(
  16. 'There are no incomplete tasks',
  17. style: TextStyle(
  18. fontSize: 25.0,
  19. ),
  20. ),
  21. ),
  22. );
  23. }
  24. }