- Updated various screens to replace hardcoded color values with contentTheme.buttonColor for consistency. - Changed icons in NotesView, UserDocumentsPage, EmployeeDetailPage, EmployeesScreen, ExpenseDetailScreen, and others to use updated icon styles. - Refactored OfflineScreen and TenantSelectionScreen to utilize new wave background widget. - Introduced ThemeEditorWidget in UserProfileBar for dynamic theme adjustments. - Enhanced logout confirmation dialog styling to align with new theme colors.
102 lines
3.2 KiB
Dart
102 lines
3.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:marco/helpers/utils/mixins/ui_mixin.dart';
|
|
import 'package:marco/images.dart';
|
|
import 'package:marco/helpers/widgets/wave_background.dart';
|
|
|
|
|
|
class OfflineScreen extends StatefulWidget {
|
|
const OfflineScreen({super.key});
|
|
|
|
@override
|
|
State<OfflineScreen> createState() => _OfflineScreenState();
|
|
}
|
|
|
|
class _OfflineScreenState extends State<OfflineScreen>
|
|
with SingleTickerProviderStateMixin, UIMixin {
|
|
late AnimationController _controller;
|
|
late Animation<double> _logoAnimation;
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
_controller = AnimationController(
|
|
vsync: this,
|
|
duration: const Duration(milliseconds: 800),
|
|
);
|
|
_logoAnimation = CurvedAnimation(
|
|
parent: _controller,
|
|
curve: Curves.easeOutBack,
|
|
);
|
|
_controller.forward();
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
_controller.dispose();
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: Stack(
|
|
children: [
|
|
RedWaveBackground(brandRed: contentTheme.brandColor),
|
|
SafeArea(
|
|
child: Center(
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 12.0),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
ScaleTransition(
|
|
scale: _logoAnimation,
|
|
child: Container(
|
|
width: 100,
|
|
height: 100,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
shape: BoxShape.circle,
|
|
boxShadow: const [
|
|
BoxShadow(
|
|
color: Colors.black12,
|
|
blurRadius: 10,
|
|
offset: Offset(0, 10),
|
|
),
|
|
],
|
|
),
|
|
padding: const EdgeInsets.all(20),
|
|
child: Image.asset(Images.logoDark),
|
|
),
|
|
),
|
|
// Increased spacing here
|
|
const SizedBox(height: 120),
|
|
const Icon(Icons.wifi_off,
|
|
size: 100, color: Colors.redAccent),
|
|
const SizedBox(height: 20),
|
|
const Text(
|
|
"No Internet Connection",
|
|
style: TextStyle(
|
|
fontSize: 26,
|
|
fontWeight: FontWeight.bold,
|
|
color: Colors.black87,
|
|
),
|
|
textAlign: TextAlign.center,
|
|
),
|
|
const SizedBox(height: 15),
|
|
const Text(
|
|
"It seems you're currently offline. Please check your network settings or Wi-Fi connection.",
|
|
textAlign: TextAlign.center,
|
|
style: TextStyle(fontSize: 16, color: Colors.grey),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|