Skip to content

Commit

Permalink
chore: redesign webapp
Browse files Browse the repository at this point in the history
  • Loading branch information
bonomat committed Feb 7, 2024
1 parent 8465356 commit 833468d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 80 deletions.
2 changes: 1 addition & 1 deletion webapp/frontend/assets/tradingview.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@
</script>
</div>
</body>
</html>
</html>
103 changes: 33 additions & 70 deletions webapp/frontend/lib/trade/trade_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,81 +35,44 @@ class _TradeScreenState extends State<TradeScreen> with SingleTickerProviderStat

Widget _buildHorizontalWidget(BoxConstraints constraints) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: Column(
padding: const EdgeInsets.only(top: 8.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ConstrainedBox(
constraints: BoxConstraints(
maxHeight: constraints.maxHeight - 16,
),
child: Container(
height: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Colors.grey[100],
),
child: Row(
children: [
Expanded(
child: Center(child: NewOrderWidget(tabController: _tabController))),
],
),
),
SizedBox(
height: 500,
width: 350,
child: NewOrderWidget(tabController: _tabController),
),
const SizedBox(
height: 10,
),
const Expanded(
child:
SizedBox(height: 500, child: TradingViewWidgetHtml(cryptoName: "BTCUSD"))),
],
),
),
Expanded(
flex: 2,
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Visibility(
visible: false,
child: Expanded(
child: Padding(
padding: const EdgeInsets.only(left: 8, right: 8, bottom: 8),
child: Container(
height: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Colors.grey[100],
),
child: const Row(
children: [Expanded(child: Center(child: Text("Chart")))],
),
),
),
),
),
const SizedBox(height: 500, child: TradingViewWidgetHtml(cryptoName: "BTCUSD")),
// CustomInAppBrowser(url: 'https://google.com',),
const SizedBox(
height: 10,
),
SizedBox(
height: 150,
child: createTableWidget(const OpenPositionTable(), "Open Positions")),
const SizedBox(
height: 10,
),
SizedBox(
height: 300,
child: createTableWidget(const OrderHistoryTable(), "Order History")),
],
),
const SizedBox(
height: 10,
),
),
],
),
);
Column(
children: [
SizedBox(
height: 120.0,
child: createTableWidget(const OpenPositionTable(), "Open Positions")),
const SizedBox(
height: 10,
),
SizedBox(
height: 320.0,
child: createTableWidget(const OrderHistoryTable(), "Order History")),
],
)
],
));
}

Widget createTableWidget(Widget child, String title) {
Expand Down
9 changes: 0 additions & 9 deletions webapp/frontend/lib/trade/tradingview/tradingview.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';

enum ProgressIndicatorType { circular, linear }

class TradingViewWidgetHtml extends StatefulWidget {
const TradingViewWidgetHtml({
required this.cryptoName,
Expand All @@ -17,13 +15,6 @@ class TradingViewWidgetHtml extends StatefulWidget {
class _TradingViewWidgetHtmlState extends State<TradingViewWidgetHtml> {
final GlobalKey webViewKey = GlobalKey();
InAppWebViewController? webViewController;
double progress = 0;
ProgressIndicatorType type = ProgressIndicatorType.circular;

@override
void initState() {
super.initState();
}

@override
Widget build(BuildContext context) {
Expand Down

0 comments on commit 833468d

Please sign in to comment.