Flutter - Попытка SingleChildScrollПросмотреть виджет Positioned () - PullRequest
0 голосов
/ 26 марта 2020

Добрый день,

Есть ли способ для Positioned внутри стека иметь родителя для SingleChildscrollView и, таким образом, сделать его прокручиваемым? Но только это позиционируется, а не выше в коде? Я уверен, что ошибка в том, что у Positioned есть вершина: 375.0, которая не позволяет его прокручивать. Может быть, есть работа?

Пожалуйста, помогите мне!

    return Scaffold(
      key: scaffoldKey,
      drawer: AppDrawer(),
      body: Container(
        height: 2000,
        width: screenSize.width,
        child: Stack(
          // overflow: Overflow.visible,
          children: <Widget>[
            Image.asset(
              "$img",
              height: 450.0,
              width: 375.0,
              fit: BoxFit.cover,
            ),
            Positioned(
              top: 50.0,
              left: 10.0,
              child: GestureDetector(
                onTap: () {
                  Navigator.push(
                    context,
                    MaterialPageRoute(
                      builder: (context) {
                        return Overview();
                      },
                    ),
                  );
                },
                child: Icon(
                  Icons.arrow_back_ios,
                  color: Colors.white,
                  size: 30.0,
                ),
              ),
            ),
            Positioned(
              top: 50.0,
              right: 10.0,
              child: GestureDetector(
                  onTap: () => scaffoldKey.currentState.openDrawer(),
                  child: Icon(
                    Icons.menu,
                    color: Colors.white,
                    size: 30.0,
                  )),
            ),
            Positioned(
              top: 375.0,
              child: SingleChildScrollView(
                child: Container(
                  height: 1000,
                  width: screenSize.width,
                  decoration: BoxDecoration(
                    color: Color.fromRGBO(216, 216, 216, 1),
                    borderRadius: BorderRadius.only(
                      topLeft: Radius.circular(30.0),
                      topRight: Radius.circular(30.0),
                    ),
                  ),
                  child: Padding(
                    padding: const EdgeInsets.all(25.0),
                    child: Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: <Widget>[
                        Text(
                          titleTop,
                          style: TextStyle(
                            color: Colors.black,
                            fontSize: 26.0,
                            fontWeight: FontWeight.bold,
                          ),
                        ),
                        SizedBox(
                          height: 40.0,
                        ),
                        Text(
                          'Description',
                          style: TextStyle(
                            fontSize: 18.0,
                            fontWeight: FontWeight.w500,
                            color: Color.fromRGBO(50, 54, 67, 1),
                          ),
                        ),
                        SizedBox(
                          height: 20.0,
                        ),
                        Text(
                          textDes,
                          style: TextStyle(
                            fontSize: 16.0,
                            color: Color.fromRGBO(117, 117, 117, 1),
                          ),
                        ),
                      ],
                    ),
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
...