broken release much

i forgot how to dart for a second there
This commit is contained in:
Mercurio 2023-11-13 15:54:02 +01:00
parent 055163b5b1
commit 1668b784e9
4 changed files with 33 additions and 44 deletions

View file

@ -80,7 +80,7 @@ class _LogsPageState extends State<LogsPage> {
@override
Widget build(BuildContext context) {
final appState = Provider.of<AppState>(context, listen: false);
appState.currentIndex = 2;
return Scaffold(
appBar: AppBar(
title: const Text('Logs'),
@ -90,45 +90,33 @@ class _LogsPageState extends State<LogsPage> {
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: DataTable(
columns: const [
DataColumn(label: Text('Name')),
DataColumn(label: Text('Intensity')),
DataColumn(label: Text('Duration (s)')),
DataColumn(label: Text('Type')),
child: DataTable(
columns: const [
DataColumn(label: Text('Name')),
DataColumn(label: Text('Intensity')),
DataColumn(label: Text('Duration (s)')),
DataColumn(label: Text('Type')),
],
rows: logs.map((log) {
final controlledBy = log['controlledBy'] as Map<String, dynamic>?;
if (controlledBy != null) {
final name = getDisplayName(controlledBy);
final intensity = log['intensity'] as int?;
final duration = (log['duration'] as int?)! / 1000;
final type = log['type'] as String?;
if (intensity != null && type != null) {
return DataRow(
cells: [
DataCell(Text(name)),
DataCell(Text(intensity.toString())),
DataCell(Text(duration.toString())),
DataCell(getIconForType(type)),
],
rows: logs.map((log) {
final controlledBy =
log['controlledBy'] as Map<String, dynamic>?;
if (controlledBy != null) {
final name = getDisplayName(controlledBy);
final intensity = log['intensity'] as int?;
final duration = (log['duration'] as int?)! / 1000;
final type = log['type'] as String?;
if (intensity != null && type != null) {
return DataRow(
cells: [
DataCell(Text(name)),
DataCell(Text(intensity.toString())),
DataCell(Text(duration.toString())),
DataCell(getIconForType(type)),
],
);
}
}
return const DataRow(cells: []);
}).toList(),
),
),
],
),
);
}
}
return const DataRow(cells: []);
}).toList(),
),
),
),
@ -152,4 +140,4 @@ class _LogsPageState extends State<LogsPage> {
),
);
}
}
}

View file

@ -66,7 +66,7 @@ class _SliderPageState extends State<SliderPage> {
@override
Widget build(BuildContext context) {
final appState = Provider.of<AppState>(context, listen: false);
appState.currentIndex = 0;
return Scaffold(
appBar: AppBar(
title: const Text('Openshock Companion'),

View file

@ -52,7 +52,7 @@ class _SettingsPageState extends State<SettingsPage> {
@override
Widget build(BuildContext context) {
final appState = Provider.of<AppState>(context, listen: false);
appState.currentIndex = 1;
return Scaffold(
appBar: AppBar(
title: const Text('Settings'),
@ -127,13 +127,14 @@ class _SettingsPageState extends State<SettingsPage> {
appState.currentIndex = index;
setState(() {
if (index == 0) {
appState.currentIndex = 0;
Navigator.popUntil(context, (route) => route.isFirst);
appState.currentIndex = 0;
} else if (index == 2) {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const LogsPage()),
);
appState.currentIndex = 2;
}
});
},

View file

@ -4,7 +4,7 @@ description: Companion app for managing openshock-compatible devices
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none'
version: 0.2.3
version: 0.2.4
environment:
sdk: '>=3.1.2 <4.0.0'