desktop_remote_screen.dart 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_hbb/common.dart';
  3. import 'package:flutter_hbb/desktop/pages/remote_tab_page.dart';
  4. import 'package:flutter_hbb/models/platform_model.dart';
  5. import 'package:flutter_hbb/models/state_model.dart';
  6. import 'package:provider/provider.dart';
  7. /// multi-tab desktop remote screen
  8. class DesktopRemoteScreen extends StatelessWidget {
  9. final Map<String, dynamic> params;
  10. DesktopRemoteScreen({Key? key, required this.params}) : super(key: key) {
  11. bind.mainInitInputSource();
  12. stateGlobal.getInputSource(force: true);
  13. }
  14. @override
  15. Widget build(BuildContext context) {
  16. return MultiProvider(
  17. providers: [
  18. ChangeNotifierProvider.value(value: gFFI.ffiModel),
  19. ChangeNotifierProvider.value(value: gFFI.imageModel),
  20. ChangeNotifierProvider.value(value: gFFI.cursorModel),
  21. ChangeNotifierProvider.value(value: gFFI.canvasModel),
  22. ],
  23. child: Scaffold(
  24. // Set transparent background for padding the resize area out of the flutter view.
  25. // This allows the wallpaper goes through our resize area. (Linux only now).
  26. backgroundColor: isLinux ? Colors.transparent : null,
  27. body: ConnectionTabPage(
  28. params: params,
  29. ),
  30. ));
  31. }
  32. }