utils/kuhy_credit/flutter/example/lib/main.dart
Krzysztof kuhy Rudnicki 50473d2d26 kuhy_credit: web element, Godot, Flutter, CI, README
Todo: 3a5477b9

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 15:33:19 +01:00

45 lines
1.3 KiB
Dart

import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'package:kuhy_credit/kuhy_credit.dart';
/// Demo: an empty token-coloured screen with the credit in the bottom-right
/// corner, the spot an app's about screen would give it.
void main() {
// Builds the semantics tree on web too, so screen readers and the E2E
// find the logo by its name.
WidgetsFlutterBinding.ensureInitialized();
SemanticsBinding.instance.ensureSemantics();
runApp(const CreditDemo());
}
/// The demo app.
class CreditDemo extends StatelessWidget {
/// Creates the demo.
const CreditDemo({super.key});
@override
Widget build(BuildContext context) {
final dark =
MediaQuery.platformBrightnessOf(context) == Brightness.dark;
return WidgetsApp(
color: Color(dark ? kDarkBg : kLightBg),
pageRouteBuilder: <T>(settings, builder) => PageRouteBuilder<T>(
settings: settings,
pageBuilder: (context, _, _) => builder(context),
),
home: ColoredBox(
color: Color(dark ? kDarkBg : kLightBg),
child: const SafeArea(
child: Align(
alignment: Alignment.bottomRight,
child: Padding(
padding: EdgeInsets.all(16),
child: KuhyCredit(),
),
),
),
),
);
}
}