im so tired man
This commit is contained in:
@@ -243,9 +243,18 @@ class _SosScreenState extends State<SosScreen>
|
||||
bloc: _sosCubit,
|
||||
builder: (context, sosState) {
|
||||
final sending = sosState.phase == SosPhase.sending;
|
||||
final size = MediaQuery.sizeOf(context);
|
||||
final compact = size.height < 620;
|
||||
final landscapeTight = size.width > size.height && size.height < 520;
|
||||
final pagePadding = compact ? 12.0 : 16.0;
|
||||
final sectionGap = landscapeTight
|
||||
? 8.0
|
||||
: compact
|
||||
? 12.0
|
||||
: 24.0;
|
||||
return SafeArea(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
padding: EdgeInsets.all(pagePadding),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
@@ -278,14 +287,14 @@ class _SosScreenState extends State<SosScreen>
|
||||
],
|
||||
),
|
||||
|
||||
const SizedBox(height: 24),
|
||||
SizedBox(height: sectionGap),
|
||||
|
||||
// Active SOS banner
|
||||
if (_hasActiveSos)
|
||||
_ActiveSosBanner(
|
||||
event: _events.first, onRefresh: _loadHistory),
|
||||
|
||||
const SizedBox(height: 24),
|
||||
SizedBox(height: sectionGap),
|
||||
|
||||
// SOS Button
|
||||
Center(
|
||||
@@ -312,6 +321,8 @@ class _SosScreenState extends State<SosScreen>
|
||||
? 'SOS aktif — Guardian sudah mendapat notifikasi'
|
||||
: 'Tekan tombol untuk kirim SOS darurat ke Guardian',
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: _hasActiveSos
|
||||
? const Color(0xFFDC2626)
|
||||
@@ -321,22 +332,25 @@ class _SosScreenState extends State<SosScreen>
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 28),
|
||||
SizedBox(height: sectionGap),
|
||||
|
||||
// History section
|
||||
const Text(
|
||||
'Riwayat SOS',
|
||||
style: TextStyle(fontWeight: FontWeight.w800, fontSize: 16),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
|
||||
Expanded(
|
||||
if (!landscapeTight) ...[
|
||||
const Text(
|
||||
'Riwayat SOS',
|
||||
style: TextStyle(fontWeight: FontWeight.w800, fontSize: 16),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Expanded(
|
||||
child: _SosHistory(
|
||||
loading: _historyLoading,
|
||||
error: _historyError,
|
||||
events: _events,
|
||||
onRefresh: _loadHistory,
|
||||
)),
|
||||
loading: _historyLoading,
|
||||
error: _historyError,
|
||||
events: _events,
|
||||
onRefresh: _loadHistory,
|
||||
),
|
||||
),
|
||||
] else
|
||||
const Spacer(),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -361,8 +375,16 @@ class _SosButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final screen = MediaQuery.sizeOf(context);
|
||||
final compact = screen.height < 620;
|
||||
final landscapeTight = screen.width > screen.height && screen.height < 520;
|
||||
final dimension = landscapeTight
|
||||
? 132.0
|
||||
: compact
|
||||
? 154.0
|
||||
: 200.0;
|
||||
return SizedBox.square(
|
||||
dimension: 200,
|
||||
dimension: dimension,
|
||||
child: FilledButton(
|
||||
style: FilledButton.styleFrom(
|
||||
shape: const CircleBorder(),
|
||||
@@ -377,14 +399,14 @@ class _SosButton extends StatelessWidget {
|
||||
children: [
|
||||
Icon(
|
||||
active ? Icons.emergency : Icons.emergency_outlined,
|
||||
size: 48,
|
||||
size: dimension < 150 ? 34 : 48,
|
||||
color: Colors.white,
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
SizedBox(height: dimension < 150 ? 3 : 6),
|
||||
Text(
|
||||
'SOS',
|
||||
style: const TextStyle(
|
||||
fontSize: 38,
|
||||
style: TextStyle(
|
||||
fontSize: dimension < 150 ? 28 : 38,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: Colors.white,
|
||||
letterSpacing: 2,
|
||||
@@ -402,8 +424,16 @@ class _SendingIndicator extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final screen = MediaQuery.sizeOf(context);
|
||||
final compact = screen.height < 620;
|
||||
final landscapeTight = screen.width > screen.height && screen.height < 520;
|
||||
final dimension = landscapeTight
|
||||
? 132.0
|
||||
: compact
|
||||
? 154.0
|
||||
: 200.0;
|
||||
return SizedBox.square(
|
||||
dimension: 200,
|
||||
dimension: dimension,
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFDC2626).withValues(alpha: 0.15),
|
||||
|
||||
Reference in New Issue
Block a user