Create curved card with shadow - flutter

I really need you because I don't have even start idea how to implement these, and also I am not sure how it is called.
Actually, I want to implement something similar like on image (this little circle in each of cards - that is like chain between two cards).
With help of key I have made image from up with this code:
class InfoPage extends StatefulWidget {
InfoPage();
#override
_InfoPageState createState() => _InfoPageState();
}
class _InfoPageState extends State<InfoPage> {
InfoItemModel infoData = dataSourceInfoUser;
double basicSize = 70;
#override
initState() {
super.initState();
}
#override
Widget build(BuildContext context) => Scaffold(
appBar: AppBar(
title: Text('Example'),
),
body: Container(
color: Colors.white,
child: SingleChildScrollView(
child: Column(
children: <Widget>[
Container(
width: double.infinity,
height: 150,
child: AppCardField(
child: Text('Something'),
),
),
_buildCardWithCircle(
bgCircleX: 0.78,
bgCirceY: -2.0,
innerContainerX: 0.756,
innerContainerY: -1.78,
colorInner: Colors.orange
),
],
),
),
),
);
_buildCardWithCircle({double bgCircleX, double bgCirceY, double innerContainerX, double innerContainerY, Color colorInner}) => Container(
width: double.infinity,
height: 150,
child: Stack(
children: <Widget>[
Container(
width: double.infinity,
height: 150,
child: AppCardField(
child: Text('Something'),
),
),
Align(
alignment: Alignment(bgCircleX, bgCirceY),
child: Container(
height: basicSize,
width: basicSize,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(50.0),
),
),
),
Align(
alignment: Alignment(innerContainerX, innerContainerY),
child: Container(
height: basicSize - 10,
width: basicSize - 10,
decoration: BoxDecoration(
color: colorInner,
borderRadius: BorderRadius.circular(50.0),
),
child: Icon(Icons.vertical_align_center),
),
),
],
),
);
}
class AppCardField extends StatelessWidget {
final Widget child;
final double height;
final double paddingVertical, paddingHorizontal;
final double paddingVerticalChild, paddingHorizontalChild;
AppCardField({
this.child,
this.height,
this.paddingVertical = 8,
this.paddingHorizontal = 16,
this.paddingVerticalChild = 8,
this.paddingHorizontalChild = 16,
Key key})
: super(key: key);
#override
Widget build(BuildContext context) => Padding(
padding: EdgeInsets.symmetric(
vertical: paddingVertical, horizontal: paddingHorizontal),
child: Container(
height: height,
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.all(Radius.circular(8)),
boxShadow: [
BoxShadow(
color: Colors.red,
blurRadius: 15.0,
offset: Offset(0.0, 5.0),
),
],
),
child: Padding(
padding: EdgeInsets.symmetric(
vertical: paddingVerticalChild,
horizontal: paddingHorizontalChild),
child: child,
),
));
}
But here, I have problem with shadow of the card and strongly white background of circle, OFC I need this shadow to be also in this white space, question is how to solve this?

Something like this
MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text("Some Stuff"),
),
body: Column(
children: <Widget>[
Container(
width: double.infinity,
height: 150.0,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.red,
blurRadius: 20.0
)
]
),
child: Card(
elevation: 20.0,
color: Colors.blueGrey,
child: Text('Something'),
),
),
SizedBox(height: 10.0,),
Container(
width: double.infinity,
height: 150.0,
child: Stack(
children: <Widget>[
Container(
width: double.infinity,
height: 150.0,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.red,
blurRadius: 20.0
)
]
),
child: Card(
elevation: 20.0,
color: Colors.blueGrey,
child: Text('Something'),
),
),
Align(
alignment: Alignment(0.9,-1.5),
child: Container(
height: 50.0,
width: 50.0,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(25.0),
),
),
),
Align(
alignment: Alignment(0.88,-1.35),
child: Container(
height: 40.0,
width: 40.0,
decoration: BoxDecoration(
color: Colors.orange,
borderRadius: BorderRadius.circular(25.0),
),
),
),
Align(
alignment: Alignment(0.85, -1.2),
child: Icon(Icons.access_alarms, color: Colors.white,)
),
],
),
),
],
),
),
);
then you just reaped the card for the other once with different alignment values.

Related

List scrolls under SliverAppBar, but shouldn't be visible

As you can see in Picture 1 & 2 the List scrolls under the transparent SliverAppBar. Is there any possibility to let the SliverAppBar stay transparent and don't show the List underneath?
(As you can see in Picture 1 & 2 the List scrolls under the transparent SliverAppBar. Is there any possibility to let the SliverAppBar stay transparent and don't show the List underneath?)
// ignore_for_file: unused_local_variable
import 'dart:ui';
import 'package:flutter/material.dart';
class MyHomePage extends StatefulWidget {
MyHomePage({Key? key, this.title = "Hallo"}) : super(key: key);
final String title;
#override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
#override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
decoration: BoxDecoration(
image: DecorationImage(
alignment: Alignment.topRight,
image: AssetImage("lib/assets/images/Bg.png"),
),
),
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
alignment: Alignment.topRight,
image: AssetImage(
"lib/assets/images/Bg2.png",
),
scale: 1.05,
),
),
child: NestedScrollView(
headerSliverBuilder: (context, innerBoxISScrolled) => [
SliverAppBar(
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(30),
),
),
backgroundColor: Colors.transparent,
automaticallyImplyLeading: false,
floating: true,
snap: false,
pinned: true,
title: //Startseite
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Startseite",
style: TextStyle(color: Colors.black),
),
//Notification
Row(
children: [
Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Color.fromARGB(255, 197, 193, 193),
Color.fromARGB(255, 167, 156, 156)
.withOpacity(0.8),
],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
borderRadius: BorderRadius.circular(12)),
padding: EdgeInsets.all(2),
child: Icon(Icons.notifications),
),
SizedBox(width: 10),
//Profile
ClipOval(
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Color(0xFFFFFFFF),
Color(0xFF000000).withOpacity(0),
],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
borderRadius: BorderRadius.circular(16),
),
padding: EdgeInsets.all(10),
child: Container(
width: MediaQuery.of(context).size.width * 0.06,
height: MediaQuery.of(context).size.height * 0.03,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
image: DecorationImage(
image: ExactAssetImage(
'lib/assets/images/baki.jpg'),
fit: BoxFit.fill,
),
),
),
),
),
],
),
],
),
bottom: AppBar(
elevation: 0,
automaticallyImplyLeading: false,
backgroundColor: Colors.transparent,
title: Container(
decoration:
BoxDecoration(borderRadius: BorderRadius.circular(12)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.only(bottom: 10.0),
child: Stack(
children: [
Padding(
padding: const EdgeInsets.only(top: 3.0),
child: Container(
width:
MediaQuery.of(context).size.width * 0.5,
height: MediaQuery.of(context).size.height *
0.025,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Color(0xFF4B4646).withOpacity(0.6),
Color(0xFFFFFFFF).withOpacity(0.2),
],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
borderRadius: BorderRadius.circular(12),
),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 5.0),
child: Padding(
padding: const EdgeInsets.only(left: 4.0),
child: Text(
"Suchen",
textAlign: TextAlign.start,
style: TextStyle(
fontFamily: "Acme-Regular",
color: Colors.grey.shade200,
fontSize: 10),
),
),
),
),
),
Padding(
padding: const EdgeInsets.only(
left: 170.0,
),
child: Container(
decoration: BoxDecoration(
color:
Colors.grey.shade300.withOpacity(0.4),
borderRadius: BorderRadius.circular(12)),
padding: EdgeInsets.all(5),
child: Icon(Icons.search,
size: 20, color: Colors.green),
),
),
],
),
),
Padding(
padding: const EdgeInsets.only(bottom: 12),
child: Container(
decoration: BoxDecoration(
color: Colors.grey.shade300.withOpacity(0.4),
borderRadius: BorderRadius.circular(12)),
child: Icon(Icons.filter_alt,
size: 22, color: Colors.green),
),
),
],
),
),
),
),
],
body: ListView(
padding: const EdgeInsets.all(8),
children: <Widget>[
Container(
height: 50,
color: Colors.amber[600],
child: const Center(child: Text('Entry A')),
),
Container(
height: 50,
color: Colors.amber[500],
child: const Center(child: Text('Entry B')),
),
Container(
height: 50,
color: Colors.amber[100],
child: const Center(child: Text('Entry C')),
),
],
),
),
),
),
);
}
}
1:
2:

how to mix between columns and rows in flutter

I want to two add two containers next to each other in a row with two icon buttons on the bottom of the app like shown in the picture. i tried to use sizedbox but it wasn't enough.
i started the code with this but couldn't continue:
class Restaurent extends StatefulWidget {
const Restaurent({Key? key, required this.title}) : super(key: key);
final String title;
#override
_Restaurent createState() => _Restaurent();
}
class _Restaurent extends State<Restaurent> {
#override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Restaurant") ,
),
body: Container(
child: SafeArea(
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(Icons.youtube_searched_for),
]
),
),
),
);
}
}
You can create a Row() with setting mainAxisAlignment: MainAxisAlignment.end.
Here's an example, you can adjust it to fit what you want:
Scaffold(
body: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
height: 100,
width: 100,
decoration: BoxDecoration(
// color: Colors.black,
borderRadius: BorderRadius.circular(10),
border: Border.all(color: Colors.black)),
child: Text("hi"),
),
SizedBox(
width: 10,
),
Container(
height: 100,
width: 100,
decoration: BoxDecoration(
// color: Colors.black,
borderRadius: BorderRadius.circular(10),
border: Border.all(color: Colors.black)),
child: Text("hi"),
),
],
),
SizedBox(
height: 50,
),
Divider(
thickness: 5,
color: Colors.black,
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
height: 100,
width: 100,
decoration: BoxDecoration(
// color: Colors.black,
borderRadius: BorderRadius.circular(25),
border: Border.all(color: Colors.black)),
child: Text("hi"),
),
SizedBox(
width: 10,
),
Container(
height: 100,
width: 100,
decoration: BoxDecoration(
// color: Colors.black,
borderRadius: BorderRadius.circular(25),
border: Border.all(color: Colors.black)),
child: Text("hi"),
),
],
),
],
),
);
Result:

how to stack image to show in the background

Please pardon me to post this.
i am working with this design more that 3 days now i can i get the actual design. all my effort design is been rejected.
i am trying to create this design.
the problem i have is the right and left box showing at the back of the image.
thanks in advance.
here is my code
Container(
child: Card(
shape:RoundedRectangleBorder(borderRadius:
BorderRadius.circular(25.0),
),
semanticContainer:true,
clipBehavior:
Clip.antiAliasWithSaveLayer,
child:Image(image:
NetworkImage(snapshot.data.docs[index].data()['picture'], ),
fit: BoxFit.cover,), ),),);
Scaffold(
body: Container(
height: double.infinity,
width: double.infinity,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Colors.pinkAccent,
Colors.yellowAccent,
],
),
),
child: Stack(
children: [
Positioned(
left: 70,
// right: 40,
top: 40,
child: Transform.rotate(
angle: pi - 3.30,
child: Container(
// transform: ,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
color: Colors.white.withOpacity(0.2),
),
height: 200,
width: 150,
),
),
),
Positioned(
left: 130,
// right: 150,
top: 78,
child: Transform.rotate(
angle: pi + 3.30,
child: Container(
// transform: ,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
color: Colors.white.withOpacity(0.6),
),
height: 190,
width: 150,
),
),
),
Positioned(
left: 0,
right: 0,
top: 50,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 100.0),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
color: Colors.white,
image: DecorationImage(
image: NetworkImage("https://picsum.photos/200/300"),
fit: BoxFit.fill
),
),
height: 220,
width: 100,
),
),
),
],
),
),
);
Result
If you like change, black shadow play with stops inside gradient. hope you will get the idea of doing it.
stops: [.5, 1.0],
To AlignWidgte change this valuealignment: Alignment(-1, -1),. For rotation change here. Better use slider or from dart:math use pi.
Transform.rotate(angle: -.166,
Code snippet
class MyApp extends StatefulWidget {
#override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
get imageWidth => 300;
get imageHeight => 450;
double sliderVal = 0.0;
#override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
buttonTheme: ButtonThemeData(
textTheme: ButtonTextTheme.primary,
),
),
home: Scaffold(
body: Column(
children: [
Slider(
value: sliderVal,
onChanged: (v) {
setState(() {
sliderVal = v;
print(sliderVal);
});
}),
Container(
width: imageWidth * 1.4,
height: imageHeight * 1.1,
child: Stack(
children: [
Align(
alignment: Alignment(-1, -1),
child: Transform.rotate(
angle: -.166,
child: backImage(color: Colors.blue),
),
),
Align(
alignment: Alignment(1, 1),
child: Transform.rotate(
angle: .128,
child: backImage(color: Colors.yellow),
),
),
Center(
child: mainImage(),
),
],
),
),
],
),
),
// CustomSS(),
);
}
backImage({required Color color, double? width, double? height}) {
return Container(
width: width ?? imageWidth,
height: height ?? imageHeight,
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(12),
),
);
}
SizedBox mainImage() {
return SizedBox(
width: imageWidth,
height: imageHeight,
child: ClipRRect(
borderRadius: BorderRadius.circular(12),
child: Stack(
fit: StackFit.expand,
children: [
Image.asset(
"assets/me.jpg",
fit: BoxFit.cover,
),
Container(
decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(12),
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
stops: [.5, 1.0],
colors: [
Colors.transparent,
Colors.black87,
],
),
),
),
Positioned(
bottom: 30,
left: 30,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
children: [
Text(
"Yeasin",
style: TextStyle(
fontSize: 22,
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
SizedBox(
width: 8,
),
Text(
"XX",
style: TextStyle(
fontSize: 22,
color: Colors.white,
),
)
],
),
SizedBox(
height: 10,
),
Text(
"Description",
style: TextStyle(
fontSize: 14,
color: Colors.white,
),
),
]),
)
],
),
));
}
}

Flutter Circle Image With Text and circle color?

Widget i want to make:
Widget I made:
This is my code:
Stack(
alignment: Alignment.center,
children: [
Container(
margin: const EdgeInsets.symmetric(horizontal: 16.0),
height: 70.0,
width: 70.0,
decoration: BoxDecoration(
image: DecorationImage(
image: NetworkImage('https://www.themoviedb.org/t/p/original/wXSnajAZ5ppTKa8Z5zzWGOK85YH.jpg'),
fit: BoxFit.cover,
),
shape: BoxShape.circle,
border: Border.all(color: Colors.red, width: 4.0),
),
),
Container(
height: 70.0,
width: 70.0,
decoration: BoxDecoration(
gradient: const LinearGradient(
colors: [
Colors.black87,
Colors.black45,
Colors.transparent,
],
stops: [0, 0.25, 1],
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
),
shape: BoxShape.circle,
border: Border.all(color: Colors.red, width: 4.0),
),
),
Positioned(
left: 30,
right: -15,
bottom: -20,
child: SizedBox(
height: 35.0,
child: Text(
'12 Mart',
style: TextStyle(
color: Colors.white,
backgroundColor: Colors.red,
),
),
),
),
],
),
How do I make a circle around the text and edges under the round picture like the first Widget?
Here is a solution using a Stack and three nested CircleAvatars:
Minimal Working Example:
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
home: HomePage(),
),
);
}
class HomePage extends StatelessWidget {
#override
Widget build(BuildContext context) {
final radius = MediaQuery.of(context).size.shortestSide * .4;
final borderWidth = radius / 12;
return Scaffold(
body: Center(
child: Badge(
radius: radius,
borderWidth: borderWidth,
imageUrl:
'https://upload.wikimedia.org/wikipedia/commons/e/ea/Retrato_del_Maestro_Yoda.jpg',
),
),
);
}
}
class Badge extends StatelessWidget {
final double radius;
final double borderWidth;
final String imageUrl;
const Badge({
Key key,
#required this.radius,
#required this.borderWidth,
#required this.imageUrl,
}) : super(key: key);
#override
Widget build(BuildContext context) {
return Stack(
alignment: Alignment.center,
children: [
Container(height: 2.1 * radius),
Positioned(
top: 0,
child: CircleAvatar(
radius: radius,
backgroundColor: Colors.indigo,
child: CircleAvatar(
radius: radius - borderWidth,
backgroundColor: Colors.black,
child: CircleAvatar(
radius: radius - 2 * borderWidth,
backgroundImage: NetworkImage(imageUrl),
),
),
),
),
Positioned(
bottom: 0,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 2 * borderWidth,
vertical: borderWidth,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(borderWidth),
color: Colors.indigo,
),
child: Text(
'12 Mart',
style: TextStyle(color: Colors.white, fontSize: 3 * borderWidth),
),
),
),
],
);
}
}
Here you go:
Stack(
alignment: Alignment.center,
children: [
SizedBox(height: 75), // This container is needed only to set the overall stack height
// for Text to be a bit below Circleavatar
Container(
margin: const EdgeInsets.symmetric(horizontal: 16.0),
height: 70.0,
width: 70.0,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(35),
color: Colors.red,
border: Border.all(width: 4, color: Colors.red),
),
child: CircleAvatar(
backgroundImage: NetworkImage(
'https://www.themoviedb.org/t/p/original/wXSnajAZ5ppTKa8Z5zzWGOK85YH.jpg'),
),
),
Positioned(
bottom: 0,
child: Container(
padding: EdgeInsets.all(3),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(35),
color: Colors.red,
),
child: Text(
'12 Mart',
style: TextStyle(color: Colors.white, fontSize: 12),
),
),
),
],
),
Result:

How to stack items on top of each other?

i'm trying make a widget like image below.
Mindset of me is stack item into listview. The items are stacked. But when nesting a stack into listview, the stack needs to be wrapped in a fixed widget. If you remove the listview, you cannot make it into the list as in the picture. First time there is nothing wrong to expect people to ignore.
I hope to get the answer. Thanks.
body: Container(
color: Colors.white,
width: double.infinity,
child: SingleChildScrollView(
child: Stack(
children: <Widget>[
Positioned(top: 10,child: card1(),),
Positioned(bottom: 10,child: card1(),),
],
),
),
),
Item
static Widget card1() {
return Card(
elevation: 0,
child: Container(
margin: EdgeInsets.only(top: 100),
width: double.infinity,
padding: EdgeInsets.only(top: 18, left: 18),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(offset: Offset(0, 8), blurRadius: 8, spreadRadius: 0),
],
),
child: Stack(
children: <Widget>[
Container(
width: 343,
height: 196,
child: SvgPicture.asset(
"assets/bg.svg",
),
),
Container(
padding: EdgeInsets.only(
top: 24,
left: 24,
),
child: Row(
children: <Widget>[
Container(
padding: EdgeInsets.only(left: 10),
child: Text("Vietcombank"),
),
],
),
),
],
),
),
);
}
I created StackedListTile, you can try it (Demo here DartPad)
import 'package:flutter/material.dart';
class StackedListTile extends StatelessWidget {
final Color color;
final String title;
final ImageProvider iconImage;
const StackedListTile({
Key key,
#required this.color,
#required this.title,
#required this.iconImage,
}) : assert(color != null),
super(key: key);
#override
Widget build(BuildContext context) {
return SizedBox(
height: 90.0,
child: Stack(
children: <Widget>[
Container(
margin: const EdgeInsets.only(
left: 18.0,
top: 18.0,
right: 18.0,
),
padding: const EdgeInsets.only(
left: 25.0,
top: 25.0,
right: 25.0,
bottom: 10.0,
),
decoration: BoxDecoration(
color: color,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(8.0),
topRight: Radius.circular(8.0),
),
),
child: Row(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.circular(5.0),
child: AspectRatio(
aspectRatio: 1,
child: Container(
color: Colors.white,
child: Image(
image: iconImage,
fit: BoxFit.cover,
),
),
),
),
const SizedBox(width: 5.0),
Expanded(
child: Text(
title,
style: const TextStyle(
color: Colors.white,
letterSpacing: 1.0,
),
),
),
//TODO: Add other stuff here
const Icon(
Icons.arrow_forward_ios,
color: Colors.white,
size: 20.0,
),
],
),
),
Align(
alignment: Alignment.bottomCenter,
child: Container(
height: 4.0,
decoration: const BoxDecoration(
gradient: LinearGradient(
colors: [Colors.transparent, Colors.black12],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
),
),
],
),
);
}
}
Usage:
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
home: MainPage(),
debugShowCheckedModeBanner: false,
),
);
}
class MainPage extends StatelessWidget {
#override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Demo")),
body: ListView(
children: <Widget>[
StackedListTile(
title: "Techcombank1",
color: Colors.blue[600],
//iconImage: AssetImage("assets/images/1.png"), //TODO: Use this for asset images
iconImage: NetworkImage(
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQfo2BL_di4IK1AuHOS4y_16BatmqdkOlcB1JBjJK2zK9sUvZ2FUg&s",
),
),
StackedListTile(
title: "Techcombank2",
color: Colors.red[600],
iconImage: NetworkImage("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQNvzXsqFidC5YqNrKHEJGt1kyC99dJ_EWt_Bcc5dyy4rNGzFk8yQ&s"),
),
StackedListTile(
title: "Techcombank3",
color: Colors.green[600],
iconImage: NetworkImage("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQNvzXsqFidC5YqNrKHEJGt1kyC99dJ_EWt_Bcc5dyy4rNGzFk8yQ&s"),
),
for(int i =0; i<100; i++)
StackedListTile(
title: "Item_$i",
color: Colors.amber.withOpacity(1-(i%10)/10),
iconImage: NetworkImage("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQNvzXsqFidC5YqNrKHEJGt1kyC99dJ_EWt_Bcc5dyy4rNGzFk8yQ&s"),
),
],
),
);
}
}
Try to use SliverToBoxAdapter
body: return Container(
color: Colors.white,
width: double.infinity,
child: SingleChildScrollView(
child: SliverToBoxAdapter(
child: Stack(
children: <Widget>[
Positioned(
top: 10,
child: card1(),
),
Positioned(
bottom: 10,
child: card1(),
),
],
),
),
),
),