Files
TagesByte/lib/main.dart
CedricandClaude Opus 5.5 f12fb1dabb Initial commit: Tagesbyte prototype
Flutter app that collects daily tech news from German and English RSS/Atom
feeds, with a reader view, AI article summaries and daily briefings (Claude
API or n8n webhook), paywall/sponsored filtering and ad/consent blocking.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 14:53:37 +02:00

46 lines
1.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'services/storage.dart';
import 'state/app_state.dart';
import 'ui/common.dart';
import 'ui/home_shell.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
// Portrait only; also set in AndroidManifest.xml and Info.plist.
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
final state = AppState(await Storage.open());
runApp(DailyTechNewsApp(state: state));
state.init();
}
class DailyTechNewsApp extends StatelessWidget {
const DailyTechNewsApp({super.key, required this.state});
final AppState state;
static const _seed = Color(0xFF3355DD);
@override
Widget build(BuildContext context) {
ThemeData theme(Brightness brightness) => ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: _seed, brightness: brightness),
cardTheme: const CardThemeData(margin: EdgeInsets.zero),
);
// Rebuild when the theme setting changes; everything else listens itself.
return ListenableBuilder(
listenable: state,
builder: (context, _) => MaterialApp(
title: appName,
debugShowCheckedModeBanner: false,
theme: theme(Brightness.light),
darkTheme: theme(Brightness.dark),
themeMode: state.settings.themeMode,
home: HomeShell(state: state),
),
);
}
}