Using responsive grid library

This commit is contained in:
Tyler Wilcox 2025-06-16 21:02:34 -04:00
parent bdf69276ad
commit 16ae1d3ea2
5 changed files with 68 additions and 25 deletions

7
lib/globals.dart Normal file
View File

@ -0,0 +1,7 @@
library;
import "package:nt4/nt4.dart";
NT4Client? ntClient;

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:helm/widgets/base_card.dart';
import 'package:responsive_grid/responsive_grid.dart';
import '../widgets/text_card.dart';
class Dashboard extends StatelessWidget {
@ -23,22 +24,46 @@ class Dashboard extends StatelessWidget {
// the App.build method, and use it to set our appbar title.
title: Text("Helm"),
),
body: Column(
children: <Widget>[
Row(
children: [
BaseCard(cardTitle: "Reef Picker", height: 4, width: 6),
Column(
children: [
TextCard(cardTitle: 'Match State', height: 2, width: 3),
TextCard(cardTitle: "Match Time", height: 2, width: 3),
],
),
],
body: ResponsiveGridRow(
children: [
ResponsiveGridCol(
md: 12,
child: ResponsiveGridRow(
children: [
ResponsiveGridCol(
md: 6,
child: BaseCard(cardTitle: "Reef Picker", height: 4),
),
ResponsiveGridCol(
md: 6,
child: ResponsiveGridRow(
children: [
ResponsiveGridCol(
md: 6,
child: TextCard(cardTitle: "Match State"),
),
ResponsiveGridCol(
md: 6,
child: TextCard(cardTitle: "Match Time"),
),
ResponsiveGridCol(
md: 6,
child: TextCard(cardTitle: "Blah Blah"),
),
],
),
),
ResponsiveGridCol(
md: 6,
child: ResponsiveGridRow(
children: [
ResponsiveGridCol(child: TextCard(cardTitle: "Blah")),
],
),
),
],
),
),
Row(children: [
TextCard(cardTitle: "Intake State", height: 2, width: 3,)
],)
],
),
);

View File

@ -18,12 +18,14 @@ class BaseCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
Size size = MediaQuery.sizeOf(context);
return Card(
child: Padding(
padding: EdgeInsets.all(10),
child: SizedBox(
width: 100.0 * width,
height: 100.0 * height,
width: (size.width / 12) * width ,
height: (size.height / 12) * height,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[

View File

@ -5,10 +5,10 @@ packages:
dependency: transitive
description:
name: async
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
url: "https://pub.dev"
source: hosted
version: "2.12.0"
version: "2.13.0"
boolean_selector:
dependency: transitive
description:
@ -61,10 +61,10 @@ packages:
dependency: transitive
description:
name: fake_async
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
url: "https://pub.dev"
source: hosted
version: "1.3.2"
version: "1.3.3"
flutter:
dependency: "direct main"
description: flutter
@ -87,10 +87,10 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
url: "https://pub.dev"
source: hosted
version: "10.0.8"
version: "10.0.9"
leak_tracker_flutter_testing:
dependency: transitive
description:
@ -171,6 +171,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.9.1"
responsive_grid:
dependency: "direct main"
description:
name: responsive_grid
sha256: "852b4d46ae4a530e0d54a1dc59964f3d2cd8d6ca1f6fc4e5790cc0580e367e24"
url: "https://pub.dev"
source: hosted
version: "2.4.4"
sky_engine:
dependency: transitive
description: flutter
@ -244,10 +252,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
url: "https://pub.dev"
source: hosted
version: "14.3.1"
version: "15.0.0"
web:
dependency: transitive
description:

View File

@ -35,6 +35,7 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.8
nt4: ^1.3.3
responsive_grid: ^2.4.4
dev_dependencies:
flutter_test: