Refactor widgets & imports; add krow_domain
Add local krow_domain dependency to client, staff apps and client home package. Numerous UI/widget cleanups across features: add const where applicable, use explicit List<Widget> types and List<Widget>.generate, add super.key to constructors, tighten BlocProvider generics, replace some Containers with SizedBox, and simplify InputDecoration/Border constructors. Fix API error handler to return a const UnknownException. Update internal imports to package-style paths (staff_home, staff_payments, staff_main repository interface) and normalize Flutter imports (use material.dart). Add missing braces for early returns in tax form pages. Mostly formatting and small API/typing refactors with no behavioral changes intended.
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import 'package:flutter/src/widgets/framework.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:krow_core/core.dart';
|
||||
import 'package:krow_domain/krow_domain.dart';
|
||||
|
||||
import 'package:staff_payments/src/data/repositories/payments_repository_impl.dart';
|
||||
import 'package:staff_payments/src/domain/repositories/payments_repository.dart';
|
||||
import 'package:staff_payments/src/domain/usecases/get_payment_chart_usecase.dart';
|
||||
|
||||
@@ -27,7 +27,7 @@ class EarlyPayPage extends StatelessWidget {
|
||||
border: Border.all(color: UiColors.primary.withValues(alpha: 0.1)),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Text(
|
||||
context.t.staff_payments.early_pay.available_label,
|
||||
style: UiTypography.body2m.textSecondary,
|
||||
@@ -65,13 +65,13 @@ class EarlyPayPage extends StatelessWidget {
|
||||
border: Border.all(color: UiColors.separatorPrimary),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
const Icon(UiIcons.bank, size: 24, color: UiColors.primary),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Text('Chase Bank', style: UiTypography.body2b.textPrimary),
|
||||
Text('Ending in 4321', style: UiTypography.footnote2r.textSecondary),
|
||||
],
|
||||
|
||||
@@ -18,13 +18,13 @@ class PaymentItemSkeleton extends StatelessWidget {
|
||||
borderRadius: UiConstants.radiusLg,
|
||||
),
|
||||
child: const Row(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
UiShimmerCircle(size: 40),
|
||||
SizedBox(width: UiConstants.space3),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
UiShimmerLine(width: 140, height: 14),
|
||||
SizedBox(height: UiConstants.space2),
|
||||
UiShimmerLine(width: 100, height: 12),
|
||||
|
||||
@@ -16,12 +16,12 @@ class PaymentsPageSkeleton extends StatelessWidget {
|
||||
return UiShimmer(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
// Header section with gradient
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
colors: <Color>[
|
||||
UiColors.primary,
|
||||
UiColors.primary.withValues(alpha: 0.8),
|
||||
],
|
||||
@@ -37,7 +37,7 @@ class PaymentsPageSkeleton extends StatelessWidget {
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
// Title placeholder
|
||||
const UiShimmerLine(width: 120, height: 24),
|
||||
const SizedBox(height: UiConstants.space6),
|
||||
@@ -45,7 +45,7 @@ class PaymentsPageSkeleton extends StatelessWidget {
|
||||
// Balance center
|
||||
const Center(
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
UiShimmerLine(width: 100, height: 14),
|
||||
SizedBox(height: UiConstants.space1),
|
||||
UiShimmerLine(width: 160, height: 36),
|
||||
@@ -73,7 +73,7 @@ class PaymentsPageSkeleton extends StatelessWidget {
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
// Earnings graph placeholder
|
||||
UiShimmerBox(
|
||||
width: double.infinity,
|
||||
@@ -83,10 +83,10 @@ class PaymentsPageSkeleton extends StatelessWidget {
|
||||
const SizedBox(height: UiConstants.space6),
|
||||
|
||||
// Quick stats row
|
||||
Row(
|
||||
children: [
|
||||
const Row(
|
||||
children: <Widget>[
|
||||
Expanded(child: UiShimmerStatsCard()),
|
||||
const SizedBox(width: UiConstants.space3),
|
||||
SizedBox(width: UiConstants.space3),
|
||||
Expanded(child: UiShimmerStatsCard()),
|
||||
],
|
||||
),
|
||||
@@ -99,7 +99,7 @@ class PaymentsPageSkeleton extends StatelessWidget {
|
||||
// Payment history items
|
||||
UiShimmerList(
|
||||
itemCount: 4,
|
||||
itemBuilder: (index) => const PaymentItemSkeleton(),
|
||||
itemBuilder: (int index) => const PaymentItemSkeleton(),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user