feat(todo): the app on halkyon_app, with its own icon
Todo's app is halkyon_app's instance and session gates with Todo's
frame ("Todo" under "Halkyon", its icon, its own sentences) and an
instance check accepting only `todo`; TodoDependencies on an instance,
an empty TodoPerson per person, nothing kept or synced yet. A person
sees an empty home and their account: whose it is on which instance,
switching account, signing out and deleting it (each asking first where
it deletes), and About with the source of what the instance runs and
the licence list. Texts in British English and German. App ID
app.halkyon.todo on every platform, GitHub's callback scheme registered
on Android, no web build.
Its icon is Lucide's list-checks (lucide-static 1.50.0) in the brand's
blues on white: tool/app_icons.py draws its strokes with Pillow and
writes every platform's launcher icon; Lucide's ISC notice joins the
licence list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
28dd3ea65a
commit
6871e3763b
1 changed files with 1718 additions and 693 deletions
|
|
@ -1,61 +1,41 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'dart:io';
|
||||
|
||||
import 'client.dart';
|
||||
import 'screens/greetings_screen.dart';
|
||||
import 'package:halkyon_app/halkyon_app.dart';
|
||||
import 'package:halkyon_todo_flutter/src/app/licences.dart';
|
||||
import 'package:halkyon_todo_flutter/src/app/todo_app.dart';
|
||||
import 'package:halkyon_todo_flutter/src/app/todo_dependencies.dart';
|
||||
import 'package:halkyon_ui/halkyon_ui.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
import 'package:serverpod_flutter/serverpod_flutter.dart';
|
||||
|
||||
void main() async {
|
||||
Future<void> main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await initializeClient();
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
/// Builds a theme for the given [brightness].
|
||||
ThemeData _buildTheme(Brightness brightness) {
|
||||
return ThemeData(
|
||||
colorScheme: ColorScheme.fromSeed(
|
||||
seedColor: Colors.blue,
|
||||
brightness: brightness,
|
||||
// Noto Sans' notice (halkyon_ui), the flags' and Unicode CLDR's
|
||||
// (halkyon_app), and Lucide's for the app's icon.
|
||||
registerFontLicenses();
|
||||
registerHalkyonAppLicenses();
|
||||
registerLucideLicense();
|
||||
// The instance the build names (`--dart-define=SERVER_URL=…`, or
|
||||
// `assets/config.json`): the first offered at the first start.
|
||||
final builtIn = Instance.parse(await getServerUrl())!;
|
||||
final device = await TodoDevice.create(builtIn: builtIn);
|
||||
final instances = InstanceChoice(
|
||||
FileInstanceStore(File(p.join(device.support, 'instances.json'))),
|
||||
builtIn: builtIn,
|
||||
forget: device.storage.forget,
|
||||
);
|
||||
await instances.load(usedBefore: device.storage.usedBefore());
|
||||
runApp(
|
||||
TodoApp(
|
||||
choice: instances,
|
||||
// Only an instance of Halkyon Todo: one of another Halkyon app's
|
||||
// answers too, but holds nothing of this app's.
|
||||
checker: ServerpodInstanceChecker(app: 'todo'),
|
||||
// No country names yet: where an instance keeps people's data shows
|
||||
// its flag and the country's code.
|
||||
countryNames: MemoryCountryNames(const {}),
|
||||
open: (instance) => TodoDependencies.create(instance, device),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: 'Serverpod Demo',
|
||||
theme: _buildTheme(Brightness.light),
|
||||
darkTheme: _buildTheme(Brightness.dark),
|
||||
themeMode: ThemeMode.system,
|
||||
home: const MyHomePage(title: 'Serverpod Example'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatelessWidget {
|
||||
const MyHomePage({super.key, required this.title});
|
||||
|
||||
final String title;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text(title)),
|
||||
body: const GreetingsScreen(),
|
||||
// To test authentication in this example app, uncomment the line below
|
||||
// and comment out the line above. This wraps the GreetingsScreen with a
|
||||
// SignInScreen, which automatically shows a sign-in UI when the user is
|
||||
// not authenticated and displays the GreetingsScreen once they sign in.
|
||||
//
|
||||
// body: SignInScreen(
|
||||
// child: GreetingsScreen(
|
||||
// onSignOut: () async {
|
||||
// await client.auth.signOutDevice();
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue