From 3b024f960d28aaa1522d8be1883f048ea18208d8 Mon Sep 17 00:00:00 2001 From: David J Kordsmeier Date: Sat, 16 Mar 2024 01:53:01 -0700 Subject: [PATCH] refs #26 revert changes to the main ... not sure what was going in but it was broken --- magnet_app/lib/main.dart | 103 +-------------------------------------- 1 file changed, 1 insertion(+), 102 deletions(-) diff --git a/magnet_app/lib/main.dart b/magnet_app/lib/main.dart index a90b7d8..4998a5b 100644 --- a/magnet_app/lib/main.dart +++ b/magnet_app/lib/main.dart @@ -5,8 +5,6 @@ import 'package:provider/provider.dart'; import 'package:cbl_flutter/cbl_flutter.dart'; -import 'package:horizontal_data_table/horizontal_data_table.dart'; - import 'package:magnet_app/splash_page.dart'; import 'package:magnet_app/about.dart'; import 'package:magnet_app/app_state_model.dart'; @@ -36,7 +34,7 @@ Future main() async { }); } -class MyApp extends StatelessWidget, State { +class MyApp extends StatelessWidget { const MyApp({super.key}); // This widget is the root of your application. @override @@ -176,109 +174,12 @@ class MyHomePage extends StatelessWidget { style: TextStyle(color: _textColor(context)), )), */ - HorizontalDataTable( - leftHandSideColumnWidth: 100, - rightHandSideColumnWidth: 600, - isFixedHeader: true, - headerWidgets: _getTitleWidget(), - isFixedFooter: true, - footerWidgets: _getTitleWidget(), - leftSideItemBuilder: _generateFirstColumnRow, - rightSideItemBuilder: _generateRightHandSideColumnRow, - itemCount: widget.user.userInfo.length, - rowSeparatorWidget: const Divider( - color: Colors.black38, - height: 1.0, - thickness: 0.0, - ), - leftHandSideColBackgroundColor: const Color(0xFFFFFFFF), - rightHandSideColBackgroundColor: const Color(0xFFFFFFFF), - itemExtent: 55, - ), ], ), ), ); - - - } - - List _getTitleWidget() { - return [ - _getTitleItemWidget('Name', 100), - _getTitleItemWidget('Status', 100), - _getTitleItemWidget('Phone', 200), - _getTitleItemWidget('Register', 100), - _getTitleItemWidget('Termination', 200), - ]; } - Widget _getTitleItemWidget(String label, double width) { - return Container( - width: width, - height: 56, - padding: const EdgeInsets.fromLTRB(5, 0, 0, 0), - alignment: Alignment.centerLeft, - child: Text(label, style: const TextStyle(fontWeight: FontWeight.bold)), - ); - } - - Widget _generateFirstColumnRow(BuildContext context, int index) { - return Container( - width: 100, - height: 52, - padding: const EdgeInsets.fromLTRB(5, 0, 0, 0), - alignment: Alignment.centerLeft, - child: Text(widget.user.userInfo[index].name), - ); - } - - Widget _generateRightHandSideColumnRow(BuildContext context, int index) { - return Row( - children: [ - Container( - width: 100, - height: 52, - padding: const EdgeInsets.fromLTRB(5, 0, 0, 0), - alignment: Alignment.centerLeft, - child: Row( - children: [ - Icon( - widget.user.userInfo[index].status - ? Icons.notifications_off - : Icons.notifications_active, - color: widget.user.userInfo[index].status - ? Colors.red - : Colors.green), - Text(widget.user.userInfo[index].status ? 'Disabled' : 'Active') - ], - ), - ), - Container( - width: 200, - height: 52, - padding: const EdgeInsets.fromLTRB(5, 0, 0, 0), - alignment: Alignment.centerLeft, - child: Text(widget.user.userInfo[index].phone), - ), - Container( - width: 100, - height: 52, - padding: const EdgeInsets.fromLTRB(5, 0, 0, 0), - alignment: Alignment.centerLeft, - child: Text(widget.user.userInfo[index].registerDate), - ), - Container( - width: 200, - height: 52, - padding: const EdgeInsets.fromLTRB(5, 0, 0, 0), - alignment: Alignment.centerLeft, - child: Text(widget.user.userInfo[index].terminationDate), - ), - ], - ); - } - Color? _iconsColor(BuildContext context) { final theme = NeumorphicTheme.of(context); if (theme!.isUsingDark) { @@ -328,6 +229,4 @@ Widget switchScreen(AppState app_provider) { default: throw Exception("$app_provider.app_screen is not a valid screen state"); } - - } \ No newline at end of file