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