feat: Integrate sync status indicators in app title bar and home screen
This commit is contained in:
@@ -1,18 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:notas/platform/app_platform.dart';
|
||||
import 'package:notas/widgets/sync_status_indicator.dart';
|
||||
import 'package:window_manager/window_manager.dart';
|
||||
|
||||
class AppTitleBar extends StatelessWidget {
|
||||
const AppTitleBar({
|
||||
this.syncStatus = SyncStatus.idle,
|
||||
this.syncErrorMessage,
|
||||
super.key,
|
||||
});
|
||||
|
||||
final SyncStatus syncStatus;
|
||||
final String? syncErrorMessage;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (isAndroid || isIOS) {
|
||||
@@ -30,11 +24,6 @@ class AppTitleBar extends StatelessWidget {
|
||||
'Mis Notas',
|
||||
style: TextStyle(color: Colors.white70, fontSize: 13),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
SyncStatusIndicator(
|
||||
status: syncStatus,
|
||||
errorMessage: syncErrorMessage,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -42,10 +31,7 @@ class AppTitleBar extends StatelessWidget {
|
||||
}
|
||||
|
||||
if (isLinux) {
|
||||
return _KdeTitleBar(
|
||||
syncStatus: syncStatus,
|
||||
syncErrorMessage: syncErrorMessage,
|
||||
);
|
||||
return const _KdeTitleBar();
|
||||
}
|
||||
|
||||
return SizedBox(
|
||||
@@ -56,11 +42,6 @@ class AppTitleBar extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text('Mis Notas', style: TextStyle(color: Colors.white)),
|
||||
const SizedBox(width: 8),
|
||||
SyncStatusIndicator(
|
||||
status: syncStatus,
|
||||
errorMessage: syncErrorMessage,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -69,13 +50,7 @@ class AppTitleBar extends StatelessWidget {
|
||||
}
|
||||
|
||||
class _KdeTitleBar extends StatefulWidget {
|
||||
const _KdeTitleBar({
|
||||
this.syncStatus = SyncStatus.idle,
|
||||
this.syncErrorMessage,
|
||||
});
|
||||
|
||||
final SyncStatus syncStatus;
|
||||
final String? syncErrorMessage;
|
||||
const _KdeTitleBar();
|
||||
|
||||
@override
|
||||
State<_KdeTitleBar> createState() => _KdeTitleBarState();
|
||||
@@ -182,22 +157,6 @@ class _KdeTitleBarState extends State<_KdeTitleBar> with WindowListener {
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: 0,
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
child: IgnorePointer(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Center(
|
||||
child: SyncStatusIndicator(
|
||||
status: widget.syncStatus,
|
||||
errorMessage: widget.syncErrorMessage,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: 0,
|
||||
top: 0,
|
||||
|
||||
Reference in New Issue
Block a user