'Pageview Slide , I can't insert the image into the top and change the size
I would like to perform a pageview slide but when I try to insert the images inside the container they are in the center and I can not put them on top or even I can resize the images when I put in the pageview , someone would have an example or hicsun for this problem
class MyApp extends StatelessWidget {
const MyApp({ Key? key }) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp
(
home:Scaffold(
body: Column(
children: [
Expanded(
child: PageView(
children: [
Image(image:AssetImage('assets/tic.png'))
],
),
)
],
)
)
)
;
}
}
Solution 1:[1]
you can use a widget under the PageView
body: Column(
children: [
Expanded(
flex: 2,
child: PageView(
children: const [
FlutterLogo(
size: 10,
),
Icon(Icons.ac_unit),
],
),
),
Expanded(
flex: 1,
child: Container(
color: Colors.purple,
child: Text('Salam'),
),
)
],
),
you can use flex
to adjust the PageView
in screen.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Hadi |