TF-80 Create pick destination screen
This commit is contained in:
+65
@@ -0,0 +1,65 @@
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
typedef OnCloseActionClick = void Function();
|
||||
|
||||
class AppBarDestinationPickerBuilder {
|
||||
OnCloseActionClick? _onCloseActionClick;
|
||||
|
||||
final BuildContext _context;
|
||||
final ImagePaths _imagePaths;
|
||||
final ResponsiveUtils _responsiveUtils;
|
||||
|
||||
AppBarDestinationPickerBuilder(this._context, this._imagePaths, this._responsiveUtils);
|
||||
|
||||
void addCloseActionClick(OnCloseActionClick onCloseActionClick) {
|
||||
_onCloseActionClick = onCloseActionClick;
|
||||
}
|
||||
|
||||
Widget build() {
|
||||
return Container(
|
||||
key: Key('app_bar_destination_picker'),
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.symmetric(vertical: 8),
|
||||
color: Colors.white,
|
||||
child: MediaQuery(
|
||||
data: MediaQueryData(padding: EdgeInsets.zero),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
_buildBackButton(),
|
||||
Expanded(child: _buildCountItemSelected())
|
||||
]
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBackButton() {
|
||||
return ButtonBuilder(_imagePaths.icComposerClose)
|
||||
.padding(5)
|
||||
.size(30)
|
||||
.onPressActionClick(() {
|
||||
if (_onCloseActionClick != null) {
|
||||
_onCloseActionClick!();
|
||||
}})
|
||||
.build();
|
||||
}
|
||||
|
||||
Widget _buildCountItemSelected() {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 12,
|
||||
right: _responsiveUtils.isMobile(_context) ? 0 : 47),
|
||||
child: Text(
|
||||
AppLocalizations.of(_context).move_to_mailbox,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: _responsiveUtils.isMobile(_context) ? TextAlign.start : TextAlign.center,
|
||||
style: TextStyle(fontSize: 18, color: AppColor.nameUserColor, fontWeight: FontWeight.w500)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user