Flutter 3.47 moved Material and Cupertino out of the SDK into material_ui and cupertino_ui, which ship weekly. The SDK imports are deprecated from the November 2026 stable release and removed in 2027, and the strict pre-push check would block every push then. The app's one Material import now comes from material_ui ^1.5.0, so everything built from here on uses the new import. Packages that still import package:flutter/material.dart (Serverpod's Flutter packages, later the rich-text editor) see the app's theme and localizations only through MaterialUiCompatibilityBridge, set in MaterialApp.builder. The bridge is deprecated on purpose, as a reminder to remove it, so its use carries a documented ignore until those packages have moved. google_fonts is removed: it was unused, and by default it downloads fonts from Google at runtime, which sends every user's IP address to Google. AGENTS.md: Material comes from material_ui. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
36 lines
1.2 KiB
Dart
36 lines
1.2 KiB
Dart
import 'package:halkyon_learn_flutter/client.dart';
|
|
import 'package:material_ui/material_ui.dart';
|
|
|
|
void main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
await initializeClient();
|
|
runApp(const HalkyonLearnApp());
|
|
}
|
|
|
|
/// Builds a theme for the given [brightness].
|
|
ThemeData _buildTheme(Brightness brightness) {
|
|
return ThemeData(
|
|
colorScheme: ColorScheme.fromSeed(
|
|
seedColor: Colors.blue,
|
|
brightness: brightness,
|
|
),
|
|
);
|
|
}
|
|
|
|
class const HalkyonLearnApp({super.key}) extends StatelessWidget {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'Halkyon Learn',
|
|
theme: _buildTheme(Brightness.light),
|
|
darkTheme: _buildTheme(Brightness.dark),
|
|
// Packages that still import package:flutter/material.dart (Serverpod's sign-in
|
|
// widgets, the rich-text editor) see this app's theme and localizations only
|
|
// through the bridge, since material_ui is a separate copy of that library. The
|
|
// bridge is deprecated on purpose, as a reminder: remove it once they have moved.
|
|
// ignore: deprecated_member_use
|
|
builder: (context, child) => MaterialUiCompatibilityBridge(child: child!),
|
|
home: Scaffold(appBar: AppBar(title: const Text('Halkyon Learn'))),
|
|
);
|
|
}
|
|
}
|