82 lines
2.8 KiB
Dart
82 lines
2.8 KiB
Dart
// Flutter imports:
|
|
import 'package:flutter/material.dart';
|
|
|
|
// Package imports:
|
|
import 'package:flutter_redux/flutter_redux.dart';
|
|
|
|
// Project imports:
|
|
import 'package:invoiceninja_flutter/constants.dart';
|
|
import 'package:invoiceninja_flutter/data/models/entities.dart';
|
|
import 'package:invoiceninja_flutter/data/models/vendor_model.dart';
|
|
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
|
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
|
import 'package:invoiceninja_flutter/ui/app/app_border.dart';
|
|
import 'package:invoiceninja_flutter/utils/localization.dart';
|
|
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
|
|
|
class VendorEditFooter extends StatelessWidget {
|
|
const VendorEditFooter({required this.vendor});
|
|
|
|
final VendorEntity vendor;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final localization = AppLocalization.of(context);
|
|
final store = StoreProvider.of<AppState>(context);
|
|
final state = store.state;
|
|
final useSidebarEditor =
|
|
state.prefState.useSidebarEditor[EntityType.vendor] ?? false;
|
|
final showLayoutToggle = isDesktop(context);
|
|
|
|
return BottomAppBar(
|
|
elevation: 0,
|
|
color: Theme.of(context).cardColor,
|
|
shape: CircularNotchedRectangle(),
|
|
child: SizedBox(
|
|
height: kTopBottomBarHeight,
|
|
child: AppBorder(
|
|
isTop: true,
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: [
|
|
if (showLayoutToggle)
|
|
Tooltip(
|
|
message: useSidebarEditor
|
|
? localization!.fullscreenEditor
|
|
: localization!.sidebarEditor,
|
|
child: InkWell(
|
|
onTap: () =>
|
|
store.dispatch(ToggleEditorLayout(EntityType.vendor)),
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
|
child: Icon(useSidebarEditor
|
|
? Icons.chevron_left
|
|
: Icons.chevron_right),
|
|
),
|
|
),
|
|
),
|
|
AppBorder(
|
|
isLeft: showLayoutToggle,
|
|
child: Padding(
|
|
padding: const EdgeInsets.only(left: 16, top: 8),
|
|
child: Text(
|
|
vendor.number.isEmpty
|
|
? vendor.calculateDisplayName
|
|
: '${vendor.number} • ${vendor.calculateDisplayName}',
|
|
style: TextStyle(
|
|
color: state.prefState.enableDarkMode
|
|
? Colors.white
|
|
: Colors.black,
|
|
fontSize: 20.0,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|