mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 12:59:21 +00:00
Continue to fix deprecation warnings
This commit is contained in:
parent
230cb2c018
commit
ad2cf6d4f9
@ -61,7 +61,7 @@ class _UserAccessDeniedScreenState extends SafeState<UserAccessDeniedScreen> {
|
|||||||
Widget _buildPage() {
|
Widget _buildPage() {
|
||||||
final size = MediaQuery.of(context).size;
|
final size = MediaQuery.of(context).size;
|
||||||
return Container(
|
return Container(
|
||||||
constraints: BoxConstraints.loose(size),
|
width: size.width,
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
@ -25,6 +25,7 @@ import 'package:comunic/utils/navigation_utils.dart';
|
|||||||
import 'package:comunic/utils/post_utils.dart';
|
import 'package:comunic/utils/post_utils.dart';
|
||||||
import 'package:comunic/utils/ui_utils.dart';
|
import 'package:comunic/utils/ui_utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
@ -264,9 +265,9 @@ class _PostTileState extends State<PostTile> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildPostYouTube() {
|
Widget _buildPostYouTube() {
|
||||||
return RaisedButton(
|
return ElevatedButton(
|
||||||
color: Colors.red,
|
style:
|
||||||
textColor: Colors.white,
|
ButtonStyle(backgroundColor: MaterialStateProperty.all(Colors.red)),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -321,7 +322,7 @@ class _PostTileState extends State<PostTile> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildPostPDF() {
|
Widget _buildPostPDF() {
|
||||||
return RaisedButton.icon(
|
return ElevatedButton.icon(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
launch(widget.post.fileURL);
|
launch(widget.post.fileURL);
|
||||||
},
|
},
|
||||||
@ -442,8 +443,7 @@ class _PostTileState extends State<PostTile> {
|
|||||||
// Image button
|
// Image button
|
||||||
Container(
|
Container(
|
||||||
width: 30,
|
width: 30,
|
||||||
child: FlatButton(
|
child: TextButton(
|
||||||
padding: EdgeInsets.only(),
|
|
||||||
onPressed: _pickImageForComment,
|
onPressed: _pickImageForComment,
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.image,
|
Icons.image,
|
||||||
@ -455,8 +455,7 @@ class _PostTileState extends State<PostTile> {
|
|||||||
// Submit button
|
// Submit button
|
||||||
Container(
|
Container(
|
||||||
width: 40,
|
width: 40,
|
||||||
child: FlatButton(
|
child: TextButton(
|
||||||
padding: EdgeInsets.only(),
|
|
||||||
onPressed: _canSubmitComment ? () => _submitComment() : null,
|
onPressed: _canSubmitComment ? () => _submitComment() : null,
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.send,
|
Icons.send,
|
||||||
|
@ -47,7 +47,7 @@ class _FriendshipStatusWidgetState extends State<FriendshipStatusWidget> {
|
|||||||
|
|
||||||
// No request sent yet
|
// No request sent yet
|
||||||
if (widget.status.noRequestExchanged) {
|
if (widget.status.noRequestExchanged) {
|
||||||
return RaisedButton(
|
return ElevatedButton(
|
||||||
child: Text(tr("Send request").toUpperCase()),
|
child: Text(tr("Send request").toUpperCase()),
|
||||||
onPressed: () =>
|
onPressed: () =>
|
||||||
executeRequest(() => _friendsHelper.sendRequest(friendID)),
|
executeRequest(() => _friendsHelper.sendRequest(friendID)),
|
||||||
@ -56,12 +56,13 @@ class _FriendshipStatusWidgetState extends State<FriendshipStatusWidget> {
|
|||||||
|
|
||||||
// Already sent a friendship request
|
// Already sent a friendship request
|
||||||
if (widget.status.sentRequest) {
|
if (widget.status.sentRequest) {
|
||||||
return RaisedButton(
|
return ElevatedButton(
|
||||||
child: Text(
|
child: Text(
|
||||||
tr("Cancel request").toUpperCase(),
|
tr("Cancel request").toUpperCase(),
|
||||||
style: WhiteTextColorStyle,
|
style: WhiteTextColorStyle,
|
||||||
),
|
),
|
||||||
color: Colors.red,
|
style:
|
||||||
|
ButtonStyle(backgroundColor: MaterialStateProperty.all(Colors.red)),
|
||||||
onPressed: () =>
|
onPressed: () =>
|
||||||
executeRequest(() => _friendsHelper.cancelRequest(friendID)),
|
executeRequest(() => _friendsHelper.cancelRequest(friendID)),
|
||||||
);
|
);
|
||||||
@ -94,7 +95,7 @@ class _FriendshipStatusWidgetState extends State<FriendshipStatusWidget> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The two users are friends, offers to follow him
|
// The two users are friends, offers to follow him
|
||||||
return RaisedButton(
|
return ElevatedButton(
|
||||||
child: Text((widget.status.following ? tr("Following") : tr("Follow"))
|
child: Text((widget.status.following ? tr("Following") : tr("Follow"))
|
||||||
.toUpperCase()),
|
.toUpperCase()),
|
||||||
onPressed: () => executeRequest(() =>
|
onPressed: () => executeRequest(() =>
|
||||||
|
@ -153,8 +153,7 @@ class _InitializeWidgetState extends SafeState<InitializeWidget> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 30,
|
height: 30,
|
||||||
),
|
),
|
||||||
RaisedButton(
|
ElevatedButton(
|
||||||
color: Colors.indigo,
|
|
||||||
onPressed: () => _tryConnect(),
|
onPressed: () => _tryConnect(),
|
||||||
child: Text(tr("Try again")),
|
child: Text(tr("Try again")),
|
||||||
),
|
),
|
||||||
|
@ -135,7 +135,7 @@ class _UserPageTabletState extends State<UserPageTablet> {
|
|||||||
// Private messages
|
// Private messages
|
||||||
!_isCurrentUser
|
!_isCurrentUser
|
||||||
? Expanded(
|
? Expanded(
|
||||||
child: OutlineButton(
|
child: OutlinedButton(
|
||||||
onPressed: () =>
|
onPressed: () =>
|
||||||
openPrivateConversation(context, _userInfo.id),
|
openPrivateConversation(context, _userInfo.id),
|
||||||
child: Icon(Icons.message),
|
child: Icon(Icons.message),
|
||||||
|
@ -20,7 +20,7 @@ Future<PickedFile> pickImage(BuildContext context) async {
|
|||||||
title: Text(tr("Choose an image")),
|
title: Text(tr("Choose an image")),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
//Gallery
|
//Gallery
|
||||||
FlatButton(
|
TextButton(
|
||||||
onPressed: () => Navigator.pop(context, _ChooseImageSource.GALLERY),
|
onPressed: () => Navigator.pop(context, _ChooseImageSource.GALLERY),
|
||||||
child: Text(
|
child: Text(
|
||||||
tr("Image gallery").toUpperCase(),
|
tr("Image gallery").toUpperCase(),
|
||||||
@ -28,7 +28,7 @@ Future<PickedFile> pickImage(BuildContext context) async {
|
|||||||
),
|
),
|
||||||
|
|
||||||
// Camera
|
// Camera
|
||||||
FlatButton(
|
TextButton(
|
||||||
onPressed: () => Navigator.pop(context, _ChooseImageSource.CAMERA),
|
onPressed: () => Navigator.pop(context, _ChooseImageSource.CAMERA),
|
||||||
child: Text(
|
child: Text(
|
||||||
tr("Camera").toUpperCase(),
|
tr("Camera").toUpperCase(),
|
||||||
|
@ -62,7 +62,7 @@ Future<PostVisibilityLevel> showPostVisibilityPicker({
|
|||||||
// Dialog actions
|
// Dialog actions
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
// Cancel
|
// Cancel
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text(tr("Cancel").toUpperCase()),
|
child: Text(tr("Cancel").toUpperCase()),
|
||||||
onPressed: () => Navigator.pop(c, null),
|
onPressed: () => Navigator.pop(c, null),
|
||||||
),
|
),
|
||||||
|
@ -169,11 +169,11 @@ class __InputTextDialogState extends State<_InputTextDialog> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text(tr("Cancel").toUpperCase()),
|
child: Text(tr("Cancel").toUpperCase()),
|
||||||
onPressed: () => Navigator.pop(c, false),
|
onPressed: () => Navigator.pop(c, false),
|
||||||
),
|
),
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text(tr("OK")),
|
child: Text(tr("OK")),
|
||||||
onPressed: widget.controller.text.length >= widget.minLength
|
onPressed: widget.controller.text.length >= widget.minLength
|
||||||
? () => Navigator.pop(c, true)
|
? () => Navigator.pop(c, true)
|
||||||
@ -203,11 +203,11 @@ Future<bool> showConfirmDialog({
|
|||||||
title: Text(title),
|
title: Text(title),
|
||||||
content: Text(message),
|
content: Text(message),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
FlatButton(
|
TextButton(
|
||||||
onPressed: () => Navigator.pop(context, false),
|
onPressed: () => Navigator.pop(context, false),
|
||||||
child: Text(tr("Cancel").toUpperCase()),
|
child: Text(tr("Cancel").toUpperCase()),
|
||||||
),
|
),
|
||||||
FlatButton(
|
TextButton(
|
||||||
onPressed: () => Navigator.pop(context, true),
|
onPressed: () => Navigator.pop(context, true),
|
||||||
child: Text(
|
child: Text(
|
||||||
tr("Confirm").toUpperCase(),
|
tr("Confirm").toUpperCase(),
|
||||||
|
Loading…
Reference in New Issue
Block a user