bottom_safebar.dart 989 B

123456789101112131415161718192021222324252627282930
  1. import 'package:douyin_demo/providers/recommend_provider.dart';
  2. import 'package:douyin_demo/widgets/bottom_bar.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:provider/provider.dart';
  5. class BottomSafeBar extends StatelessWidget {
  6. const BottomSafeBar({Key? key, required this.selIndex}) : super(key: key);
  7. final int selIndex;
  8. @override
  9. Widget build(BuildContext context) {
  10. RecommendProvider provider = Provider.of<RecommendProvider>(context);
  11. // double toBottom=MediaQuery.of(context).viewInsets.bottom;
  12. return Container(
  13. // padding: EdgeInsets.only(top:toBottom),
  14. decoration: BoxDecoration(color: Colors.black),
  15. child: SafeArea(
  16. child: BottomAppBar(
  17. child: Container(
  18. decoration: BoxDecoration(color: Colors.black),
  19. height: 60,
  20. // decoration: BoxDecoration(color: Colors.black),
  21. child: BtmBar(
  22. selectIndex: selIndex,
  23. ),
  24. ),
  25. )),
  26. );
  27. }
  28. }