working workspaces
This commit is contained in:
parent
6a6a6b8f86
commit
30af165d02
54 changed files with 5065 additions and 158 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:flight/controllers/time_controller.dart';
|
||||
import 'package:flight/controllers/workspaces_controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
|
@ -13,38 +14,84 @@ class Bar extends ConsumerWidget {
|
|||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Icon(Icons.circle),
|
||||
Icon(Icons.circle_outlined),
|
||||
Icon(Icons.circle_outlined),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
DateFormat.Hm().format(
|
||||
ref
|
||||
.watch(TimeController.provider)
|
||||
children:
|
||||
[
|
||||
...ref
|
||||
.watch(WorkspacesController.provider)
|
||||
.when(
|
||||
data: (time) => time,
|
||||
loading: DateTime.now,
|
||||
error: (_, _) => DateTime.now(),
|
||||
error: (error, stackTrace) => [Text(error.toString())],
|
||||
loading: () => [],
|
||||
data: (value) => value
|
||||
.map(
|
||||
(group) => Row(
|
||||
children: group
|
||||
.map(
|
||||
(workspace) => IconButton(
|
||||
onPressed: () {},
|
||||
icon: Icon(
|
||||
workspace.activated
|
||||
? Icons.circle
|
||||
: Icons.circle_outlined,
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
IconButton(onPressed: () {}, icon: Icon(Icons.wifi)),
|
||||
IconButton(onPressed: () {}, icon: Icon(Icons.bluetooth)),
|
||||
IconButton(onPressed: () {}, icon: Icon(Icons.volume_off)),
|
||||
],
|
||||
),
|
||||
],
|
||||
Center(
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () {},
|
||||
child: Text(
|
||||
DateFormat.Hm().format(
|
||||
ref
|
||||
.watch(TimeController.provider)
|
||||
.when(
|
||||
data: (time) => time,
|
||||
loading: DateTime.now,
|
||||
error: (_, _) => DateTime.now(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
IconButton(onPressed: () {}, icon: Icon(Icons.wifi)),
|
||||
IconButton(onPressed: () {}, icon: Icon(Icons.bluetooth)),
|
||||
IconButton(
|
||||
onPressed: () {},
|
||||
icon: Icon(Icons.volume_off),
|
||||
),
|
||||
],
|
||||
),
|
||||
]
|
||||
.map(
|
||||
(child) => Padding(
|
||||
padding: EdgeInsetsGeometry.directional(bottom: 6),
|
||||
child: Container(
|
||||
height: 42,
|
||||
padding: EdgeInsets.symmetric(horizontal: 12),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.surfaceContainerLow,
|
||||
borderRadius: BorderRadius.circular(999),
|
||||
),
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue