Clients
This commit is contained in:
parent
b93cfed97b
commit
471c2f942d
|
|
@ -0,0 +1,4 @@
|
||||||
|
analyzer:
|
||||||
|
strong-mode: true
|
||||||
|
language:
|
||||||
|
enableSuperMixins: true
|
||||||
|
|
@ -5,43 +5,108 @@ import 'package:invoiceninja/ui/app/progress_button.dart';
|
||||||
import 'package:invoiceninja/ui/client/client_details_vm.dart';
|
import 'package:invoiceninja/ui/client/client_details_vm.dart';
|
||||||
import 'package:invoiceninja/utils/localization.dart';
|
import 'package:invoiceninja/utils/localization.dart';
|
||||||
|
|
||||||
class ClientDetails extends StatelessWidget {
|
class ClientDetails extends StatefulWidget {
|
||||||
final ClientDetailsVM viewModel;
|
final ClientDetailsVM viewModel;
|
||||||
|
|
||||||
static final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
||||||
static final GlobalKey<FormFieldState<String>> _nameKey =
|
|
||||||
GlobalKey<FormFieldState<String>>();
|
|
||||||
|
|
||||||
ClientDetails({
|
ClientDetails({
|
||||||
Key key,
|
Key key,
|
||||||
@required this.viewModel,
|
@required this.viewModel,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_ClientDetailsState createState() => new _ClientDetailsState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ClientDetailsState extends State<ClientDetails>
|
||||||
|
with SingleTickerProviderStateMixin {
|
||||||
|
static final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||||
|
static final GlobalKey<FormFieldState<String>> _nameKey =
|
||||||
|
GlobalKey<FormFieldState<String>>();
|
||||||
|
TabController _controller;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_controller = new TabController(vsync: this, length: 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_controller.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var localization = AppLocalization.of(context);
|
var localization = AppLocalization.of(context);
|
||||||
|
|
||||||
return Scaffold(
|
Widget _overview() {
|
||||||
appBar: AppBar(
|
return Padding(
|
||||||
title: Text(viewModel.client.id == null
|
|
||||||
? localization.newClient
|
|
||||||
: viewModel.client.displayName), // Text(localizations.clientDetails),
|
|
||||||
actions: viewModel.client.id == null ? [] : [
|
|
||||||
ActionMenuButton(
|
|
||||||
entity: viewModel.client,
|
|
||||||
onSelected: viewModel.onActionSelected,
|
|
||||||
)],
|
|
||||||
),
|
|
||||||
body: Padding(
|
|
||||||
padding: EdgeInsets.all(16.0),
|
padding: EdgeInsets.all(16.0),
|
||||||
child: ListView(children: <Widget>[
|
child: ListView(
|
||||||
|
children: <Widget>[
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: Icon(Icons.location_city),
|
leading: Icon(Icons.pin_drop),
|
||||||
title: Text(viewModel.client.address1),
|
title: Text(widget.viewModel.client.address1),
|
||||||
subtitle: Text(localization.billingAddress),
|
subtitle: Text(localization.billingAddress),
|
||||||
)
|
)
|
||||||
],),
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _details() {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.all(16.0),
|
||||||
|
child: ListView(
|
||||||
|
children: <Widget>[
|
||||||
|
ListTile(
|
||||||
|
leading: Icon(Icons.pin_drop),
|
||||||
|
title: Text(widget.viewModel.client.address1),
|
||||||
|
subtitle: Text(localization.billingAddress),
|
||||||
)
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text(widget.viewModel.client.id == null
|
||||||
|
? localization.newClient
|
||||||
|
: widget.viewModel.client
|
||||||
|
.displayName), // Text(localizations.clientDetails),
|
||||||
|
bottom: TabBar(
|
||||||
|
controller: _controller,
|
||||||
|
//isScrollable: true,
|
||||||
|
tabs: [
|
||||||
|
Tab(
|
||||||
|
text: localization.overview,
|
||||||
|
),
|
||||||
|
Tab(
|
||||||
|
text: localization.details,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
actions: widget.viewModel.client.id == null
|
||||||
|
? []
|
||||||
|
: [
|
||||||
|
ActionMenuButton(
|
||||||
|
entity: widget.viewModel.client,
|
||||||
|
onSelected: widget.viewModel.onActionSelected,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
body: TabBarView(
|
||||||
|
controller: _controller,
|
||||||
|
children: <Widget>[
|
||||||
|
_overview(),
|
||||||
|
_details(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
/*
|
||||||
|
body:
|
||||||
|
*/
|
||||||
/*
|
/*
|
||||||
body: Padding(
|
body: Padding(
|
||||||
padding: EdgeInsets.all(16.0),
|
padding: EdgeInsets.all(16.0),
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,8 @@ class AppLocalization {
|
||||||
'save': 'Save',
|
'save': 'Save',
|
||||||
'an_error_occurred': 'An error occurred',
|
'an_error_occurred': 'An error occurred',
|
||||||
'paid_to_date': 'Paid to Date',
|
'paid_to_date': 'Paid to Date',
|
||||||
|
'overview': 'Overview',
|
||||||
|
'details': 'Details',
|
||||||
|
|
||||||
'product': 'Product',
|
'product': 'Product',
|
||||||
'products': 'Products',
|
'products': 'Products',
|
||||||
|
|
@ -104,6 +106,8 @@ class AppLocalization {
|
||||||
String get descending => _localizedValues[locale.languageCode]['descending'];
|
String get descending => _localizedValues[locale.languageCode]['descending'];
|
||||||
String get save => _localizedValues[locale.languageCode]['save'];
|
String get save => _localizedValues[locale.languageCode]['save'];
|
||||||
String get paidToDate => _localizedValues[locale.languageCode]['paid_to_date'];
|
String get paidToDate => _localizedValues[locale.languageCode]['paid_to_date'];
|
||||||
|
String get overview => _localizedValues[locale.languageCode]['overview'];
|
||||||
|
String get details => _localizedValues[locale.languageCode]['details'];
|
||||||
|
|
||||||
String get product => _localizedValues[locale.languageCode]['product'];
|
String get product => _localizedValues[locale.languageCode]['product'];
|
||||||
String get products => _localizedValues[locale.languageCode]['products'];
|
String get products => _localizedValues[locale.languageCode]['products'];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue