Fix org creation dialog, document viewer colors, and font errors

This commit is contained in:
Leon Bösche
2026-01-11 02:14:51 +01:00
parent 9952323252
commit 7259aa41fd
4 changed files with 130 additions and 59 deletions

View File

@@ -94,7 +94,13 @@ class _MainAppState extends State<MainApp> {
return MaterialApp(
theme: AppTheme.darkTheme,
home: const Scaffold(
body: Center(child: CircularProgressIndicator()),
body: Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(
AppTheme.accentColor,
),
),
),
),
);
}

View File

@@ -132,7 +132,16 @@ class _DocumentViewerModalState extends State<DocumentViewerModal> {
child: BlocBuilder<DocumentViewerBloc, DocumentViewerState>(
builder: (context, state) {
if (state is DocumentViewerLoading) {
return const Center(child: CircularProgressIndicator());
return Container(
color: AppTheme.primaryBackground,
child: const Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(
AppTheme.accentColor,
),
),
),
);
}
if (state is DocumentViewerError) {
return Center(
@@ -300,7 +309,16 @@ class _DocumentViewerState extends State<DocumentViewer> {
body: BlocBuilder<DocumentViewerBloc, DocumentViewerState>(
builder: (context, state) {
if (state is DocumentViewerLoading) {
return const Center(child: CircularProgressIndicator());
return Container(
color: AppTheme.primaryBackground,
child: const Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(
AppTheme.accentColor,
),
),
),
);
}
if (state is DocumentViewerError) {
return Center(child: Text('Error: ${state.message}'));

View File

@@ -96,61 +96,113 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
child: Container(
padding: const EdgeInsets.all(24),
decoration: AppTheme.glassDecoration,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
'Create New Organization',
style: TextStyle(
color: AppTheme.primaryText,
fontSize: 18,
fontWeight: FontWeight.bold,
child: BlocListener<OrganizationBloc, OrganizationState>(
listener: (context, state) {
if (state is OrganizationLoaded && !state.isLoading) {
if (state.error == null) {
// Success - close dialog
Navigator.of(context).pop();
}\n }
},
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
'Create New Organization',
style: TextStyle(
color: AppTheme.primaryText,
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 16),
TextField(
cursorColor: AppTheme.accentColor,
controller: controller,
style: TextStyle(color: AppTheme.primaryText),
decoration: InputDecoration(
labelText: 'Organization Name',
labelStyle: TextStyle(color: AppTheme.secondaryText),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: BorderSide(
color: AppTheme.accentColor.withValues(alpha: 0.5),
const SizedBox(height: 16),
TextField(
cursorColor: AppTheme.accentColor,
controller: controller,
style: TextStyle(color: AppTheme.primaryText),
decoration: InputDecoration(
labelText: 'Organization Name',
labelStyle: TextStyle(color: AppTheme.secondaryText),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: BorderSide(
color:\n AppTheme.accentColor.withValues(alpha: 0.5),
),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide:\n BorderSide(color: AppTheme.accentColor),
),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: BorderSide(color: AppTheme.accentColor),
),
onSubmitted: (value) {
final name = controller.text.trim();
if (name.isNotEmpty) {
BlocProvider.of<OrganizationBloc>(
context,
).add(CreateOrganization(name));
}
},
),
),
const SizedBox(height: 24),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
ModernGlassButton(
onPressed: () => Navigator.of(context).pop(),
child: const Text('Cancel'),
),
const SizedBox(width: 16),
ModernGlassButton(
onPressed: () {
final name = controller.text.trim();
if (name.isNotEmpty) {
BlocProvider.of<OrganizationBloc>(
context,
).add(CreateOrganization(name));
Navigator.of(context).pop();
}
},
child: const Text('Create'),
),
],
),
],
const SizedBox(height: 24),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
ModernGlassButton(
onPressed: () => Navigator.of(context).pop(),
child: const Text('Cancel'),
),
const SizedBox(width: 16),
BlocBuilder<OrganizationBloc, OrganizationState>(
builder: (context, state) {
final isLoading = state is OrganizationLoaded &&
state.isLoading;
return ModernGlassButton(
onPressed: isLoading
? null
: () {
final name = controller.text.trim();
if (name.isNotEmpty) {
BlocProvider.of<OrganizationBloc>(
context,
).add(CreateOrganization(name));
}
},
child: isLoading
? const SizedBox(
width: 20,
height: 20,
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor:\n AlwaysStoppedAnimation<Color>(
AppTheme.accentColor,
),
),
)
: const Text('Create'),
);
},
),
],
),
const SizedBox(height: 8),
// Error message
BlocBuilder<OrganizationBloc, OrganizationState>(
builder: (context, state) {
if (state is OrganizationLoaded &&
state.error != null) {
return Text(
state.error!,
style: const TextStyle(
color: Colors.red,
fontSize: 12,
),
);
}
return const SizedBox.shrink();
},
),
],
),
),
),
),

View File

@@ -76,8 +76,3 @@ flutter:
assets:
- assets/fonts/
fonts:
- family: PixelatedElegance
fonts:
- asset: assets/fonts/pixelated-elegance/PixelatedEleganceRegular-ovyAA.ttf