remove RightShiftFixer for winodws, flutter should be better now; rm tri[lecolview, unused half a year #271
|
@ -3,7 +3,6 @@ import 'package:cwtch/config.dart';
|
|||
import 'package:cwtch/notification_manager.dart';
|
||||
import 'package:cwtch/themes/cwtch.dart';
|
||||
import 'package:cwtch/views/messageview.dart';
|
||||
import 'package:cwtch/widgets/rightshiftfixer.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:cwtch/cwtch/ffi.dart';
|
||||
import 'package:cwtch/cwtch/gomobile.dart';
|
||||
|
@ -11,7 +10,6 @@ import 'package:flutter/material.dart';
|
|||
import 'package:cwtch/errorHandler.dart';
|
||||
import 'package:cwtch/settings.dart';
|
||||
import 'package:cwtch/torstatus.dart';
|
||||
import 'package:cwtch/views/triplecolview.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'cwtch/cwtch.dart';
|
||||
|
@ -110,7 +108,7 @@ class FlwtchState extends State<Flwtch> {
|
|||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
title: 'Cwtch',
|
||||
theme: mkThemeData(settings),
|
||||
home: (!appState.cwtchInit || appState.modalState != ModalState.none) ? SplashView() : ShiftRightFixer(child: ProfileMgrView()),
|
||||
home: (!appState.cwtchInit || appState.modalState != ModalState.none) ? SplashView() : ProfileMgrView(),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:cwtch/views/profilemgrview.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import '../main.dart';
|
||||
import '../model.dart';
|
||||
import '../settings.dart';
|
||||
import 'contactsview.dart';
|
||||
import 'messageview.dart';
|
||||
|
||||
// currently unused but maybe one day?
|
||||
class TripleColumnView extends StatefulWidget {
|
||||
@override
|
||||
_TripleColumnViewState createState() => _TripleColumnViewState();
|
||||
}
|
||||
|
||||
class _TripleColumnViewState extends State<TripleColumnView> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var appState = Provider.of<AppState>(context);
|
||||
var settings = Provider.of<Settings>(context);
|
||||
var columns = settings.uiColumns(appState.isLandscape(context));
|
||||
|
||||
return Flex(direction: Axis.horizontal, children: <Widget>[
|
||||
Flexible(
|
||||
flex: columns[0],
|
||||
child: ProfileMgrView(),
|
||||
),
|
||||
Flexible(
|
||||
flex: columns[1],
|
||||
child: appState.selectedProfile == null ? Center(child: Text(AppLocalizations.of(context)!.createProfileToBegin)) : ContactsView(), //dev
|
||||
),
|
||||
Flexible(
|
||||
flex: columns[2],
|
||||
child: appState.selectedConversation == null
|
||||
? Center(child: Text(AppLocalizations.of(context)!.addContactFirst))
|
||||
: //dev
|
||||
Container(child: MessageView()),
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
// From https://github.com/flutter/flutter/issues/75675#issuecomment-846601115
|
||||
// necessary to fix bug in flutter engine on Windows.
|
||||
// todo: hopefully we can remove this soon
|
||||
class ShiftRightFixer extends StatefulWidget {
|
||||
ShiftRightFixer({required this.child});
|
||||
final Widget child;
|
||||
@override
|
||||
State<StatefulWidget> createState() => _ShiftRightFixerState();
|
||||
}
|
||||
|
||||
class _ShiftRightFixerState extends State<ShiftRightFixer> {
|
||||
final FocusNode focus = FocusNode(skipTraversal: true, canRequestFocus: false);
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Focus(
|
||||
focusNode: focus,
|
||||
onKey: (_, RawKeyEvent event) {
|
||||
return event.physicalKey == PhysicalKeyboardKey.shiftRight ? KeyEventResult.handled : KeyEventResult.ignored;
|
||||
},
|
||||
child: widget.child,
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue