Šepot — end-to-end encrypted messenger
Initial public release. Anonymous on-device identity (no phone number, e-mail, or password), Signal-protocol cryptography (X3DH + PQXDH, Double Ratchet, sealed sender) via libsignal, a metadata-minimizing relay, group chats, disappearing messages, encrypted local storage, optional Tor transport, and a UI localized into Czech, English, German, Russian, and Italian. Monorepo: Flutter client (app/), Rust relay + wire types (rust/), protobuf definitions (proto/), self-host deploy (deploy/). Licensed under AGPL-3.0 with an app-store distribution exception (§7).
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:sepot/core/theme/app_theme.dart';
|
||||
|
||||
/// Generovaný avatar z iniciál
|
||||
class SepotAvatar extends StatelessWidget {
|
||||
final String name;
|
||||
final double size;
|
||||
final bool isOnline;
|
||||
|
||||
const SepotAvatar({
|
||||
super.key,
|
||||
required this.name,
|
||||
this.size = 48,
|
||||
this.isOnline = false,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final initials = _getInitials(name);
|
||||
final color = _colorFromName(name);
|
||||
|
||||
return Stack(
|
||||
children: [
|
||||
Container(
|
||||
width: size,
|
||||
height: size,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
// Nokturno: tichý tmavý podklad, barva jen v iniciálách
|
||||
color: SepotColors.surfaceVariant,
|
||||
border: Border.all(color: SepotColors.border),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
initials,
|
||||
style: TextStyle(
|
||||
color: color,
|
||||
fontSize: size * 0.35,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (isOnline)
|
||||
Positioned(
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
child: Container(
|
||||
width: size * 0.28,
|
||||
height: size * 0.28,
|
||||
decoration: BoxDecoration(
|
||||
color: SepotColors.success,
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(
|
||||
color: SepotColors.background,
|
||||
width: 2,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
String _getInitials(String name) {
|
||||
final parts = name.trim().split(' ');
|
||||
if (parts.length >= 2) {
|
||||
return '${parts[0][0]}${parts[1][0]}'.toUpperCase();
|
||||
}
|
||||
return name.substring(0, name.length >= 2 ? 2 : 1).toUpperCase();
|
||||
}
|
||||
|
||||
Color _colorFromName(String name) {
|
||||
// Jen tlumené tóny palety — žádné syté cizí barvy
|
||||
final colors = [
|
||||
SepotColors.ember,
|
||||
SepotColors.mist,
|
||||
SepotColors.sage,
|
||||
SepotColors.warning,
|
||||
SepotColors.textSecondary,
|
||||
];
|
||||
return colors[name.hashCode.abs() % colors.length];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:sepot/core/l10n/l10n.dart';
|
||||
import 'package:sepot/core/theme/app_theme.dart';
|
||||
|
||||
/// Badge indikující E2E šifrování
|
||||
class E2EBadge extends StatelessWidget {
|
||||
final bool compact;
|
||||
|
||||
const E2EBadge({super.key, this.compact = false});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (compact) {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.lock_rounded, size: 12, color: SepotColors.ember),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
context.l10n.commonE2eBadgeCompact,
|
||||
style: const TextStyle(
|
||||
fontSize: 10,
|
||||
color: SepotColors.ember,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: SepotColors.ember.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(
|
||||
color: SepotColors.ember.withValues(alpha: 0.3),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.lock_rounded, size: 14, color: SepotColors.ember),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
context.l10n.commonE2eBadgeFull,
|
||||
style: const TextStyle(
|
||||
fontSize: 11,
|
||||
color: SepotColors.ember,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
/// Numerická klávesnice pro PIN + řádek teček.
|
||||
///
|
||||
/// Vytaženo z `pin_setup_screen`, aby ji mohla použít i změna PINu.
|
||||
/// Systémovou klávesnici záměrně nepoužíváme — nechceme, aby PIN prošel
|
||||
/// IME (predikce, schránka, klávesnice třetích stran).
|
||||
library;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:sepot/core/theme/app_theme.dart';
|
||||
|
||||
class PinDots extends StatelessWidget {
|
||||
const PinDots({super.key, required this.filled, this.length = 6});
|
||||
|
||||
final int filled;
|
||||
final int length;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: List.generate(length, (i) {
|
||||
final on = i < filled;
|
||||
return Container(
|
||||
width: 16,
|
||||
height: 16,
|
||||
margin: const EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: on ? SepotColors.ember : SepotColors.border,
|
||||
border: Border.all(
|
||||
color: on ? SepotColors.ember : SepotColors.border,
|
||||
width: 2,
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class PinKeypad extends StatelessWidget {
|
||||
const PinKeypad({super.key, required this.onKey, this.enabled = true});
|
||||
|
||||
/// Dostane číslici '0'–'9' nebo 'DEL'.
|
||||
final void Function(String key) onKey;
|
||||
final bool enabled;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
for (final row in const [
|
||||
['1', '2', '3'],
|
||||
['4', '5', '6'],
|
||||
['7', '8', '9'],
|
||||
['', '0', 'DEL'],
|
||||
])
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: row
|
||||
.map((k) => k.isEmpty
|
||||
? const SizedBox(width: 88, height: 64)
|
||||
: _klavesa(k))
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _klavesa(String key) {
|
||||
final delete = key == 'DEL';
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
child: InkWell(
|
||||
onTap: enabled
|
||||
? () {
|
||||
HapticFeedback.lightImpact();
|
||||
onKey(key);
|
||||
}
|
||||
: null,
|
||||
borderRadius: BorderRadius.circular(32),
|
||||
child: Container(
|
||||
width: 64,
|
||||
height: 64,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: delete ? Colors.transparent : SepotColors.surfaceVariant,
|
||||
border: delete ? null : Border.all(color: SepotColors.border),
|
||||
),
|
||||
child: Center(
|
||||
child: delete
|
||||
? const Icon(Icons.backspace_outlined,
|
||||
color: SepotColors.textSecondary, size: 24)
|
||||
: Text(
|
||||
key,
|
||||
style: const TextStyle(
|
||||
fontFamily: kFontSans,
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: SepotColors.textPrimary,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:sepot/core/l10n/l10n.dart';
|
||||
import 'package:sepot/core/theme/app_theme.dart';
|
||||
|
||||
/// Logo Šepot — brand mark „Š s tečkami" (nokturno-ikona-B2).
|
||||
///
|
||||
/// Používá STEJNÝ obrázek jako launcher ikona
|
||||
/// (`assets/icon/icon-1024.png`), aby logo na ploše, na splash i uvnitř
|
||||
/// appky bylo jednotné.
|
||||
class SepotLogo extends StatelessWidget {
|
||||
final double size;
|
||||
final bool showText;
|
||||
|
||||
const SepotLogo({
|
||||
super.key,
|
||||
this.size = 80,
|
||||
this.showText = true,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(size * 0.24),
|
||||
child: Image.asset(
|
||||
'assets/icon/icon-1024.png',
|
||||
width: size,
|
||||
height: size,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
if (showText) ...[
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
context.l10n.commonAppName,
|
||||
style: TextStyle(
|
||||
fontFamily: kFontSans,
|
||||
fontSize: size * 0.35,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: SepotColors.textPrimary,
|
||||
letterSpacing: -0.5,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
context.l10n.commonAppTagline,
|
||||
style: TextStyle(
|
||||
fontFamily: kFontSans,
|
||||
fontSize: size * 0.15,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: SepotColors.textSecondary,
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user