Replace inline Colors.* with SojornColors tokens in quip_editor, quip_metadata, video_editor screens

This commit is contained in:
Patrick Britton 2026-02-10 14:40:48 -06:00
parent 7a53f41b97
commit 2551829604
2 changed files with 43 additions and 41 deletions

View file

@ -11,6 +11,7 @@ import 'package:ffmpeg_kit_flutter_new/return_code.dart';
import '../../models/sojorn_media_result.dart';
import '../../theme/app_theme.dart';
import '../../theme/tokens.dart';
/// Sojorn Video Editor with basic trimming and FFmpeg export
/// Implements video editing with H.264 codec support via FFmpeg
@ -229,7 +230,7 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
if (!_isExporting) return const SizedBox.shrink();
return Container(
color: Colors.black54,
color: const Color(0x8A000000),
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
@ -241,7 +242,7 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
const SizedBox(height: 16),
Text(
_exportStatus.isNotEmpty ? _exportStatus : 'Exporting...',
style: const TextStyle(color: Colors.white),
style: const TextStyle(color: SojornColors.basicWhite),
),
],
),
@ -338,15 +339,15 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
children: [
Text(
'Start: ${_startTrim.inSeconds}s',
style: GoogleFonts.inter(color: Colors.white70),
style: GoogleFonts.inter(color: SojornColors.basicWhite.withValues(alpha: 0.7)),
),
Text(
'End: ${_endTrim.inSeconds}s',
style: GoogleFonts.inter(color: Colors.white70),
style: GoogleFonts.inter(color: SojornColors.basicWhite.withValues(alpha: 0.7)),
),
Text(
'Duration: ${trimDuration.inSeconds}s',
style: GoogleFonts.inter(color: Colors.white70),
style: GoogleFonts.inter(color: SojornColors.basicWhite.withValues(alpha: 0.7)),
),
],
),
@ -354,7 +355,7 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
SliderTheme(
data: SliderTheme.of(context).copyWith(
activeTrackColor: _brightNavy,
inactiveTrackColor: Colors.white24,
inactiveTrackColor: SojornColors.basicWhite.withValues(alpha: 0.24),
thumbColor: _brightNavy,
overlayColor: _brightNavy.withOpacity(0.2),
trackHeight: 4,
@ -387,7 +388,7 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
},
icon: Icon(
_isTrimming ? Icons.check : Icons.edit,
color: _isTrimming ? _brightNavy : Colors.white70,
color: _isTrimming ? _brightNavy : SojornColors.basicWhite.withValues(alpha: 0.7),
),
tooltip: _isTrimming ? 'Finish Trimming' : 'Enable Trimming',
),
@ -399,7 +400,7 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
_endTrim = duration;
});
},
icon: Icon(Icons.restore, color: Colors.white70),
icon: Icon(Icons.restore, color: SojornColors.basicWhite.withValues(alpha: 0.7)),
tooltip: 'Reset Trim',
),
],
@ -413,20 +414,20 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
// For web or bytes, show placeholder
if (kIsWeb || widget.videoBytes != null) {
return Scaffold(
backgroundColor: _matteBlack,
backgroundColor: SojornColors.matteBlack,
appBar: AppBar(
backgroundColor: _matteBlack,
foregroundColor: Colors.white,
backgroundColor: SojornColors.matteBlack,
foregroundColor: SojornColors.basicWhite,
leading: IconButton(
tooltip: 'Cancel',
icon: const Icon(Icons.close),
onPressed: _isExporting ? null : () => Navigator.pop(context),
onPressed: () => Navigator.of(context).pop(),
),
actions: [
TextButton(
onPressed: _isExporting ? null : _saveWithoutEditing,
style: TextButton.styleFrom(
foregroundColor: _brightNavy,
foregroundColor: SojornColors.brightNavy,
),
child: _isExporting
? const SizedBox(
@ -434,7 +435,7 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
height: 16,
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(Colors.white),
valueColor: AlwaysStoppedAnimation<Color>(SojornColors.basicWhite),
),
)
: const Text('Save'),
@ -449,7 +450,7 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
Icon(
Icons.video_library,
size: 64,
color: _brightNavy,
color: SojornColors.brightNavy,
),
const SizedBox(height: 24),
Padding(
@ -459,7 +460,7 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
style: GoogleFonts.inter(
fontSize: 24,
fontWeight: FontWeight.w600,
color: Colors.white,
color: SojornColors.basicWhite,
),
textAlign: TextAlign.center,
),
@ -471,7 +472,7 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
'Video editing is not supported on web yet.\nYour video will be saved without editing.',
style: GoogleFonts.inter(
fontSize: 14,
color: Colors.white70,
color: SojornColors.basicWhite.withValues(alpha: 0.7),
),
textAlign: TextAlign.center,
),
@ -483,8 +484,8 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
label: Text(
_isExporting ? 'Processing...' : 'Continue with Video'),
style: ElevatedButton.styleFrom(
backgroundColor: _brightNavy,
foregroundColor: Colors.white,
backgroundColor: SojornColors.brightNavy,
foregroundColor: SojornColors.basicWhite,
padding: const EdgeInsets.symmetric(
horizontal: 32,
vertical: 16,
@ -500,18 +501,18 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
// Show loading state
if (_isLoading) {
return Scaffold(
backgroundColor: _matteBlack,
backgroundColor: SojornColors.matteBlack,
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
CircularProgressIndicator(
color: _brightNavy,
color: SojornColors.brightNavy,
),
const SizedBox(height: 16),
const Text(
'Initializing editor...',
style: TextStyle(color: Colors.white),
style: TextStyle(color: SojornColors.basicWhite),
),
],
),
@ -522,10 +523,10 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
// Show error state if initialization failed
if (!_isInitialized) {
return Scaffold(
backgroundColor: _matteBlack,
backgroundColor: SojornColors.matteBlack,
appBar: AppBar(
backgroundColor: _matteBlack,
foregroundColor: Colors.white,
foregroundColor: SojornColors.basicWhite,
leading: IconButton(
tooltip: 'Cancel',
icon: const Icon(Icons.close),
@ -549,7 +550,7 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
style: GoogleFonts.inter(
fontSize: 20,
fontWeight: FontWeight.w600,
color: Colors.white,
color: SojornColors.basicWhite,
),
textAlign: TextAlign.center,
),
@ -561,7 +562,7 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
'Please try again or use a different video',
style: GoogleFonts.inter(
fontSize: 14,
color: Colors.white70,
color: SojornColors.basicWhite.withValues(alpha: 0.7),
),
textAlign: TextAlign.center,
),
@ -573,7 +574,7 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
label: const Text('Save Original Video'),
style: ElevatedButton.styleFrom(
backgroundColor: _brightNavy,
foregroundColor: Colors.white,
foregroundColor: SojornColors.basicWhite,
padding: const EdgeInsets.symmetric(
horizontal: 32,
vertical: 16,
@ -591,7 +592,7 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
backgroundColor: _matteBlack,
appBar: AppBar(
backgroundColor: _matteBlack,
foregroundColor: Colors.white,
foregroundColor: SojornColors.basicWhite,
leading: IconButton(
tooltip: 'Cancel',
icon: const Icon(Icons.close),
@ -609,7 +610,7 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
height: 16,
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(Colors.white),
valueColor: AlwaysStoppedAnimation<Color>(SojornColors.basicWhite),
),
)
: const Text('Save'),
@ -635,7 +636,7 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.05),
color: SojornColors.basicWhite.withValues(alpha: 0.05),
borderRadius: BorderRadius.circular(8),
),
child: Row(
@ -643,7 +644,7 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
children: [
Text(
'Original: ${_videoController!.value.duration.inSeconds}s',
style: GoogleFonts.inter(color: Colors.white70),
style: GoogleFonts.inter(color: SojornColors.basicWhite.withValues(alpha: 0.7)),
),
Text(
'Trimmed: ${(_endTrim - _startTrim).inSeconds}s',
@ -651,7 +652,7 @@ class _sojornVideoEditorState extends State<sojornVideoEditor> {
color: (_endTrim - _startTrim) <
_videoController!.value.duration
? _brightNavy
: Colors.white70,
: SojornColors.basicWhite.withValues(alpha: 0.7),
fontWeight: FontWeight.w600,
),
),

View file

@ -8,6 +8,7 @@ import '../../../services/api_service.dart';
import '../../../models/sojorn_media_result.dart';
import '../../../providers/api_provider.dart';
import '../../../theme/tokens.dart';
import '../../../services/image_upload_service.dart';
import '../../../theme/app_theme.dart';
import '../../compose/video_editor_screen.dart';
@ -159,7 +160,7 @@ class _QuipEditorScreenState extends ConsumerState<QuipEditorScreen> {
backgroundColor: const Color(0xFF0B0B0B),
appBar: AppBar(
backgroundColor: const Color(0xFF0B0B0B),
foregroundColor: Colors.white,
foregroundColor: SojornColors.basicWhite,
title: const Text('Create Quip'),
actions: [
if (!videoDurationOk)
@ -187,7 +188,7 @@ class _QuipEditorScreenState extends ConsumerState<QuipEditorScreen> {
Expanded(
child: Container(
decoration: BoxDecoration(
color: Colors.black,
color: SojornColors.basicBlack,
borderRadius: BorderRadius.circular(16),
border: Border.all(
color: AppTheme.brightNavy.withOpacity(0.3),
@ -206,7 +207,7 @@ class _QuipEditorScreenState extends ConsumerState<QuipEditorScreen> {
const SizedBox(height: 16),
Text(
'Video Duration: ${widget.originalDuration.inSeconds}s',
style: const TextStyle(color: Colors.white70),
style: TextStyle(color: SojornColors.basicWhite.withValues(alpha: 0.7)),
),
if (!videoDurationOk) ...[
const SizedBox(height: 8),
@ -243,17 +244,17 @@ class _QuipEditorScreenState extends ConsumerState<QuipEditorScreen> {
controller: _captionController,
maxLines: 2,
maxLength: 150,
style: const TextStyle(color: Colors.white),
style: const TextStyle(color: SojornColors.basicWhite),
decoration: InputDecoration(
hintText: 'Add a caption (optional)',
hintStyle: const TextStyle(color: Colors.white54),
hintStyle: TextStyle(color: SojornColors.basicWhite.withValues(alpha: 0.54)),
filled: true,
fillColor: Colors.white.withOpacity(0.08),
fillColor: SojornColors.basicWhite.withValues(alpha: 0.08),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide.none,
),
counterStyle: const TextStyle(color: Colors.white54),
counterStyle: TextStyle(color: SojornColors.basicWhite.withValues(alpha: 0.54)),
),
),
const SizedBox(height: 16),
@ -278,7 +279,7 @@ class _QuipEditorScreenState extends ConsumerState<QuipEditorScreen> {
Expanded(
child: Text(
_statusMessage!,
style: const TextStyle(color: Colors.white70),
style: TextStyle(color: SojornColors.basicWhite.withValues(alpha: 0.7)),
),
),
],
@ -292,7 +293,7 @@ class _QuipEditorScreenState extends ConsumerState<QuipEditorScreen> {
label: Text(_isUploading ? 'Uploading...' : 'Post Quip'),
style: ElevatedButton.styleFrom(
backgroundColor: AppTheme.brightNavy,
foregroundColor: Colors.white,
foregroundColor: SojornColors.basicWhite,
padding: const EdgeInsets.symmetric(vertical: 16),
disabledBackgroundColor: AppTheme.brightNavy.withOpacity(0.5),
),