flutter 抖动:如何从bottonNavBar中删除背景颜色?

vnjpjtjt  于 2023-02-25  发布在  Flutter
关注(0)|答案(1)|浏览(211)

这里我想删除我的bottomNavigationBar bgColor,

当我使用“extendBody:true”则i我的容器项不滚动

这是我的准则。

import 'package:flutter/material.dart';

import '../CheckOutPage/Components/pizza_ordered_card.dart';
import '../Utils/GlobalColor/global_color.dart';
import '../Utils/GlobalTextStyles/global_text_styles.dart';
import '../Utils/GlobalWidgetPages/app_bar_center_text.dart';

class OrderHistoryDetailsPage extends StatefulWidget {

  const OrderHistoryDetailsPage({Key? key, this.orderData}) : super(key: key);

  @override
  State<OrderHistoryDetailsPage> createState() =>
      _OrderHistoryDetailsPageState();
}

class _OrderHistoryDetailsPageState extends State<OrderHistoryDetailsPage> {
  

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: MyColor.bgLightColor,
      appBar: AppBarWithCenterText(
        text: "Order History",
        onPressed: () {
          Navigator.pop(context);
        },
      ),
      body: Container(),      // inside item not scrolling when extendBody: true using 
      bottomNavigationBar: Column(
        mainAxisSize: MainAxisSize.min,
        children: [
          Container(
            color: Colors.transparent,
            child: Container(
              padding: EdgeInsets.only(top: 17, bottom: 14),
              decoration: new BoxDecoration(
                color: MyColor.whiteColor,
                borderRadius: BorderRadius.only(
                    topRight: Radius.circular(15),
                    topLeft: Radius.circular(15)),
                boxShadow: [
                  BoxShadow(
                    color: MyColor.blackColor.withOpacity(0.2),
                    blurRadius: 10.0,
                  ),
                ],
              ),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Padding(
                    padding: const EdgeInsets.only(
                        left: 20.0, right: 20, bottom: 15),
                    child: Text(
                      "Price Details",
                      style: textStyleWith16500(MyColor.blackColor),
                    ),
                  ),
                  Divider(
                    color: MyColor.greyColor,
                    height: 0.5,
                  ),
                  Padding(
                    padding: const EdgeInsets.only(
                        left: 20, right: 20, top: 12, bottom: 9),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text(
                          "Sub Total",
                          style: textStyleWith12500(MyColor.darkGreyColor),
                        ),
                        Text(
                          "₹1095",
                          style: textStyleWith12500(MyColor.darkGreyColor),
                        ),
                      ],
                    ),
                  ),
                  Padding(
                    padding:
                        const EdgeInsets.only(left: 20, right: 20, bottom: 9),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text(
                          "Discount",
                          style: textStyleWith12500(MyColor.darkGreyColor),
                        ),
                        Text(
                          "- ₹10",
                          style: textStyleWith12500(MyColor.primaryRedColor),
                        ),
                      ],
                    ),
                  ),
                  Padding(
                    padding:
                        const EdgeInsets.only(left: 20, right: 20, bottom: 9),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text(
                          "Wallet",
                          style: textStyleWith12500(MyColor.darkGreyColor),
                        ),
                        Text(
                          "- ₹40",
                          style: textStyleWith12500(MyColor.primaryRedColor),
                        ),
                      ],
                    ),
                  ),
                  Padding(
                    padding:
                        const EdgeInsets.only(left: 20, right: 20, bottom: 9),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text(
                          "Taxes",
                          style: textStyleWith12500(MyColor.darkGreyColor),
                        ),
                        Text(
                          "₹4.95",
                          style: textStyleWith12500(MyColor.darkGreyColor),
                        ),
                      ],
                    ),
                  ),
                  Padding(
                    padding: const EdgeInsets.only(
                        left: 20, right: 20, top: 2, bottom: 10),
                    child: Divider(color: MyColor.greyColor, height: 0.5),
                  ),
                  Padding(
                    padding: const EdgeInsets.only(left: 20, right: 20),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text(
                          "Grand Total",
                          style: textStyleWith12600(MyColor.darkGreyColor),
                        ),
                        Text(
                          "₹1193",
                          style: textStyleWith12600(MyColor.greenColor),
                        ),
                      ],
                    ),
                  ),
                ],
              ),
            ),
          ),
        ],
      ),
    );
  }
}
brgchamk

brgchamk1#

若要删除底部导航栏的背景色,可以将BottomNavigationBar构件的backgroundColor属性设置为Colors.transparent。

相关问题