mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-04-18 19:32:54 +00:00
add qr code button
This commit is contained in:
parent
aa7a065572
commit
1d4a0bdbeb
5 changed files with 49 additions and 28 deletions
|
|
@ -376,11 +376,11 @@ abstract class AppLocalizations {
|
||||||
/// **'Username'**
|
/// **'Username'**
|
||||||
String get searchUsernameInput;
|
String get searchUsernameInput;
|
||||||
|
|
||||||
/// No description provided for @searchUsernameTitle.
|
/// No description provided for @addFriendTitle.
|
||||||
///
|
///
|
||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
/// **'Search username'**
|
/// **'Add friends'**
|
||||||
String get searchUsernameTitle;
|
String get addFriendTitle;
|
||||||
|
|
||||||
/// No description provided for @searchUserNamePreview.
|
/// No description provided for @searchUserNamePreview.
|
||||||
///
|
///
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||||
String get searchUsernameInput => 'Benutzername';
|
String get searchUsernameInput => 'Benutzername';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get searchUsernameTitle => 'Benutzernamen suchen';
|
String get addFriendTitle => 'Freunde hinzufügen';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get searchUserNamePreview =>
|
String get searchUserNamePreview =>
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||||
String get searchUsernameInput => 'Username';
|
String get searchUsernameInput => 'Username';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get searchUsernameTitle => 'Search username';
|
String get addFriendTitle => 'Add friends';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get searchUserNamePreview =>
|
String get searchUserNamePreview =>
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ class AppLocalizationsSv extends AppLocalizations {
|
||||||
String get searchUsernameInput => 'Username';
|
String get searchUsernameInput => 'Username';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get searchUsernameTitle => 'Search username';
|
String get addFriendTitle => 'Add friends';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get searchUserNamePreview =>
|
String get searchUserNamePreview =>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,9 @@ import 'package:drift/drift.dart' hide Column;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:twonly/globals.dart';
|
import 'package:twonly/globals.dart';
|
||||||
|
import 'package:twonly/src/constants/routes.keys.dart';
|
||||||
import 'package:twonly/src/database/daos/contacts.dao.dart';
|
import 'package:twonly/src/database/daos/contacts.dao.dart';
|
||||||
import 'package:twonly/src/database/twonly.db.dart';
|
import 'package:twonly/src/database/twonly.db.dart';
|
||||||
import 'package:twonly/src/model/protobuf/client/generated/messages.pb.dart';
|
import 'package:twonly/src/model/protobuf/client/generated/messages.pb.dart';
|
||||||
|
|
@ -131,7 +133,7 @@ class _SearchUsernameView extends State<AddNewUserView> {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text(context.lang.searchUsernameTitle),
|
title: Text(context.lang.addFriendTitle),
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
|
@ -140,6 +142,9 @@ class _SearchUsernameView extends State<AddNewUserView> {
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
child: TextField(
|
child: TextField(
|
||||||
onSubmitted: (_) async {
|
onSubmitted: (_) async {
|
||||||
await _addNewUser(context);
|
await _addNewUser(context);
|
||||||
|
|
@ -152,11 +157,25 @@ class _SearchUsernameView extends State<AddNewUserView> {
|
||||||
},
|
},
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
LengthLimitingTextInputFormatter(12),
|
LengthLimitingTextInputFormatter(12),
|
||||||
FilteringTextInputFormatter.allow(RegExp('[a-z0-9A-Z._]')),
|
FilteringTextInputFormatter.allow(
|
||||||
|
RegExp('[a-z0-9A-Z._]'),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
controller: searchUserName,
|
controller: searchUserName,
|
||||||
decoration:
|
decoration: getInputDecoration(
|
||||||
getInputDecoration(context.lang.searchUsernameInput),
|
context.lang.searchUsernameInput,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.centerRight,
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () =>
|
||||||
|
context.push(Routes.settingsPublicProfile),
|
||||||
|
icon: const FaIcon(FontAwesomeIcons.qrcode),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
|
|
@ -174,7 +193,9 @@ class _SearchUsernameView extends State<AddNewUserView> {
|
||||||
floatingActionButton: Padding(
|
floatingActionButton: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 30),
|
padding: const EdgeInsets.only(bottom: 30),
|
||||||
child: FloatingActionButton(
|
child: FloatingActionButton(
|
||||||
onPressed: _isLoading ? null : () async => _addNewUser(context),
|
onPressed: _isLoading || searchUserName.text.isEmpty
|
||||||
|
? null
|
||||||
|
: () async => _addNewUser(context),
|
||||||
child: _isLoading
|
child: _isLoading
|
||||||
? const Center(child: CircularProgressIndicator())
|
? const Center(child: CircularProgressIndicator())
|
||||||
: const FaIcon(FontAwesomeIcons.magnifyingGlassPlus),
|
: const FaIcon(FontAwesomeIcons.magnifyingGlassPlus),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue