bug fixes for mobile view
This commit is contained in:
parent
6b49e1d5e4
commit
86de81adb3
@ -39,6 +39,7 @@ class MyApp extends StatelessWidget {
|
||||
title: 'SimpleX Chat',
|
||||
theme: theme.copyWith(
|
||||
colorScheme: theme.colorScheme.copyWith(secondary: kPrimaryColor),
|
||||
primaryColorLight: Colors.white,
|
||||
),
|
||||
builder: (context, widget) {
|
||||
return ScrollConfiguration(
|
||||
|
@ -1,8 +1,5 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:qr_code_scanner/qr_code_scanner.dart';
|
||||
import 'package:simplex_chat/views/contacts/qr_code_details_view.dart';
|
||||
|
||||
class AddContactView extends StatefulWidget {
|
||||
const AddContactView({Key? key}) : super(key: key);
|
||||
@ -17,16 +14,6 @@ class _AddContactViewState extends State<AddContactView> {
|
||||
QRViewController? _qrViewController;
|
||||
Barcode? result;
|
||||
|
||||
@override
|
||||
void reassemble() {
|
||||
super.reassemble();
|
||||
if (Platform.isAndroid) {
|
||||
_qrViewController!.pauseCamera();
|
||||
} else if (Platform.isIOS) {
|
||||
_qrViewController!.resumeCamera();
|
||||
}
|
||||
}
|
||||
|
||||
// alert dialgoue
|
||||
void _initialWarning() {
|
||||
showDialog(
|
||||
@ -174,7 +161,7 @@ class _AddContactViewState extends State<AddContactView> {
|
||||
controller.scannedDataStream.listen((scanData) {
|
||||
setState(() async {
|
||||
result = scanData;
|
||||
await controller.pauseCamera();
|
||||
await controller.stopCamera();
|
||||
if (result != null) {
|
||||
Navigator.of(context).pop(true);
|
||||
}
|
||||
|
@ -117,6 +117,7 @@ class _ConversationsState extends State<Conversations> {
|
||||
),
|
||||
)
|
||||
: ListView(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
children: List.generate(
|
||||
_conversations.length,
|
||||
|
@ -1,64 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:qr_code_scanner/qr_code_scanner.dart';
|
||||
import 'package:simplex_chat/constants.dart';
|
||||
import 'package:simplex_chat/widgets/custom_btn.dart';
|
||||
|
||||
/// Tap in the middle of QR Code to see the flow of contact being added in the Chat View
|
||||
|
||||
class QRCodeDetailsView extends StatelessWidget {
|
||||
final Barcode barcode;
|
||||
const QRCodeDetailsView({
|
||||
Key? key,
|
||||
required this.barcode,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('QR Code Result'),
|
||||
),
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const CircleAvatar(
|
||||
backgroundImage: AssetImage('assets/dp.png'),
|
||||
radius: 90,
|
||||
),
|
||||
const SizedBox(height: 30.0),
|
||||
Text(
|
||||
barcode.code,
|
||||
style: kMediumHeadingStyle,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 30.0),
|
||||
CustomButton(
|
||||
width: 200,
|
||||
height: 40,
|
||||
onPressed: () => Navigator.pop(context),
|
||||
color: kPrimaryColor,
|
||||
child: const Text(
|
||||
'Confirm',
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
CustomButton(
|
||||
width: 200,
|
||||
height: 40,
|
||||
onPressed: () => Navigator.pop(context),
|
||||
color: kSecondaryColor,
|
||||
child: const Text(
|
||||
'Ignore',
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 40.0),
|
||||
const Text('Invitation was sent HH:MM')
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -28,10 +28,8 @@ class ScanInvitationView extends StatelessWidget {
|
||||
SizedBox(height: _size.height * 0.04),
|
||||
GestureDetector(
|
||||
onTap: () => _showConnection(context),
|
||||
child: Image.asset(
|
||||
'assets/code.png',
|
||||
height: _size.height * 0.3
|
||||
),
|
||||
child:
|
||||
Image.asset('assets/code.png', height: _size.height * 0.3),
|
||||
),
|
||||
SizedBox(height: _size.height * 0.04),
|
||||
const Text(
|
||||
|
@ -97,5 +97,6 @@
|
||||
loadMainDartJs();
|
||||
}
|
||||
</script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/jsqr@1.3.1/dist/jsQR.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user