CopyPastor

Detecting plagiarism made easy.

Score: 0.8021526625104239; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2022-06-11
by Abdallah A. Odeh

Original Post

Original - Posted on 2018-06-12
by chemamolins



            
Present in both answers; Present only in the new answer; Present only in the old answer;

That's because top widget in the stack, stack works as a layers, the last child in the `children` list will be the greatest `zIndex` one, so any widget below it is not accessible, you need to `bring it to front` to activate the click, swap the children and making the `InkWell`'s positioned Widget the last child in the children will solve your issue
Stack( children: [ SizedBox( height: 250, child: PageView.builder( padEnds: false, controller: _controller, itemBuilder: (context, index) { return Opacity( opacity: index <= _firstItemIndex ? 0 : 1, child: PageViewItem( index: index,
width: _itemWidth, url: model[index],
), ); }, itemCount: model.length, ), ), Positioned.fill( child: Align( alignment: Alignment.centerLeft, child: SizedBox( width: _itemWidth, child: FractionallySizedBox( child: InkWell( onTap: () => debugPrint("clicked"), ///this part not works child: PageViewItem( index: _firstItemIndex, width: _itemWidth, url: model[_firstItemIndex], ), ), ), ), ), ), ], ),
The Problem is the Container that gets the smallest possible size.
Just give a `width:` to the Container (in red) and you are done.
`width: MediaQuery.of(context).size.width`

[![enter image description here][1]][1]

new Positioned( bottom: 0.0, child: new Container( width: MediaQuery.of(context).size.width, color: Colors.red, margin: const EdgeInsets.all(0.0), child: new Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ new Align( alignment: Alignment.bottomCenter, child: new ButtonBar( alignment: MainAxisAlignment.center, children: <Widget>[ new OutlineButton( onPressed: null, child: new Text( "Login", style: new TextStyle(color: Colors.white), ), ), new RaisedButton( color: Colors.white, onPressed: null, child: new Text( "Register", style: new TextStyle(color: Colors.black), ), ) ], ), ) ], ), ), ),
[1]: https://i.stack.imgur.com/CYvmz.png

        
Present in both answers; Present only in the new answer; Present only in the old answer;