मैं स्पंदन के लिए नया हूँ। मैं नीचे की छवि के रूप में डिजाइन करने की कोशिश कर रहा हूं। लेकिन मैं पंक्ति के अंदर की वस्तुओं को संरेखित नहीं कर सका और छवि में नीचे दिए गए लेआउट को पसंद करने के लिए आकार नहीं दे सका। मैंने mainAxisAlignment और crossAxisAlignment जैसे गुण देने की कोशिश की है, लेकिन नीचे दी गई छवि के अनुसार अपेक्षित परिणाम नहीं मिल सका।

enter image description here

केवल मैं नीचे छवि प्राप्त करने में सक्षम था।

enter image description here

मैंने अपना कोड निम्नानुसार कार्यान्वित किया है:

    Container(
                              child: Column(
                                crossAxisAlignment:
                                    CrossAxisAlignment.start,
                                children: <Widget>[
                                  Checkbox(
                                      checkColor: Colors.white,
                                      activeColor: Colors.green,
                                      value: true,
                                      onChanged: (value) {
                                        print(value);
                                      }),
                                  Row(
                                    mainAxisSize: MainAxisSize.max,
                                    mainAxisAlignment:
                                        MainAxisAlignment.start,
                                    crossAxisAlignment:
                                        CrossAxisAlignment.start,
                                    children: <Widget>[
                                      Container(
                                          decoration: BoxDecoration(
                                              color: Colors.white,
                                              borderRadius:
                                                  BorderRadius.all(
                                                      Radius.circular(20))),
                                          child: Image.network(
                                            bannerWomenFashion[i],
                                            height: 100,
                                            width: 100,
                                            fit: BoxFit.scaleDown,
                                          )),
                                      SizedBox(
                                        width: 10,
                                      ),
                                      Expanded(
                                        child: Column(
                                          crossAxisAlignment:
                                              CrossAxisAlignment.start,
                                          mainAxisAlignment:
                                              MainAxisAlignment.start,
                                          children: <Widget>[
                                            Text(
                                              "Rs 1200",
                                              style: TextStyle(
                                                  color: CustomColor
                                                      .themeSecondary,
                                                  fontSize: 18,
                                                  fontWeight:
                                                      FontWeight.bold),
                                            ),
                                            SizedBox(
                                              height: 5,
                                            ),
                                            Text(
                                              "The Pursuit of Happiness",
                                              style: TextStyle(
                                                  color: Colors.blueGrey,
                                                  fontSize: 20,
                                                  fontWeight:
                                                      FontWeight.bold),
                                            ),
                                            SizedBox(
                                              height: 5,
                                            ),
                                            Text("ID: #254217",
                                                style: cartBlueGreyStyle),
                                          ],
                                        ),
                                      ),
                                      Expanded(
                                          child: Row(
                                        mainAxisSize: MainAxisSize.max,
                                        mainAxisAlignment:
                                            MainAxisAlignment.spaceBetween,
                                        crossAxisAlignment:
                                            CrossAxisAlignment.end,
                                        children: <Widget>[
                                          Row(
                                            children: <Widget>[
                                              Icon(
                                                Icons.remove,
                                                size: 25,
                                                color: Colors.blueGrey,
                                              ),
                                              Container(
                                                  width: 30,
                                                  height: 25,
                                                  decoration: BoxDecoration(
                                                    borderRadius:
                                                        BorderRadius
                                                            .circular(10),
                                                    color: Colors.white,
                                                    boxShadow: [
                                                      BoxShadow(
                                                          color:
                                                              Colors.grey,
                                                          spreadRadius: 2),
                                                    ],
                                                  ),
                                                  child: Center(
                                                      child: Text("1"))),
                                              Icon(
                                                Icons.add,
                                                size: 25,
                                                color: Colors.blueGrey,
                                              ),
                                            ],
                                          ),
                                        ],
                                      )),
                                      Container(
                                          width: 30,
                                          height: 30,
                                          decoration: BoxDecoration(
                                            borderRadius:
                                                BorderRadius.circular(20),
                                            color: Colors.white,
                                            boxShadow: [
                                              BoxShadow(
                                                  color: Colors.white,
                                                  spreadRadius: 2),
                                            ],
                                          ),
                                          child: Center(
                                            child: Icon(Icons.clear,
                                                color: Colors.blueGrey),
                                          )),
                                    ],
                                  ),
                                ],
                              ),
                            );
0
Nbn 13 अक्टूबर 2020, 20:38

1 उत्तर

सबसे बढ़िया उत्तर

enter image description here

Container(
  padding: EdgeInsets.all(32.0),
  child: IntrinsicHeight(
    child: Row(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: <Widget>[
        Stack(
          overflow: Overflow.visible,
          children: [
            Container(
              padding: EdgeInsets.all( 8.0),
                decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(12))),
                child: Image.network(
                  'http://covertopia.com/wp-content/uploads/2015/05/000227_Alt.jpg'
                  /*bannerWomenFashion[i]*/,
                  height: 100,
                  fit: BoxFit.scaleDown,
                )),
            Positioned(
              top: -12,
              left: -12,
              child: Container(
                width: 32,
                height: 32,
                decoration: BoxDecoration(color: Colors.green, borderRadius: BorderRadius.all(Radius.circular(12))),
                child: Checkbox(
                    checkColor: Colors.white,
                    activeColor: Colors.green,
                    value: true,
                    onChanged: (value) {
                      print(value);
                    }),
              ),
            )
          ],
        ),
        SizedBox(
          width: 10,
        ),
        Expanded(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,

            children: <Widget>[
              Text(
                "Rs 1200",
                style: TextStyle(
                    color: Colors.red /*CustomColor
                        .themeSecondary*/
                    ,
                    fontSize: 18,
                    fontWeight: FontWeight.bold),
              ),
              SizedBox(height: 10,),
              Expanded(
                child: Align(
                  alignment: Alignment.centerLeft,
                  child: Text(
                    "The Pursuit of Happiness",
                    style: TextStyle(color: Colors.blueGrey, fontSize: 20, fontWeight: FontWeight.bold),
                  ),
                ),
              ),
              SizedBox(height: 10,),
              Row(
                children: [
                  Text("ID: #254217", style: TextStyle(color: Colors.grey, fontWeight: FontWeight.bold) /*cartBlueGreyStyle*/),
                  Spacer(),
                  Row(
                    children: <Widget>[
                      Icon(
                        Icons.remove,
                        size: 25,
                        color: Colors.blueGrey,
                      ),
                      Container(
                          width: 30,
                          height: 25,
                          margin: EdgeInsets.symmetric(horizontal: 8),
                          decoration: BoxDecoration(
                            borderRadius: BorderRadius.circular(10),
                            color: Colors.white,
                            boxShadow: [
                              BoxShadow(color: Colors.blueGrey.withOpacity(0.1), spreadRadius: 2),
                            ],
                          ),
                          child: Center(child: Text("1"))),
                      Icon(
                        Icons.add,
                        size: 25,
                        color: Colors.blueGrey,
                      ),
                    ],
                  )
                ],
              ),
            ],
          ),
        ),
        Container(
            width: 30,
            height: 30,
            margin: EdgeInsets.symmetric(horizontal: 8),
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(20),
              color: Colors.white,
              boxShadow: [
                BoxShadow(color: Colors.white, spreadRadius: 2),
              ],
            ),
            child: Center(
              child: Icon(Icons.clear, color: Colors.blueGrey,size: 16,),
            )),
      ],
    ),
  ),
);
1
karzan kamal 13 अक्टूबर 2020, 20:58