diff --git a/assets/artifacts/cards_store.png b/assets/artifacts/cards_store.png new file mode 100644 index 0000000..ea0d282 Binary files /dev/null and b/assets/artifacts/cards_store.png differ diff --git a/assets/artifacts/literature_artifacts_bronze.png b/assets/artifacts/literature_artifacts_bronze.png new file mode 100644 index 0000000..a053699 Binary files /dev/null and b/assets/artifacts/literature_artifacts_bronze.png differ diff --git a/assets/artifacts/literature_artifacts_diamond.png b/assets/artifacts/literature_artifacts_diamond.png new file mode 100644 index 0000000..1635572 Binary files /dev/null and b/assets/artifacts/literature_artifacts_diamond.png differ diff --git a/assets/artifacts/literature_artifacts_gold.png b/assets/artifacts/literature_artifacts_gold.png new file mode 100644 index 0000000..1216e78 Binary files /dev/null and b/assets/artifacts/literature_artifacts_gold.png differ diff --git a/assets/artifacts/literature_artifacts_silver.png b/assets/artifacts/literature_artifacts_silver.png new file mode 100644 index 0000000..d9c1c3e Binary files /dev/null and b/assets/artifacts/literature_artifacts_silver.png differ diff --git a/assets/artifacts/mega_chest.png b/assets/artifacts/mega_chest.png new file mode 100644 index 0000000..5b66537 Binary files /dev/null and b/assets/artifacts/mega_chest.png differ diff --git a/lib/store/store.dart b/lib/store/store.dart index 3451155..9fe9195 100644 --- a/lib/store/store.dart +++ b/lib/store/store.dart @@ -24,16 +24,19 @@ class _StoreState extends State { double walletCurrency = 0.00; // Async network request to fetch account information. Future fetchAccountInformation() async { - final response = await http.get('http://localhost:3000/wallet'); - if (response.statusCode == 200) { - setState(() { - walletCurrency = double.parse(response.body); + // final response = await http.get('http://localhost:3000/wallet'); + // if (response.statusCode == 200) { + // setState(() { + // walletCurrency = double.parse(response.body); + // }); + // } else { + // // If the server did not return a 200 OK response, + // // then throw an exception. + // throw Exception('Failed to load the store. Check your network.'); + // } + setState(() { + walletCurrency = 2000.0; }); - } else { - // If the server did not return a 200 OK response, - // then throw an exception. - throw Exception('Failed to load the store. Check your network.'); - } } @override void initState() { @@ -105,81 +108,34 @@ class _StoreState extends State { switch (tier) { case "diamond": return Container( - width: MediaQuery.of(context).size.width*0.048, - height: MediaQuery.of(context).size.height*0.0223, + width: 80, + height: 80, alignment: Alignment.center, - decoration: BoxDecoration( - border: Border.all(width: 1.0, color: Colors.black), - color: Colors.teal[500], - // boxShadow: [ - // BoxShadow( - // color: Colors.blueGrey.withAlpha(100), - // blurRadius: 6.0, - // spreadRadius: 6.0, - // offset: Offset( - // 0.0, - // 3.0, - // ), - // ), - // ], - ), - child: Text( - tier[0].toUpperCase(), - style: TextStyle( - color: Colors.white - ), - ), + child: Image.asset("assets/artifacts/literature_artifacts_diamond.png") ); break; case "gold": return Container( - width: MediaQuery.of(context).size.width*0.048, - height: MediaQuery.of(context).size.height*0.0223, + width: 80, + height: 80, alignment: Alignment.center, - decoration: BoxDecoration( - border: Border.all(width: 1.0, color: Colors.black), - color: Colors.yellow[700] - ), - child: Text( - tier[0].toUpperCase(), - style: TextStyle( - color: Colors.white - ), - ), + child: Image.asset("assets/artifacts/literature_artifacts_gold.png") ); break; case "silver": return Container( - width: MediaQuery.of(context).size.width*0.048, - height: MediaQuery.of(context).size.height*0.0223, + width: 80, + height: 80, alignment: Alignment.center, - decoration: BoxDecoration( - border: Border.all(width: 1.0, color: Colors.black), - color: Colors.grey - ), - child: Text( - tier[0].toUpperCase(), - style: TextStyle( - color: Colors.white - ), - ), + child: Image.asset("assets/artifacts/literature_artifacts_silver.png") ); break; case "bronze": return Container( - width: MediaQuery.of(context).size.width*0.048, - height: MediaQuery.of(context).size.height*0.0223, + width: 80, + height: 80, alignment: Alignment.center, - decoration: BoxDecoration( - border: Border.all(width: 1.0, color: Colors.black), - color: Colors.brown - ), - child: Text( - tier[0].toUpperCase(), - style: TextStyle( - color: Colors.white - ), - ), + child: Image.asset("assets/artifacts/literature_artifacts_bronze.png") ); break; default: @@ -220,21 +176,27 @@ class _StoreState extends State { for (var i=0; i < items.length; i++) { children.add( Padding( - padding: EdgeInsets.fromLTRB(0, MediaQuery.of(context).size.height*0.011, 0, 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Text( - items[i].value.toUpperCase(), - style: TextStyle( - // color: getColor(item["color"]), - fontWeight: FontWeight.bold + padding: EdgeInsets.fromLTRB(0, MediaQuery.of(context).size.height*0.011, 0, 10), + child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5.0) + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Text( + ' ' + items[i].value.toUpperCase(), + style: TextStyle( + // color: getColor(item["color"]), + fontWeight: FontWeight.bold + ), ), ), - ), - getRarityDescriptor(items[i].tier) - ] + getRarityDescriptor(items[i].tier) + ] + ), ), ) ); @@ -280,9 +242,9 @@ class _StoreState extends State { onTap: () { // Subtract the money. if (walletCurrency >= 99.0) { - // setState(() { - // walletCurrency -= 99.00; - // }); + setState(() { + walletCurrency -= 99.00; + }); getGeneratedItems(); showDialog( context: context, @@ -309,17 +271,24 @@ class _StoreState extends State { } }, child: Card( - child: Container( - // 300 units - height: MediaQuery.of(context).size.height*0.3348, - child: Center( - child: Container( - decoration: BoxDecoration( - border: Border.all(width: 2, color: Colors.lightBlue), + child: Stack( + children: [ + Image.asset( + "assets/artifacts/mega_chest.png", + fit: BoxFit.fill, + ), + Positioned( + top: MediaQuery.of(context).size.height*0.100, + left: MediaQuery.of(context).size.width*0.3864, + child: Container( + decoration: BoxDecoration( + border: Border.all(width: 4, color: Colors.red), + color: Colors.white + ), + child: Padding(padding: EdgeInsets.all(2), child: Text("Rs 99.00")) ), - child: Padding(padding: EdgeInsets.all(2), child: Text("Rs 99.00")) ) - ), + ], ), ), ), @@ -352,13 +321,24 @@ class _StoreState extends State { Card( child: Container( height: MediaQuery.of(context).size.height*0.11, - child: Center( - child: Container( - decoration: BoxDecoration( - border: Border.all(width: 2, color: Colors.lightBlue), + child: Stack( + children: [ + Image.asset( + "assets/artifacts/cards_store.png", + fit: BoxFit.contain, ), - child: Padding(padding: EdgeInsets.all(2), child: Text("CARDS")) - ) + Positioned( + top: MediaQuery.of(context).size.height*0.0390, + left: MediaQuery.of(context).size.width*0.386, + child: Container( + decoration: BoxDecoration( + border: Border.all(width: 4, color: Colors.red), + color: Colors.white + ), + child: Padding(padding: EdgeInsets.all(2), child: Text("CARDS")) + ), + ) + ], ), ), ), @@ -452,10 +432,10 @@ class _StoreState extends State { Widget getArtifactsList() { var children = artifacts.map((item) => Padding( padding: EdgeInsets.fromLTRB( - MediaQuery.of(context).size.height*0.11, - MediaQuery.of(context).size.height*0.11/2, - MediaQuery.of(context).size.height*0.11, - MediaQuery.of(context).size.height*0.11/2 + MediaQuery.of(context).size.height*0.011, + MediaQuery.of(context).size.height*0.011/2, + MediaQuery.of(context).size.height*0.011, + MediaQuery.of(context).size.height*0.011/2 ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/pubspec.yaml b/pubspec.yaml index 2c49efa..1bd185b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -89,6 +89,14 @@ flutter: - assets/animations/seriously.gif - assets/rewards.png # - images/a_dot_ham.jpeg + # Artifacts + - assets/artifacts/literature_artifacts_diamond.png + - assets/artifacts/literature_artifacts_gold.png + - assets/artifacts/literature_artifacts_silver.png + - assets/artifacts/literature_artifacts_bronze.png + - assets/artifacts/mega_chest.png + - assets/artifacts/cards_store.png + - assets/artifacts/obtainable_cards.png # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware.