[skip ci] remove / move unneeded observers

This commit is contained in:
Matthew Fosse 2024-06-21 14:17:39 -07:00
parent 45e1a4d223
commit f2d575dc34

View file

@ -117,8 +117,7 @@ class LightningInvoicePage extends BasePage {
), ),
) )
: null, : null,
child: Observer(builder: (_) { child: Padding(
return Padding(
padding: EdgeInsets.fromLTRB(24, 120, 24, 0), padding: EdgeInsets.fromLTRB(24, 120, 24, 0),
child: LightningInvoiceForm( child: LightningInvoiceForm(
descriptionController: _descriptionController, descriptionController: _descriptionController,
@ -127,12 +126,10 @@ class LightningInvoicePage extends BasePage {
formKey: _formKey, formKey: _formKey,
lightningInvoicePageViewModel: lightningInvoicePageViewModel, lightningInvoicePageViewModel: lightningInvoicePageViewModel,
), ),
); ),
}),
), ),
bottomSectionPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24), bottomSectionPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
bottomSection: Observer(builder: (_) { bottomSection: Column(
return Column(
children: <Widget>[ children: <Widget>[
Container( Container(
padding: const EdgeInsets.only(top: 12, bottom: 12, right: 6), padding: const EdgeInsets.only(top: 12, bottom: 12, right: 6),
@ -167,8 +164,7 @@ class LightningInvoicePage extends BasePage {
Container(child: Center(child: CircularProgressIndicator()))); Container(child: Center(child: CircularProgressIndicator())));
} }
late String finalText; late String finalText;
InvoiceSoftLimitsResult limits = InvoiceSoftLimitsResult limits = snapshot.data as InvoiceSoftLimitsResult;
snapshot.data as InvoiceSoftLimitsResult;
if (limits.inboundLiquidity == 0) { if (limits.inboundLiquidity == 0) {
finalText = S.of(context).lightning_invoice_min( finalText = S.of(context).lightning_invoice_min(
limits.feePercent.toString(), limits.feePercent.toString(),
@ -188,8 +184,7 @@ class LightningInvoicePage extends BasePage {
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
Theme.of(context).extension<DashboardPageTheme>()!.textColor,
), ),
), ),
); );
@ -198,7 +193,8 @@ class LightningInvoicePage extends BasePage {
], ],
), ),
), ),
LoadingPrimaryButton( Observer(builder: (_) {
return LoadingPrimaryButton(
text: S.of(context).create_invoice, text: S.of(context).create_invoice,
onPressed: () { onPressed: () {
FocusScope.of(context).unfocus(); FocusScope.of(context).unfocus();
@ -211,10 +207,10 @@ class LightningInvoicePage extends BasePage {
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
textColor: Colors.white, textColor: Colors.white,
isLoading: lightningInvoicePageViewModel.state is IsExecutingState, isLoading: lightningInvoicePageViewModel.state is IsExecutingState,
),
],
); );
}), }),
],
),
), ),
), ),
), ),