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',
|
title: 'SimpleX Chat',
|
||||||
theme: theme.copyWith(
|
theme: theme.copyWith(
|
||||||
colorScheme: theme.colorScheme.copyWith(secondary: kPrimaryColor),
|
colorScheme: theme.colorScheme.copyWith(secondary: kPrimaryColor),
|
||||||
|
primaryColorLight: Colors.white,
|
||||||
),
|
),
|
||||||
builder: (context, widget) {
|
builder: (context, widget) {
|
||||||
return ScrollConfiguration(
|
return ScrollConfiguration(
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:qr_code_scanner/qr_code_scanner.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 {
|
class AddContactView extends StatefulWidget {
|
||||||
const AddContactView({Key? key}) : super(key: key);
|
const AddContactView({Key? key}) : super(key: key);
|
||||||
@ -17,16 +14,6 @@ class _AddContactViewState extends State<AddContactView> {
|
|||||||
QRViewController? _qrViewController;
|
QRViewController? _qrViewController;
|
||||||
Barcode? result;
|
Barcode? result;
|
||||||
|
|
||||||
@override
|
|
||||||
void reassemble() {
|
|
||||||
super.reassemble();
|
|
||||||
if (Platform.isAndroid) {
|
|
||||||
_qrViewController!.pauseCamera();
|
|
||||||
} else if (Platform.isIOS) {
|
|
||||||
_qrViewController!.resumeCamera();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// alert dialgoue
|
// alert dialgoue
|
||||||
void _initialWarning() {
|
void _initialWarning() {
|
||||||
showDialog(
|
showDialog(
|
||||||
@ -174,7 +161,7 @@ class _AddContactViewState extends State<AddContactView> {
|
|||||||
controller.scannedDataStream.listen((scanData) {
|
controller.scannedDataStream.listen((scanData) {
|
||||||
setState(() async {
|
setState(() async {
|
||||||
result = scanData;
|
result = scanData;
|
||||||
await controller.pauseCamera();
|
await controller.stopCamera();
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
Navigator.of(context).pop(true);
|
Navigator.of(context).pop(true);
|
||||||
}
|
}
|
||||||
|
@ -117,6 +117,7 @@ class _ConversationsState extends State<Conversations> {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
: ListView(
|
: ListView(
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
children: List.generate(
|
children: List.generate(
|
||||||
_conversations.length,
|
_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),
|
SizedBox(height: _size.height * 0.04),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () => _showConnection(context),
|
onTap: () => _showConnection(context),
|
||||||
child: Image.asset(
|
child:
|
||||||
'assets/code.png',
|
Image.asset('assets/code.png', height: _size.height * 0.3),
|
||||||
height: _size.height * 0.3
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
SizedBox(height: _size.height * 0.04),
|
SizedBox(height: _size.height * 0.04),
|
||||||
const Text(
|
const Text(
|
||||||
|
@ -97,5 +97,6 @@
|
|||||||
loadMainDartJs();
|
loadMainDartJs();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/jsqr@1.3.1/dist/jsQR.min.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user