2023-12-30 21:23:42 +00:00
|
|
|
import 'package:aurcache/components/builds_table.dart';
|
2024-01-01 16:11:05 +00:00
|
|
|
import 'package:aurcache/components/api/APIBuilder.dart';
|
2023-12-30 21:23:42 +00:00
|
|
|
import 'package:aurcache/providers/builds_provider.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import '../constants/color_constants.dart';
|
|
|
|
import '../models/build.dart';
|
|
|
|
|
|
|
|
class BuildsScreen extends StatelessWidget {
|
|
|
|
const BuildsScreen({super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBar(),
|
|
|
|
body: Padding(
|
|
|
|
padding: const EdgeInsets.all(defaultPadding),
|
|
|
|
child: Container(
|
|
|
|
padding: const EdgeInsets.all(defaultPadding),
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
color: secondaryColor,
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
|
|
|
),
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
"All Builds",
|
|
|
|
style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
width: double.infinity,
|
|
|
|
child: APIBuilder<BuildsProvider, List<Build>, Object>(
|
2024-01-06 20:53:48 +00:00
|
|
|
key: const Key("Builds on seperate screen"),
|
2023-12-30 21:23:42 +00:00
|
|
|
interval: const Duration(seconds: 10),
|
|
|
|
onLoad: () => const Text("no data"),
|
|
|
|
onData: (data) {
|
|
|
|
return BuildsTable(data: data);
|
|
|
|
}),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|