1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-12-26 12:58:51 +00:00

Continue to fix deprecation warnings

This commit is contained in:
Pierre HUBERT 2021-03-13 15:38:43 +01:00
parent 230cb2c018
commit ad2cf6d4f9
8 changed files with 22 additions and 23 deletions

View File

@ -61,7 +61,7 @@ class _UserAccessDeniedScreenState extends SafeState<UserAccessDeniedScreen> {
Widget _buildPage() {
final size = MediaQuery.of(context).size;
return Container(
constraints: BoxConstraints.loose(size),
width: size.width,
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(8.0),

View File

@ -25,6 +25,7 @@ import 'package:comunic/utils/navigation_utils.dart';
import 'package:comunic/utils/post_utils.dart';
import 'package:comunic/utils/ui_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:image_picker/image_picker.dart';
import 'package:url_launcher/url_launcher.dart';
@ -264,9 +265,9 @@ class _PostTileState extends State<PostTile> {
}
Widget _buildPostYouTube() {
return RaisedButton(
color: Colors.red,
textColor: Colors.white,
return ElevatedButton(
style:
ButtonStyle(backgroundColor: MaterialStateProperty.all(Colors.red)),
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
@ -321,7 +322,7 @@ class _PostTileState extends State<PostTile> {
}
Widget _buildPostPDF() {
return RaisedButton.icon(
return ElevatedButton.icon(
onPressed: () {
launch(widget.post.fileURL);
},
@ -442,8 +443,7 @@ class _PostTileState extends State<PostTile> {
// Image button
Container(
width: 30,
child: FlatButton(
padding: EdgeInsets.only(),
child: TextButton(
onPressed: _pickImageForComment,
child: Icon(
Icons.image,
@ -455,8 +455,7 @@ class _PostTileState extends State<PostTile> {
// Submit button
Container(
width: 40,
child: FlatButton(
padding: EdgeInsets.only(),
child: TextButton(
onPressed: _canSubmitComment ? () => _submitComment() : null,
child: Icon(
Icons.send,

View File

@ -47,7 +47,7 @@ class _FriendshipStatusWidgetState extends State<FriendshipStatusWidget> {
// No request sent yet
if (widget.status.noRequestExchanged) {
return RaisedButton(
return ElevatedButton(
child: Text(tr("Send request").toUpperCase()),
onPressed: () =>
executeRequest(() => _friendsHelper.sendRequest(friendID)),
@ -56,12 +56,13 @@ class _FriendshipStatusWidgetState extends State<FriendshipStatusWidget> {
// Already sent a friendship request
if (widget.status.sentRequest) {
return RaisedButton(
return ElevatedButton(
child: Text(
tr("Cancel request").toUpperCase(),
style: WhiteTextColorStyle,
),
color: Colors.red,
style:
ButtonStyle(backgroundColor: MaterialStateProperty.all(Colors.red)),
onPressed: () =>
executeRequest(() => _friendsHelper.cancelRequest(friendID)),
);
@ -94,7 +95,7 @@ class _FriendshipStatusWidgetState extends State<FriendshipStatusWidget> {
}
// The two users are friends, offers to follow him
return RaisedButton(
return ElevatedButton(
child: Text((widget.status.following ? tr("Following") : tr("Follow"))
.toUpperCase()),
onPressed: () => executeRequest(() =>

View File

@ -153,8 +153,7 @@ class _InitializeWidgetState extends SafeState<InitializeWidget> {
SizedBox(
height: 30,
),
RaisedButton(
color: Colors.indigo,
ElevatedButton(
onPressed: () => _tryConnect(),
child: Text(tr("Try again")),
),

View File

@ -135,7 +135,7 @@ class _UserPageTabletState extends State<UserPageTablet> {
// Private messages
!_isCurrentUser
? Expanded(
child: OutlineButton(
child: OutlinedButton(
onPressed: () =>
openPrivateConversation(context, _userInfo.id),
child: Icon(Icons.message),

View File

@ -20,7 +20,7 @@ Future<PickedFile> pickImage(BuildContext context) async {
title: Text(tr("Choose an image")),
actions: <Widget>[
//Gallery
FlatButton(
TextButton(
onPressed: () => Navigator.pop(context, _ChooseImageSource.GALLERY),
child: Text(
tr("Image gallery").toUpperCase(),
@ -28,7 +28,7 @@ Future<PickedFile> pickImage(BuildContext context) async {
),
// Camera
FlatButton(
TextButton(
onPressed: () => Navigator.pop(context, _ChooseImageSource.CAMERA),
child: Text(
tr("Camera").toUpperCase(),

View File

@ -62,7 +62,7 @@ Future<PostVisibilityLevel> showPostVisibilityPicker({
// Dialog actions
actions: <Widget>[
// Cancel
FlatButton(
TextButton(
child: Text(tr("Cancel").toUpperCase()),
onPressed: () => Navigator.pop(c, null),
),

View File

@ -169,11 +169,11 @@ class __InputTextDialogState extends State<_InputTextDialog> {
),
),
actions: <Widget>[
FlatButton(
TextButton(
child: Text(tr("Cancel").toUpperCase()),
onPressed: () => Navigator.pop(c, false),
),
FlatButton(
TextButton(
child: Text(tr("OK")),
onPressed: widget.controller.text.length >= widget.minLength
? () => Navigator.pop(c, true)
@ -203,11 +203,11 @@ Future<bool> showConfirmDialog({
title: Text(title),
content: Text(message),
actions: <Widget>[
FlatButton(
TextButton(
onPressed: () => Navigator.pop(context, false),
child: Text(tr("Cancel").toUpperCase()),
),
FlatButton(
TextButton(
onPressed: () => Navigator.pop(context, true),
child: Text(
tr("Confirm").toUpperCase(),