refactor: Migrate to flutter 2
This commit is contained in:
parent
d729dbe1b7
commit
b0ada828aa
39 changed files with 257 additions and 315 deletions
|
|
@ -636,24 +636,24 @@ class _ChatState extends State<Chat> {
|
|||
},
|
||||
itemBuilder: (_) => [
|
||||
PopupMenuItem(
|
||||
child: Text(L10n.of(context).copy),
|
||||
value: 'copy',
|
||||
child: Text(L10n.of(context).copy),
|
||||
),
|
||||
if (canRedactSelectedEvents)
|
||||
PopupMenuItem(
|
||||
value: 'redact',
|
||||
child: Text(
|
||||
L10n.of(context).redactMessage,
|
||||
style: TextStyle(color: Colors.orange),
|
||||
),
|
||||
value: 'redact',
|
||||
),
|
||||
if (selectedEvents.length == 1)
|
||||
PopupMenuItem(
|
||||
value: 'report',
|
||||
child: Text(
|
||||
L10n.of(context).reportMessage,
|
||||
style: TextStyle(color: Colors.red),
|
||||
),
|
||||
value: 'report',
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
@ -672,12 +672,12 @@ class _ChatState extends State<Chat> {
|
|||
? Padding(
|
||||
padding: const EdgeInsets.only(bottom: 56.0),
|
||||
child: FloatingActionButton(
|
||||
child: Icon(Icons.arrow_downward_outlined,
|
||||
color: Theme.of(context).primaryColor),
|
||||
onPressed: () => _scrollController.jumpTo(0),
|
||||
foregroundColor: Theme.of(context).textTheme.bodyText2.color,
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
mini: true,
|
||||
child: Icon(Icons.arrow_downward_outlined,
|
||||
color: Theme.of(context).primaryColor),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
|
|
@ -756,6 +756,7 @@ class _ChatState extends State<Chat> {
|
|||
)
|
||||
: _canLoadMore
|
||||
? TextButton(
|
||||
onPressed: requestHistory,
|
||||
child: Text(
|
||||
L10n.of(context).loadMore,
|
||||
style: TextStyle(
|
||||
|
|
@ -766,7 +767,6 @@ class _ChatState extends State<Chat> {
|
|||
TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
onPressed: requestHistory,
|
||||
)
|
||||
: Container()
|
||||
: i == 0
|
||||
|
|
@ -790,6 +790,11 @@ class _ChatState extends State<Chat> {
|
|||
client.userID
|
||||
? Alignment.topRight
|
||||
: Alignment.topLeft,
|
||||
padding: EdgeInsets.only(
|
||||
left: 8,
|
||||
right: 8,
|
||||
bottom: 8,
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 4),
|
||||
|
|
@ -810,11 +815,6 @@ class _ChatState extends State<Chat> {
|
|||
),
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.only(
|
||||
left: 8,
|
||||
right: 8,
|
||||
bottom: 8,
|
||||
),
|
||||
);
|
||||
},
|
||||
)
|
||||
|
|
@ -942,14 +942,14 @@ class _ChatState extends State<Chat> {
|
|||
itemBuilder: (c, i) => i == emojis.length
|
||||
? InkWell(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
onTap: () => _pickEmojiAction(
|
||||
context, allReactionEvents),
|
||||
child: Container(
|
||||
width: 56,
|
||||
height: 56,
|
||||
alignment: Alignment.center,
|
||||
child: Icon(Icons.add_outlined),
|
||||
),
|
||||
onTap: () => _pickEmojiAction(
|
||||
context, allReactionEvents),
|
||||
)
|
||||
: InkWell(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
|
|
|
|||
|
|
@ -249,8 +249,8 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
backgroundColor: Theme.of(context)
|
||||
.scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
child: Icon(Icons.edit_outlined),
|
||||
radius: Avatar.defaultSize / 2,
|
||||
child: Icon(Icons.edit_outlined),
|
||||
)
|
||||
: null,
|
||||
title: Text('${L10n.of(context).groupDescription}:',
|
||||
|
|
@ -342,19 +342,6 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
},
|
||||
),
|
||||
PopupMenuButton(
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
child: Icon(Icons.public_outlined)),
|
||||
title: Text(
|
||||
L10n.of(context).whoIsAllowedToJoinThisGroup),
|
||||
subtitle: Text(
|
||||
room.joinRules.getLocalizedString(
|
||||
MatrixLocals(L10n.of(context))),
|
||||
),
|
||||
),
|
||||
onSelected: (JoinRules joinRule) =>
|
||||
showFutureLoadingDialog(
|
||||
context: context,
|
||||
|
|
@ -377,22 +364,21 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
MatrixLocals(L10n.of(context)))),
|
||||
),
|
||||
],
|
||||
),
|
||||
PopupMenuButton(
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
child: Icon(Icons.visibility_outlined),
|
||||
),
|
||||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
child: Icon(Icons.public_outlined)),
|
||||
title: Text(
|
||||
L10n.of(context).visibilityOfTheChatHistory),
|
||||
L10n.of(context).whoIsAllowedToJoinThisGroup),
|
||||
subtitle: Text(
|
||||
room.historyVisibility.getLocalizedString(
|
||||
room.joinRules.getLocalizedString(
|
||||
MatrixLocals(L10n.of(context))),
|
||||
),
|
||||
),
|
||||
),
|
||||
PopupMenuButton(
|
||||
onSelected: (HistoryVisibility historyVisibility) =>
|
||||
showFutureLoadingDialog(
|
||||
context: context,
|
||||
|
|
@ -430,23 +416,23 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
MatrixLocals(L10n.of(context)))),
|
||||
),
|
||||
],
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
child: Icon(Icons.visibility_outlined),
|
||||
),
|
||||
title: Text(
|
||||
L10n.of(context).visibilityOfTheChatHistory),
|
||||
subtitle: Text(
|
||||
room.historyVisibility.getLocalizedString(
|
||||
MatrixLocals(L10n.of(context))),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (room.joinRules == JoinRules.public)
|
||||
PopupMenuButton(
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
child: Icon(Icons.info_outline),
|
||||
),
|
||||
title: Text(
|
||||
L10n.of(context).areGuestsAllowedToJoin),
|
||||
subtitle: Text(
|
||||
room.guestAccess.getLocalizedString(
|
||||
MatrixLocals(L10n.of(context))),
|
||||
),
|
||||
),
|
||||
onSelected: (GuestAccess guestAccess) =>
|
||||
showFutureLoadingDialog(
|
||||
context: context,
|
||||
|
|
@ -471,6 +457,20 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
),
|
||||
),
|
||||
],
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
foregroundColor: Colors.grey,
|
||||
child: Icon(Icons.info_outline),
|
||||
),
|
||||
title: Text(
|
||||
L10n.of(context).areGuestsAllowedToJoin),
|
||||
subtitle: Text(
|
||||
room.guestAccess.getLocalizedString(
|
||||
MatrixLocals(L10n.of(context))),
|
||||
),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: Text(L10n.of(context).editChatPermissions),
|
||||
|
|
@ -502,11 +502,11 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
? ListTile(
|
||||
title: Text(L10n.of(context).inviteContact),
|
||||
leading: CircleAvatar(
|
||||
child: Icon(Icons.add_outlined),
|
||||
backgroundColor:
|
||||
Theme.of(context).primaryColor,
|
||||
foregroundColor: Colors.white,
|
||||
radius: Avatar.defaultSize / 2,
|
||||
child: Icon(Icons.add_outlined),
|
||||
),
|
||||
onTap: () => AdaptivePageLayout.of(context)
|
||||
.pushNamed('/rooms/${room.id}/invite'),
|
||||
|
|
|
|||
|
|
@ -115,8 +115,8 @@ class _ChatEncryptionSettingsState extends State<ChatEncryptionSettings> {
|
|||
.verified ==
|
||||
UserVerifiedStatus.unknown) {
|
||||
items.add(PopupMenuItem(
|
||||
child: Text(L10n.of(context).verifyUser),
|
||||
value: 'verify_user',
|
||||
child: Text(L10n.of(context).verifyUser),
|
||||
));
|
||||
}
|
||||
return items;
|
||||
|
|
@ -162,22 +162,22 @@ class _ChatEncryptionSettingsState extends State<ChatEncryptionSettings> {
|
|||
if (deviceKeys[i].blocked ||
|
||||
!deviceKeys[i].verified) {
|
||||
items.add(PopupMenuItem(
|
||||
child: Text(L10n.of(context).verifyStart),
|
||||
value: deviceKeys[i].userId == room.client.userID
|
||||
? 'verify'
|
||||
: 'verify_user',
|
||||
child: Text(L10n.of(context).verifyStart),
|
||||
));
|
||||
}
|
||||
if (deviceKeys[i].blocked) {
|
||||
items.add(PopupMenuItem(
|
||||
child: Text(L10n.of(context).unblockDevice),
|
||||
value: 'unblock',
|
||||
child: Text(L10n.of(context).unblockDevice),
|
||||
));
|
||||
}
|
||||
if (!deviceKeys[i].blocked) {
|
||||
items.add(PopupMenuItem(
|
||||
child: Text(L10n.of(context).blockDevice),
|
||||
value: 'block',
|
||||
child: Text(L10n.of(context).blockDevice),
|
||||
));
|
||||
}
|
||||
return items;
|
||||
|
|
|
|||
|
|
@ -192,6 +192,8 @@ class _ChatListState extends State<ChatList> {
|
|||
? Center(
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(32),
|
||||
onTap: () => AdaptivePageLayout.of(context)
|
||||
.pushNamedAndRemoveUntilIsFirst('/settings'),
|
||||
child: FutureBuilder<Profile>(
|
||||
future: Matrix.of(context).client.ownProfile,
|
||||
builder: (_, snapshot) => Avatar(
|
||||
|
|
@ -201,8 +203,6 @@ class _ChatListState extends State<ChatList> {
|
|||
size: 32,
|
||||
),
|
||||
),
|
||||
onTap: () => AdaptivePageLayout.of(context)
|
||||
.pushNamedAndRemoveUntilIsFirst('/settings'),
|
||||
),
|
||||
)
|
||||
: IconButton(
|
||||
|
|
@ -378,9 +378,9 @@ class _ChatListState extends State<ChatList> {
|
|||
]),
|
||||
floatingActionButton: selectMode == SelectMode.normal
|
||||
? FloatingActionButton(
|
||||
child: Icon(Icons.add_outlined),
|
||||
onPressed: () => AdaptivePageLayout.of(context)
|
||||
.pushNamedAndRemoveUntilIsFirst('/newprivatechat'),
|
||||
child: Icon(Icons.add_outlined),
|
||||
)
|
||||
: null,
|
||||
bottomNavigationBar: selectMode == SelectMode.normal
|
||||
|
|
|
|||
|
|
@ -119,9 +119,9 @@ class _ContactsState extends State<Contacts> {
|
|||
ListTile(
|
||||
leading: CircleAvatar(
|
||||
radius: Avatar.defaultSize / 2,
|
||||
child: Icon(Icons.person_add_outlined),
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
foregroundColor: Colors.white,
|
||||
child: Icon(Icons.person_add_outlined),
|
||||
),
|
||||
title: Text(L10n.of(context).addNewFriend),
|
||||
onTap: () => AdaptivePageLayout.of(context)
|
||||
|
|
@ -141,15 +141,15 @@ class _ContactsState extends State<Contacts> {
|
|||
),
|
||||
Center(
|
||||
child: OutlinedButton(
|
||||
onPressed: () => FluffyShare.share(
|
||||
L10n.of(context).inviteText(client.userID,
|
||||
'https://matrix.to/#/${client.userID}'),
|
||||
context),
|
||||
child: Text(
|
||||
L10n.of(context).inviteContact,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).accentColor),
|
||||
),
|
||||
onPressed: () => FluffyShare.share(
|
||||
L10n.of(context).inviteText(client.userID,
|
||||
'https://matrix.to/#/${client.userID}'),
|
||||
context),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -180,22 +180,16 @@ class _HomeserverPickerState extends State<HomeserverPicker> {
|
|||
tag: 'loginButton',
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
height: 56,
|
||||
padding: EdgeInsets.symmetric(horizontal: 12),
|
||||
child: RaisedButton(
|
||||
elevation: 7,
|
||||
color: Theme.of(context).primaryColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
child: ElevatedButton(
|
||||
onPressed:
|
||||
_isLoading ? null : () => _checkHomeserverAction(context),
|
||||
child: _isLoading
|
||||
? LinearProgressIndicator()
|
||||
: Text(
|
||||
L10n.of(context).connect.toUpperCase(),
|
||||
style: TextStyle(color: Colors.white, fontSize: 16),
|
||||
),
|
||||
onPressed:
|
||||
_isLoading ? null : () => _checkHomeserverAction(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
@ -203,6 +197,7 @@ class _HomeserverPickerState extends State<HomeserverPicker> {
|
|||
alignment: WrapAlignment.center,
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () => launch(AppConfig.privacyUrl),
|
||||
child: Text(
|
||||
L10n.of(context).privacy,
|
||||
style: TextStyle(
|
||||
|
|
@ -210,9 +205,9 @@ class _HomeserverPickerState extends State<HomeserverPicker> {
|
|||
color: Colors.blueGrey,
|
||||
),
|
||||
),
|
||||
onPressed: () => launch(AppConfig.privacyUrl),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => PlatformInfos.showDialog(context),
|
||||
child: Text(
|
||||
L10n.of(context).about,
|
||||
style: TextStyle(
|
||||
|
|
@ -220,7 +215,6 @@ class _HomeserverPickerState extends State<HomeserverPicker> {
|
|||
color: Colors.blueGrey,
|
||||
),
|
||||
),
|
||||
onPressed: () => PlatformInfos.showDialog(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -50,6 +50,15 @@ class ImageView extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
body: InteractiveViewer(
|
||||
minScale: 1.0,
|
||||
maxScale: 10.0,
|
||||
onInteractionEnd: (ScaleEndDetails endDetails) {
|
||||
if (PlatformInfos.usesTouchscreen == false) {
|
||||
if (endDetails.velocity.pixelsPerSecond.dy > calcVelocity) {
|
||||
Navigator.of(context, rootNavigator: false).pop();
|
||||
}
|
||||
}
|
||||
},
|
||||
child: Center(
|
||||
child: ImageBubble(
|
||||
event,
|
||||
|
|
@ -62,15 +71,6 @@ class ImageView extends StatelessWidget {
|
|||
thumbnailOnly: false,
|
||||
),
|
||||
),
|
||||
minScale: 1.0,
|
||||
maxScale: 10.0,
|
||||
onInteractionEnd: (ScaleEndDetails endDetails) {
|
||||
if (PlatformInfos.usesTouchscreen == false) {
|
||||
if (endDetails.velocity.pixelsPerSecond.dy > calcVelocity) {
|
||||
Navigator.of(context, rootNavigator: false).pop();
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ class _LogViewerState extends State<LogViewer> {
|
|||
PopupMenuButton<Level>(
|
||||
itemBuilder: (context) => Level.values
|
||||
.map((level) => PopupMenuItem(
|
||||
child: Text(level.toString()),
|
||||
value: level,
|
||||
child: Text(level.toString()),
|
||||
))
|
||||
.toList(),
|
||||
onSelected: (Level level) => setState(() => logLevel = level),
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import '../utils/platform_infos.dart';
|
||||
|
||||
import '../app_config.dart';
|
||||
|
||||
class Login extends StatefulWidget {
|
||||
@override
|
||||
_LoginState createState() => _LoginState();
|
||||
|
|
@ -226,27 +224,22 @@ class _LoginState extends State<Login> {
|
|||
SizedBox(height: 12),
|
||||
Hero(
|
||||
tag: 'loginButton',
|
||||
child: Container(
|
||||
height: 56,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12),
|
||||
child: RaisedButton(
|
||||
elevation: 7,
|
||||
color: Theme.of(context).primaryColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
child: ElevatedButton(
|
||||
onPressed: loading ? null : () => login(context),
|
||||
child: loading
|
||||
? LinearProgressIndicator()
|
||||
: Text(
|
||||
L10n.of(context).login.toUpperCase(),
|
||||
style: TextStyle(color: Colors.white, fontSize: 16),
|
||||
),
|
||||
onPressed: loading ? null : () => login(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: TextButton(
|
||||
onPressed: () => _passwordForgotten(context),
|
||||
child: Text(
|
||||
L10n.of(context).passwordForgotten,
|
||||
style: TextStyle(
|
||||
|
|
@ -254,7 +247,6 @@ class _LoginState extends State<Login> {
|
|||
decoration: TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
onPressed: () => _passwordForgotten(context),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -91,12 +91,12 @@ class _NewPrivateChatState extends State<NewPrivateChat> {
|
|||
elevation: 0,
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => AdaptivePageLayout.of(context)
|
||||
.pushNamedAndRemoveUntilIsFirst('/newgroup'),
|
||||
child: Text(
|
||||
L10n.of(context).createNewGroup,
|
||||
style: TextStyle(color: Theme.of(context).accentColor),
|
||||
),
|
||||
onPressed: () => AdaptivePageLayout.of(context)
|
||||
.pushNamedAndRemoveUntilIsFirst('/newgroup'),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -174,13 +174,13 @@ class _EmotesSettingsState extends State<EmotesSettings> {
|
|||
),
|
||||
floatingActionButton: showSave
|
||||
? FloatingActionButton(
|
||||
child: Icon(Icons.save_outlined, color: Colors.white),
|
||||
onPressed: () async {
|
||||
await _save(context);
|
||||
setState(() {
|
||||
showSave = false;
|
||||
});
|
||||
},
|
||||
child: Icon(Icons.save_outlined, color: Colors.white),
|
||||
)
|
||||
: null,
|
||||
body: StreamBuilder(
|
||||
|
|
@ -190,6 +190,9 @@ class _EmotesSettingsState extends State<EmotesSettings> {
|
|||
children: <Widget>[
|
||||
if (!readonly)
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 8.0,
|
||||
),
|
||||
child: ListTile(
|
||||
leading: Container(
|
||||
width: 180.0,
|
||||
|
|
@ -222,11 +225,6 @@ class _EmotesSettingsState extends State<EmotesSettings> {
|
|||
),
|
||||
title: _EmoteImagePicker(newMxcController),
|
||||
trailing: InkWell(
|
||||
child: Icon(
|
||||
Icons.add_outlined,
|
||||
color: Colors.green,
|
||||
size: 32.0,
|
||||
),
|
||||
onTap: () async {
|
||||
if (newEmoteController.text == null ||
|
||||
newEmoteController.text.isEmpty ||
|
||||
|
|
@ -270,11 +268,13 @@ class _EmotesSettingsState extends State<EmotesSettings> {
|
|||
showSave = false;
|
||||
});
|
||||
},
|
||||
child: Icon(
|
||||
Icons.add_outlined,
|
||||
color: Colors.green,
|
||||
size: 32.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 8.0,
|
||||
),
|
||||
),
|
||||
if (widget.room != null)
|
||||
ListTile(
|
||||
|
|
@ -346,7 +346,7 @@ class _EmotesSettingsState extends State<EmotesSettings> {
|
|||
border: InputBorder.none,
|
||||
),
|
||||
onSubmitted: (s) {
|
||||
final emoteCode = ':${s}:';
|
||||
final emoteCode = ':$s:';
|
||||
if (emotes.indexWhere((e) =>
|
||||
e.emote == emoteCode &&
|
||||
e.mxc != emote.mxc) !=
|
||||
|
|
@ -382,16 +382,16 @@ class _EmotesSettingsState extends State<EmotesSettings> {
|
|||
trailing: readonly
|
||||
? null
|
||||
: InkWell(
|
||||
child: Icon(
|
||||
Icons.delete_forever_outlined,
|
||||
color: Colors.red,
|
||||
size: 32.0,
|
||||
),
|
||||
onTap: () => setState(() {
|
||||
emotes.removeWhere(
|
||||
(e) => e.emote == emote.emote);
|
||||
showSave = true;
|
||||
}),
|
||||
child: Icon(
|
||||
Icons.delete_forever_outlined,
|
||||
color: Colors.red,
|
||||
size: 32.0,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
|
@ -440,14 +440,7 @@ class _EmoteImagePickerState extends State<_EmoteImagePicker> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (widget.controller.text == null || widget.controller.text.isEmpty) {
|
||||
return RaisedButton(
|
||||
color: Theme.of(context).primaryColor,
|
||||
elevation: 5,
|
||||
textColor: Colors.white,
|
||||
child: Text(L10n.of(context).pickImage),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
return ElevatedButton(
|
||||
onPressed: () async {
|
||||
if (kIsWeb) {
|
||||
await FlushbarHelper.createError(
|
||||
|
|
@ -487,6 +480,7 @@ class _EmoteImagePickerState extends State<_EmoteImagePicker> {
|
|||
});
|
||||
}
|
||||
},
|
||||
child: Text(L10n.of(context).pickImage),
|
||||
);
|
||||
} else {
|
||||
return _EmoteImage(widget.controller.text);
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ import 'package:flutter/cupertino.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
|
||||
import '../app_config.dart';
|
||||
|
||||
class SignUp extends StatefulWidget {
|
||||
@override
|
||||
_SignUpState createState() => _SignUpState();
|
||||
|
|
@ -138,27 +136,23 @@ class _SignUpState extends State<SignUp> {
|
|||
SizedBox(height: 16),
|
||||
Hero(
|
||||
tag: 'loginButton',
|
||||
child: Container(
|
||||
height: 56,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12),
|
||||
child: RaisedButton(
|
||||
elevation: 7,
|
||||
color: Theme.of(context).primaryColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
child: ElevatedButton(
|
||||
onPressed: loading ? null : () => signUpAction(context),
|
||||
child: loading
|
||||
? LinearProgressIndicator()
|
||||
: Text(
|
||||
L10n.of(context).signUp.toUpperCase(),
|
||||
style: TextStyle(color: Colors.white, fontSize: 16),
|
||||
),
|
||||
onPressed: loading ? null : () => signUpAction(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: TextButton(
|
||||
onPressed: () =>
|
||||
AdaptivePageLayout.of(context).pushNamed('/login'),
|
||||
child: Text(
|
||||
L10n.of(context).alreadyHaveAnAccount,
|
||||
style: TextStyle(
|
||||
|
|
@ -167,8 +161,6 @@ class _SignUpState extends State<SignUp> {
|
|||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
onPressed: () =>
|
||||
AdaptivePageLayout.of(context).pushNamed('/login'),
|
||||
),
|
||||
),
|
||||
]),
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|||
import 'package:url_launcher/url_launcher.dart';
|
||||
import '../utils/platform_infos.dart';
|
||||
|
||||
import '../app_config.dart';
|
||||
|
||||
class SignUpPassword extends StatefulWidget {
|
||||
final MatrixFile avatar;
|
||||
final String username;
|
||||
|
|
@ -174,22 +172,16 @@ class _SignUpPasswordState extends State<SignUpPassword> {
|
|||
SizedBox(height: 12),
|
||||
Hero(
|
||||
tag: 'loginButton',
|
||||
child: Container(
|
||||
height: 56,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12),
|
||||
child: RaisedButton(
|
||||
elevation: 7,
|
||||
color: Theme.of(context).primaryColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
child: ElevatedButton(
|
||||
onPressed: loading ? null : () => _signUpAction(context),
|
||||
child: loading
|
||||
? LinearProgressIndicator()
|
||||
: Text(
|
||||
L10n.of(context).createAccountNow.toUpperCase(),
|
||||
style: TextStyle(color: Colors.white, fontSize: 16),
|
||||
),
|
||||
onPressed: loading ? null : () => _signUpAction(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue