mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 13:08:42 +00:00
add missing setState
This commit is contained in:
parent
20a8f0faa3
commit
bfb0b64093
13 changed files with 24 additions and 23 deletions
|
|
@ -34,6 +34,7 @@ class _DrawLayerState extends State<DrawLayer> {
|
||||||
|
|
||||||
if (skipNextEvent) {
|
if (skipNextEvent) {
|
||||||
skipNextEvent = false;
|
skipNextEvent = false;
|
||||||
|
setState(() {});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -110,6 +111,7 @@ class _DrawLayerState extends State<DrawLayer> {
|
||||||
tooltipText: context.lang.imageEditorDrawOk,
|
tooltipText: context.lang.imageEditorDrawOk,
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
widget.layerData.isEditing = false;
|
widget.layerData.isEditing = false;
|
||||||
|
setState(() {});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
Expanded(child: Container()),
|
Expanded(child: Container()),
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ class VerifiedShield extends StatelessWidget {
|
||||||
child: Tooltip(
|
child: Tooltip(
|
||||||
message: contact.verified
|
message: contact.verified
|
||||||
? "You verified this contact"
|
? "You verified this contact"
|
||||||
: "Click here to verify your contact.",
|
: "You have not verifies this contact.",
|
||||||
child: FaIcon(
|
child: FaIcon(
|
||||||
contact.verified
|
contact.verified
|
||||||
? FontAwesomeIcons.shieldHeart
|
? FontAwesomeIcons.shieldHeart
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ int id = 0;
|
||||||
|
|
||||||
Future<void> setupPushNotification() async {
|
Future<void> setupPushNotification() async {
|
||||||
const AndroidInitializationSettings initializationSettingsAndroid =
|
const AndroidInitializationSettings initializationSettingsAndroid =
|
||||||
AndroidInitializationSettings("logo");
|
AndroidInitializationSettings("ic_launcher_foreground");
|
||||||
|
|
||||||
final List<DarwinNotificationCategory> darwinNotificationCategories =
|
final List<DarwinNotificationCategory> darwinNotificationCategories =
|
||||||
<DarwinNotificationCategory>[
|
<DarwinNotificationCategory>[
|
||||||
|
|
|
||||||
|
|
@ -53,11 +53,6 @@ class _CameraPreviewViewState extends State<CameraPreviewView> {
|
||||||
bool isFlashOn = false;
|
bool isFlashOn = false;
|
||||||
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MediaViewSizing(
|
return MediaViewSizing(
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,7 @@ class _ShareImageEditorView extends State<ShareImageEditorView> {
|
||||||
undoLayers.clear();
|
undoLayers.clear();
|
||||||
removedLayers.clear();
|
removedLayers.clear();
|
||||||
layers.add(DrawLayerData());
|
layers.add(DrawLayerData());
|
||||||
|
setState(() {});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
|
|
@ -107,6 +108,7 @@ class _ShareImageEditorView extends State<ShareImageEditorView> {
|
||||||
} else {
|
} else {
|
||||||
_maxShowTime = _maxShowTime + 4;
|
_maxShowTime = _maxShowTime + 4;
|
||||||
}
|
}
|
||||||
|
setState(() {});
|
||||||
|
|
||||||
// _maxShowTime =
|
// _maxShowTime =
|
||||||
// _isRealTwonly = !_isRealTwonly;
|
// _isRealTwonly = !_isRealTwonly;
|
||||||
|
|
@ -125,6 +127,7 @@ class _ShareImageEditorView extends State<ShareImageEditorView> {
|
||||||
if (_isRealTwonly) {
|
if (_isRealTwonly) {
|
||||||
_maxShowTime = 12;
|
_maxShowTime = 12;
|
||||||
}
|
}
|
||||||
|
setState(() {});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -111,6 +111,7 @@ class _ShareImageView extends State<ShareImageView> {
|
||||||
Contact user = _users.firstWhere((x) => x.userId == userId);
|
Contact user = _users.firstWhere((x) => x.userId == userId);
|
||||||
if (!user.verified) {
|
if (!user.verified) {
|
||||||
showRealTwonlyWarning = true;
|
showRealTwonlyWarning = true;
|
||||||
|
setState(() {});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -179,6 +179,7 @@ class _ChatItemDetailsViewState extends State<ChatItemDetailsView> {
|
||||||
if (text == "") return;
|
if (text == "") return;
|
||||||
await sendTextMessage(widget.user.userId, newMessageController.text);
|
await sendTextMessage(widget.user.userId, newMessageController.text);
|
||||||
newMessageController.clear();
|
newMessageController.clear();
|
||||||
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -186,9 +187,9 @@ class _ChatItemDetailsViewState extends State<ChatItemDetailsView> {
|
||||||
final changeCounter = context.watch<MessagesChangeProvider>().changeCounter;
|
final changeCounter = context.watch<MessagesChangeProvider>().changeCounter;
|
||||||
if (changeCounter.containsKey(widget.user.userId.toInt())) {
|
if (changeCounter.containsKey(widget.user.userId.toInt())) {
|
||||||
if (changeCounter[widget.user.userId.toInt()] != lastChangeCounter) {
|
if (changeCounter[widget.user.userId.toInt()] != lastChangeCounter) {
|
||||||
print("FORCE reload");
|
|
||||||
_loadAsync(updateOpenStatus: true);
|
_loadAsync(updateOpenStatus: true);
|
||||||
lastChangeCounter = changeCounter[widget.user.userId.toInt()]!;
|
lastChangeCounter = changeCounter[widget.user.userId.toInt()]!;
|
||||||
|
setState(() {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
|
|
||||||
|
|
@ -158,11 +158,6 @@ class UserListItem extends StatefulWidget {
|
||||||
class _UserListItem extends State<UserListItem> {
|
class _UserListItem extends State<UserListItem> {
|
||||||
int lastMessageInSeconds = 0;
|
int lastMessageInSeconds = 0;
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
int lastMessageInSeconds =
|
int lastMessageInSeconds =
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ class _SearchUsernameView extends State<SearchUsernameView> {
|
||||||
),
|
),
|
||||||
SizedBox(height: 30),
|
SizedBox(height: 30),
|
||||||
if (context
|
if (context
|
||||||
.read<ContactChangeProvider>()
|
.watch<ContactChangeProvider>()
|
||||||
.allContacts
|
.allContacts
|
||||||
.where((contact) => !contact.accepted)
|
.where((contact) => !contact.accepted)
|
||||||
.isNotEmpty)
|
.isNotEmpty)
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ class _ContactVerifyViewState extends State<ContactVerifyView> {
|
||||||
|
|
||||||
Future loadAsync() async {
|
Future loadAsync() async {
|
||||||
fingerprint = await generateSessionFingerPrint(widget.contact.userId);
|
fingerprint = await generateSessionFingerPrint(widget.contact.userId);
|
||||||
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -118,15 +118,15 @@ class OnboardingView extends StatelessWidget {
|
||||||
style: TextStyle(fontSize: 18),
|
style: TextStyle(fontSize: 18),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsets.only(left: 50, right: 50, top: 20),
|
||||||
const EdgeInsets.only(left: 50, right: 50, top: 20),
|
child: FilledButton(
|
||||||
child: FilledButton(
|
onPressed: () {
|
||||||
onPressed: () {
|
callbackOnSuccess();
|
||||||
callbackOnSuccess();
|
// On button pressed
|
||||||
// On button pressed
|
},
|
||||||
},
|
child: Text(context.lang.onboardingTryForFree),
|
||||||
child: Text(context.lang.onboardingTryForFree),
|
),
|
||||||
)),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
image: Center(
|
image: Center(
|
||||||
|
|
|
||||||
|
|
@ -24,12 +24,14 @@ class _PrivacyViewBlockUsers extends State<PrivacyViewBlockUsers> {
|
||||||
Future loadAsync() async {
|
Future loadAsync() async {
|
||||||
allUsers = await DbContacts.getAllUsers();
|
allUsers = await DbContacts.getAllUsers();
|
||||||
_filterUsers(lastQuery);
|
_filterUsers(lastQuery);
|
||||||
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future _filterUsers(String query) async {
|
Future _filterUsers(String query) async {
|
||||||
lastQuery = query;
|
lastQuery = query;
|
||||||
if (query.isEmpty) {
|
if (query.isEmpty) {
|
||||||
filteredUsers = allUsers;
|
filteredUsers = allUsers;
|
||||||
|
setState(() {});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
filteredUsers = allUsers
|
filteredUsers = allUsers
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ class _ProfileViewState extends State<ProfileView> {
|
||||||
|
|
||||||
Future initAsync() async {
|
Future initAsync() async {
|
||||||
userData = await getUser();
|
userData = await getUser();
|
||||||
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue