mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-09 07:28:14 -07:00
feature: Rework responsive layout (#217)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
e07f280124
commit
8012fdcea8
48 changed files with 1468 additions and 1040 deletions
|
|
@ -18,6 +18,7 @@ import 'package:universal_html/html.dart' as html;
|
|||
import 'package:window_manager/window_manager.dart';
|
||||
|
||||
import 'package:fladder/models/account_model.dart';
|
||||
import 'package:fladder/models/settings/home_settings_model.dart';
|
||||
import 'package:fladder/models/syncing/i_synced_item.dart';
|
||||
import 'package:fladder/providers/crash_log_provider.dart';
|
||||
import 'package:fladder/providers/settings/client_settings_provider.dart';
|
||||
|
|
@ -25,6 +26,7 @@ import 'package:fladder/providers/shared_provider.dart';
|
|||
import 'package:fladder/providers/sync_provider.dart';
|
||||
import 'package:fladder/providers/user_provider.dart';
|
||||
import 'package:fladder/providers/video_player_provider.dart';
|
||||
import 'package:fladder/routes/auto_router.dart';
|
||||
import 'package:fladder/routes/auto_router.gr.dart';
|
||||
import 'package:fladder/screens/login/lock_screen.dart';
|
||||
import 'package:fladder/theme.dart';
|
||||
|
|
@ -100,11 +102,11 @@ void main() async {
|
|||
))
|
||||
],
|
||||
child: AdaptiveLayoutBuilder(
|
||||
fallBack: LayoutState.tablet,
|
||||
fallBack: ViewSize.tablet,
|
||||
layoutPoints: [
|
||||
LayoutPoints(start: 0, end: 599, type: LayoutState.phone),
|
||||
LayoutPoints(start: 600, end: 1919, type: LayoutState.tablet),
|
||||
LayoutPoints(start: 1920, end: 3180, type: LayoutState.desktop),
|
||||
LayoutPoints(start: 0, end: 599, type: ViewSize.phone),
|
||||
LayoutPoints(start: 600, end: 1919, type: ViewSize.tablet),
|
||||
LayoutPoints(start: 1920, end: 3180, type: ViewSize.desktop),
|
||||
],
|
||||
child: const Main(),
|
||||
),
|
||||
|
|
@ -122,6 +124,7 @@ class Main extends ConsumerStatefulWidget with WindowListener {
|
|||
class _MainState extends ConsumerState<Main> with WindowListener, WidgetsBindingObserver {
|
||||
DateTime dateTime = DateTime.now();
|
||||
bool hidden = false;
|
||||
late final autoRouter = AutoRouter(ref: ref);
|
||||
|
||||
@override
|
||||
void didChangeAppLifecycleState(AppLifecycleState state) async {
|
||||
|
|
@ -159,7 +162,7 @@ class _MainState extends ConsumerState<Main> with WindowListener, WidgetsBinding
|
|||
await ref.read(videoPlayerProvider).pause();
|
||||
|
||||
if (context.mounted) {
|
||||
AdaptiveLayout.of(context).router.push(const LockRoute());
|
||||
autoRouter.push(const LockRoute());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -298,7 +301,8 @@ class _MainState extends ConsumerState<Main> with WindowListener, WidgetsBinding
|
|||
),
|
||||
),
|
||||
themeMode: themeMode,
|
||||
routerConfig: AdaptiveLayout.routerOf(context).config(),
|
||||
routerConfig: autoRouter.config(),
|
||||
// routerConfig: AdaptiveLayout.routerOf(context).config(),
|
||||
),
|
||||
);
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue