mirror of
https://github.com/immich-app/immich.git
synced 2026-02-28 09:38:43 +03:00
* feat: html text * feat: mobile ui showcase (#25827) * feat: mobile ui showcase * remove showcase from main app * update fonts * update code to be loaded from asset * fix ci --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> # Conflicts: # mobile/lib/widgets/common/immich_sliver_app_bar.dart --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
56 lines
1.4 KiB
Dart
56 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
import 'package:immich_ui/immich_ui.dart';
|
|
import 'package:showcase/app_theme.dart';
|
|
import 'package:showcase/constants.dart';
|
|
import 'package:showcase/router.dart';
|
|
import 'package:showcase/widgets/example_card.dart';
|
|
|
|
void main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
await initializeCodeHighlighter();
|
|
runApp(const ShowcaseApp());
|
|
}
|
|
|
|
class ShowcaseApp extends StatefulWidget {
|
|
const ShowcaseApp({super.key});
|
|
|
|
@override
|
|
State<ShowcaseApp> createState() => _ShowcaseAppState();
|
|
}
|
|
|
|
class _ShowcaseAppState extends State<ShowcaseApp> {
|
|
ThemeMode _themeMode = ThemeMode.light;
|
|
late final GoRouter _router;
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
_router = AppRouter.createRouter(_toggleTheme);
|
|
}
|
|
|
|
void _toggleTheme() {
|
|
setState(() {
|
|
_themeMode = _themeMode == ThemeMode.light
|
|
? ThemeMode.dark
|
|
: ThemeMode.light;
|
|
});
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp.router(
|
|
title: appTitle,
|
|
themeMode: _themeMode,
|
|
routerConfig: _router,
|
|
theme: AppTheme.lightTheme,
|
|
darkTheme: AppTheme.darkTheme,
|
|
debugShowCheckedModeBanner: false,
|
|
builder: (context, child) => ImmichThemeProvider(
|
|
colorScheme: Theme.of(context).colorScheme,
|
|
child: child!,
|
|
),
|
|
);
|
|
}
|
|
}
|