You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
186 lines
7.0 KiB
186 lines
7.0 KiB
import 'package:teso/Classes/TesoUser.dart';
|
|
import 'package:teso/util/consts.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:teso/Pages/Sub_Pages/CoinsPurchase/SilverPurchaseFixed.dart';
|
|
|
|
buildSilverCard({
|
|
required BuildContext context,
|
|
required String goldEquivalent,
|
|
required String cashEquivalent,
|
|
required String funds,
|
|
TesoUser? user,
|
|
}) {
|
|
return Container(
|
|
margin: EdgeInsets.all(10),
|
|
width: 150,
|
|
height: 150,
|
|
child: Material(
|
|
elevation: 5,
|
|
borderRadius: BorderRadius.only(
|
|
bottomLeft: Radius.circular(25),
|
|
bottomRight: Radius.circular(25),
|
|
topLeft: Radius.circular(25),
|
|
topRight: Radius.circular(25),
|
|
),
|
|
child: ClipRRect(
|
|
borderRadius: BorderRadius.circular(25.0),
|
|
child: InkWell(
|
|
onTap: () => showModalBottomSheet(
|
|
context: context,
|
|
isScrollControlled: true,
|
|
enableDrag: true,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.vertical(top: Radius.circular(20.0)),
|
|
),
|
|
builder: (BuildContext bc) {
|
|
return SilverPurchaseFixed(
|
|
amount: funds,
|
|
cashCost: cashEquivalent,
|
|
goldCost: goldEquivalent,
|
|
user: user,
|
|
);
|
|
},
|
|
),
|
|
child: Container(
|
|
// color: accentMain,
|
|
width: 150,
|
|
height: 150,
|
|
child: Stack(
|
|
children: [
|
|
Container(
|
|
margin: EdgeInsets.all(10),
|
|
width: 120,
|
|
height: 120,
|
|
child: Padding(
|
|
padding: EdgeInsets.all(5),
|
|
child: Image(
|
|
width: 90,
|
|
height: 90,
|
|
image: AssetImage("assets/images/silverAnimated.png"),
|
|
fit: BoxFit.fill,
|
|
),
|
|
),
|
|
),
|
|
Align(
|
|
alignment: Alignment.topRight,
|
|
child: Container(
|
|
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
|
|
child: Text(
|
|
"x " + funds,
|
|
style: TextStyle(
|
|
color: tesoBlue,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Align(
|
|
alignment: Alignment.bottomCenter,
|
|
child: Container(
|
|
width: MediaQuery.of(context).size.width,
|
|
height: 25,
|
|
color: Color.fromRGBO(0, 0, 0, 0.4),
|
|
padding: EdgeInsets.symmetric(horizontal: 10),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
new Wrap(
|
|
direction: Axis.horizontal,
|
|
children: [
|
|
Container(
|
|
child: Container(
|
|
height: 20,
|
|
width: 20,
|
|
decoration: new BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
),
|
|
child: Container(
|
|
height: 20,
|
|
width: 20,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
),
|
|
child: ClipRRect(
|
|
borderRadius: BorderRadius.only(
|
|
topLeft: Radius.circular(60.0),
|
|
topRight: Radius.circular(60.0),
|
|
bottomLeft: Radius.circular(60),
|
|
bottomRight: Radius.circular(60),
|
|
),
|
|
child: Image(
|
|
height: 20,
|
|
width: 20,
|
|
fit: BoxFit.fill,
|
|
image:
|
|
AssetImage("assets/images/gold1.png"),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 20,
|
|
height: 20,
|
|
child: Center(
|
|
child: Text(
|
|
goldEquivalent,
|
|
style: TextStyle(
|
|
fontSize: 13,
|
|
fontWeight: FontWeight.bold,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
new Wrap(
|
|
direction: Axis.horizontal,
|
|
children: [
|
|
Container(
|
|
child: Container(
|
|
height: 20,
|
|
//width: 20,
|
|
decoration: new BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
),
|
|
child: Center(
|
|
child: Text(
|
|
"GH¢",
|
|
style: TextStyle(
|
|
color: Colors.grey[300],
|
|
fontSize: 13,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 20,
|
|
height: 20,
|
|
child: Center(
|
|
child: Text(
|
|
cashEquivalent,
|
|
style: TextStyle(
|
|
fontSize: 13,
|
|
fontWeight: FontWeight.bold,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|