80 lines
2.2 KiB
Dart
80 lines
2.2 KiB
Dart
import 'package:binanceapp/backend.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'backend.dart';
|
|
|
|
void main() {
|
|
runApp(MyApp());
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
// This widget is the root of your application.
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'Flutter Demo',
|
|
theme: ThemeData(
|
|
primarySwatch: Colors.blue,
|
|
),
|
|
home: MyHomePage(),
|
|
);
|
|
}
|
|
}
|
|
|
|
class MyHomePage extends StatefulWidget {
|
|
MyHomePage({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
_MyHomePageState createState() => _MyHomePageState();
|
|
}
|
|
|
|
class _MyHomePageState extends State<MyHomePage> {
|
|
late Future<Btcusdt> futureBtcusdt;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: Color.fromARGB(255, 22, 31, 46),
|
|
body: Center(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: <Widget>[
|
|
Container(
|
|
width: 100,
|
|
height: 200,
|
|
padding: EdgeInsets.only(left: 8, right: 8),
|
|
decoration: BoxDecoration(
|
|
color: Colors.grey,
|
|
borderRadius: BorderRadius.circular(10)),
|
|
child: ListView.builder(
|
|
itemCount: 500,
|
|
itemBuilder: (BuildContext context, int index) {
|
|
return MyButton(
|
|
onPressed: () => initState(), textvalue: 'Press me');
|
|
}))
|
|
],
|
|
),
|
|
), // This trailing comma makes auto-formatting nicer for build methods.
|
|
);
|
|
}
|
|
}
|
|
|
|
class MyButton extends StatelessWidget {
|
|
final void Function() onPressed;
|
|
final String textvalue;
|
|
const MyButton({required this.textvalue, required this.onPressed});
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
margin: EdgeInsets.only(bottom: 8),
|
|
color: Colors.blueGrey,
|
|
child: TextButton(
|
|
onPressed: () => onPressed(),
|
|
child: Text(
|
|
'$textvalue',
|
|
style: TextStyle(fontSize: 14, color: Colors.white),
|
|
),
|
|
));
|
|
}
|
|
}
|