Skip to content

Commit

Permalink
AMAP: FINALLY
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-Andrieu committed Dec 26, 2024
1 parent b0dac09 commit 8693e4e
Show file tree
Hide file tree
Showing 27 changed files with 33 additions and 69 deletions.
1 change: 0 additions & 1 deletion lib/amap/ui/components/product_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'package:myecl/tools/ui/layouts/card_button.dart';
import 'package:myecl/tools/ui/layouts/card_layout.dart';
import 'package:myecl/tools/ui/builders/waiting_button.dart';
import 'package:myecl/tools/providers/theme_provider.dart';
import 'package:myecl/amap/tools/constants.dart';

class ProductCard extends ConsumerWidget {
final Product product;
Expand Down
1 change: 0 additions & 1 deletion lib/amap/ui/pages/admin_page/account_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import 'package:myecl/tools/ui/layouts/horizontal_list_view.dart';
import 'package:myecl/tools/ui/widgets/styled_search_bar.dart';
import 'package:myecl/user/providers/user_list_provider.dart';
import 'package:myecl/tools/providers/theme_provider.dart';
import 'package:myecl/amap/tools/constants.dart';

class AccountHandler extends HookConsumerWidget {
const AccountHandler({super.key});
Expand Down
3 changes: 1 addition & 2 deletions lib/amap/ui/pages/admin_page/adding_user_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'package:myecl/amap/providers/cash_list_provider.dart';
import 'package:myecl/amap/tools/constants.dart';
import 'package:myecl/user/class/list_users.dart';
import 'package:myecl/tools/providers/theme_provider.dart';
import 'package:myecl/amap/tools/constants.dart';

class AddingUserCard extends HookConsumerWidget {
final SimpleUser user;
Expand All @@ -33,7 +32,7 @@ class AddingUserCard extends HookConsumerWidget {
width: 140,
height: 75,
decoration: BoxDecoration(
color: Colors.white,
color: Theme.of(context).colorScheme.surface,
borderRadius: BorderRadius.circular(25),
),
child: Padding(
Expand Down
1 change: 0 additions & 1 deletion lib/amap/ui/pages/admin_page/adding_user_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'package:myecl/amap/ui/pages/admin_page/adding_user_card.dart';
import 'package:myecl/tools/ui/builders/async_child.dart';
import 'package:myecl/user/providers/user_list_provider.dart';
import 'package:myecl/tools/providers/theme_provider.dart';
import 'package:myecl/amap/tools/constants.dart';

class AddingUserContainer extends HookConsumerWidget {
final VoidCallback onAdd;
Expand Down
3 changes: 0 additions & 3 deletions lib/amap/ui/pages/admin_page/admin_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import 'package:myecl/amap/ui/pages/admin_page/account_handler.dart';
import 'package:myecl/amap/ui/pages/admin_page/delivery_handler.dart';
import 'package:myecl/amap/ui/pages/admin_page/product_handler.dart';
import 'package:myecl/tools/ui/layouts/refresher.dart';
import 'package:myecl/tools/providers/theme_provider.dart';
import 'package:myecl/amap/tools/constants.dart';

class AdminPage extends HookConsumerWidget {
const AdminPage({super.key});
Expand All @@ -19,7 +17,6 @@ class AdminPage extends HookConsumerWidget {
final cashNotifier = ref.read(cashListProvider.notifier);
final deliveryListNotifier = ref.read(deliveryListProvider.notifier);
final productListNotifier = ref.read(productListProvider.notifier);
final isDarkTheme = ref.watch(themeProvider);
return AmapTemplate(
child: Refresher(
onRefresh: () async {
Expand Down
1 change: 0 additions & 1 deletion lib/amap/ui/pages/admin_page/cash_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'package:myecl/amap/tools/constants.dart';
import 'package:myecl/amap/ui/pages/admin_page/user_cash_ui.dart';
import 'package:myecl/tools/ui/builders/async_child.dart';
import 'package:myecl/tools/providers/theme_provider.dart';
import 'package:myecl/amap/tools/constants.dart';

class CashContainer extends HookConsumerWidget {
const CashContainer({super.key});
Expand Down
3 changes: 1 addition & 2 deletions lib/amap/ui/pages/admin_page/delivery_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import 'package:myecl/tools/ui/layouts/card_layout.dart';
import 'package:myecl/tools/ui/layouts/horizontal_list_view.dart';
import 'package:qlevar_router/qlevar_router.dart';
import 'package:myecl/tools/providers/theme_provider.dart';
import 'package:myecl/amap/tools/constants.dart';

class DeliveryHandler extends HookConsumerWidget {
const DeliveryHandler({super.key});
Expand All @@ -29,7 +28,7 @@ class DeliveryHandler extends HookConsumerWidget {
children: [
AlignLeftText(
AMAPTextConstants.deliveries,
padding: EdgeInsets.symmetric(horizontal: 30),
padding: const EdgeInsets.symmetric(horizontal: 30),
color: AMAPColors(isDarkTheme).textOnPrimary,
),
const SizedBox(height: 10),
Expand Down
13 changes: 6 additions & 7 deletions lib/amap/ui/pages/admin_page/delivery_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import 'package:myecl/tools/token_expire_wrapper.dart';
import 'package:myecl/tools/ui/builders/waiting_button.dart';
import 'package:qlevar_router/qlevar_router.dart';
import 'package:myecl/tools/providers/theme_provider.dart';
import 'package:myecl/amap/tools/constants.dart';

class DeliveryUi extends HookConsumerWidget {
final Delivery delivery;
Expand Down Expand Up @@ -164,7 +163,7 @@ class DeliveryUi extends HookConsumerWidget {
],
child: HeroIcon(
HeroIcons.pencil,
color: Colors.white,
color: Theme.of(context).colorScheme.onSecondary,
size: 22,
),
),
Expand Down Expand Up @@ -207,9 +206,9 @@ class DeliveryUi extends HookConsumerWidget {
],
child: child,
),
child: const HeroIcon(
child: HeroIcon(
HeroIcons.trash,
color: Colors.white,
color: Theme.of(context).colorScheme.onSecondary,
size: 22,
),
),
Expand Down Expand Up @@ -350,8 +349,8 @@ class DeliveryUi extends HookConsumerWidget {
: delivery.status == DeliveryStatus.locked
? AMAPTextConstants.endingDelivery
: AMAPTextConstants.archiveDelivery,
style: const TextStyle(
color: Colors.white,
style: TextStyle(
color: Theme.of(context).colorScheme.onSecondary,
fontSize: 20,
),
),
Expand All @@ -365,7 +364,7 @@ class DeliveryUi extends HookConsumerWidget {
: delivery.status == DeliveryStatus.locked
? HeroIcons.truck
: HeroIcons.archiveBoxArrowDown,
color: Colors.white,
color: Theme.of(context).colorScheme.onSecondary,
size: 22,
),
],
Expand Down
7 changes: 3 additions & 4 deletions lib/amap/ui/pages/admin_page/product_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import 'package:myecl/tools/token_expire_wrapper.dart';
import 'package:myecl/tools/ui/layouts/horizontal_list_view.dart';
import 'package:qlevar_router/qlevar_router.dart';
import 'package:myecl/tools/providers/theme_provider.dart';
import 'package:myecl/amap/tools/constants.dart';

class ProductHandler extends HookConsumerWidget {
const ProductHandler({super.key});
Expand All @@ -40,7 +39,7 @@ class ProductHandler extends HookConsumerWidget {
return Column(
children: [
AlignLeftText(
padding: EdgeInsets.symmetric(horizontal: 30),
padding: const EdgeInsets.symmetric(horizontal: 30),
AMAPTextConstants.products,
color: AMAPColors(isDarkTheme).textOnPrimary,
),
Expand All @@ -67,10 +66,10 @@ class ProductHandler extends HookConsumerWidget {
],
shadowColor:
AMAPColors(isDarkTheme).textOnPrimary.withOpacity(0.3),
child: const Center(
child: Center(
child: HeroIcon(
HeroIcons.plus,
color: Colors.white,
color: Theme.of(context).colorScheme.onSecondary,
size: 50,
),
),
Expand Down
1 change: 0 additions & 1 deletion lib/amap/ui/pages/admin_page/user_cash_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import 'package:myecl/tools/token_expire_wrapper.dart';
import 'package:myecl/tools/ui/builders/waiting_button.dart';
import 'package:myecl/tools/ui/widgets/text_entry.dart';
import 'package:myecl/tools/providers/theme_provider.dart';
import 'package:myecl/amap/tools/constants.dart';

class UserCashUi extends HookConsumerWidget {
final Cash cash;
Expand Down
1 change: 0 additions & 1 deletion lib/amap/ui/pages/admin_page/user_cash_ui_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:myecl/amap/tools/constants.dart';
import 'package:myecl/tools/ui/layouts/card_layout.dart';
import 'package:myecl/tools/providers/theme_provider.dart';
import 'package:myecl/amap/tools/constants.dart';

class UserCashUiLayout extends ConsumerWidget {
final Widget child;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import 'package:myecl/tools/ui/widgets/date_entry.dart';
import 'package:myecl/tools/ui/builders/waiting_button.dart';
import 'package:qlevar_router/qlevar_router.dart';
import 'package:myecl/tools/providers/theme_provider.dart';
import 'package:myecl/amap/tools/constants.dart';

class AddEditDeliveryPage extends HookConsumerWidget {
const AddEditDeliveryPage({super.key});
Expand Down Expand Up @@ -97,7 +96,6 @@ class AddEditDeliveryPage extends HookConsumerWidget {
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w800,
color: Colors.black,
),
),
),
Expand Down
1 change: 0 additions & 1 deletion lib/amap/ui/pages/delivery_pages/product_ui_check.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:myecl/amap/class/product.dart';
import 'package:myecl/amap/tools/constants.dart';
import 'package:myecl/tools/providers/theme_provider.dart';
import 'package:myecl/amap/tools/constants.dart';

class ProductUi extends ConsumerWidget {
final Product product;
Expand Down
6 changes: 3 additions & 3 deletions lib/amap/ui/pages/detail_delivery_page/detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import 'package:myecl/tools/ui/builders/async_child.dart';
import 'package:myecl/tools/ui/widgets/loader.dart';
import 'package:myecl/tools/ui/layouts/refresher.dart';
import 'package:myecl/tools/providers/theme_provider.dart';
import 'package:myecl/amap/tools/constants.dart';

class DetailDeliveryPage extends HookConsumerWidget {
const DetailDeliveryPage({super.key});
Expand Down Expand Up @@ -114,15 +113,16 @@ class DetailDeliveryPage extends HookConsumerWidget {
const SizedBox(height: 20),
AlignLeftText(
"${AMAPTextConstants.orders} :",
padding: EdgeInsets.only(left: 30),
padding: const EdgeInsets.only(left: 30),
color: AMAPColors(isDarkTheme).textOnPrimary,
),
const SizedBox(height: 30),
Container(
margin: const EdgeInsets.symmetric(horizontal: 10),
child: orders == null
? Loader(
color: AMAPColors(isDarkTheme).greenGradientSecondary)
color: AMAPColors(isDarkTheme).greenGradientSecondary,
)
: AsyncChild(
value: orders,
loaderColor:
Expand Down
27 changes: 13 additions & 14 deletions lib/amap/ui/pages/detail_delivery_page/order_detail_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import 'package:myecl/tools/functions.dart';
import 'package:myecl/tools/token_expire_wrapper.dart';
import 'package:myecl/tools/ui/builders/waiting_button.dart';
import 'package:myecl/tools/providers/theme_provider.dart';
import 'package:myecl/amap/tools/constants.dart';

class DetailOrderUI extends HookConsumerWidget {
final Order order;
Expand Down Expand Up @@ -74,10 +73,10 @@ class DetailOrderUI extends HookConsumerWidget {
maxLines: 1,
minFontSize: 10,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
style: TextStyle(
fontSize: 17,
fontWeight: FontWeight.w700,
color: Colors.white,
color: Theme.of(context).colorScheme.onSecondary,
),
),
),
Expand All @@ -86,10 +85,10 @@ class DetailOrderUI extends HookConsumerWidget {
child: Text(
"${product.quantity} (${(product.quantity * product.price).toStringAsFixed(2)}€)",
textAlign: TextAlign.right,
style: const TextStyle(
style: TextStyle(
fontSize: 17,
fontWeight: FontWeight.w700,
color: Colors.white,
color: Theme.of(context).colorScheme.onSecondary,
),
),
),
Expand All @@ -98,29 +97,29 @@ class DetailOrderUI extends HookConsumerWidget {
),
Container(
height: 3,
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(10)),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.onSecondary,
borderRadius: const BorderRadius.all(Radius.circular(10)),
),
margin: const EdgeInsets.symmetric(vertical: 7),
),
Row(
children: [
Text(
"${order.products.fold<int>(0, (value, product) => value + product.quantity)} ${AMAPTextConstants.product}${order.products.fold<int>(0, (value, product) => value + product.quantity) != 1 ? "s" : ""}",
style: const TextStyle(
style: TextStyle(
fontSize: 17,
fontWeight: FontWeight.w700,
color: Colors.white,
color: Theme.of(context).colorScheme.onSecondary,
),
),
const Spacer(),
Text(
"${order.amount.toStringAsFixed(2)}€",
style: const TextStyle(
style: TextStyle(
fontSize: 17,
fontWeight: FontWeight.w700,
color: Colors.white,
color: Theme.of(context).colorScheme.onSecondary,
),
),
],
Expand Down Expand Up @@ -190,9 +189,9 @@ class DetailOrderUI extends HookConsumerWidget {
],
child: child,
),
child: const HeroIcon(
child: HeroIcon(
HeroIcons.trash,
color: Colors.white,
color: Theme.of(context).colorScheme.onSecondary,
size: 20,
),
),
Expand Down
5 changes: 2 additions & 3 deletions lib/amap/ui/pages/detail_delivery_page/product_detail_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'package:myecl/amap/class/product.dart';
import 'package:myecl/amap/tools/constants.dart';
import 'package:myecl/tools/ui/layouts/card_layout.dart';
import 'package:myecl/tools/providers/theme_provider.dart';
import 'package:myecl/amap/tools/constants.dart';

class ProductDetailCard extends ConsumerWidget {
final Product product;
Expand Down Expand Up @@ -48,10 +47,10 @@ class ProductDetailCard extends ConsumerWidget {
"${AMAPTextConstants.quantity} : $quantity",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
style: TextStyle(
fontSize: 13,
fontWeight: FontWeight.bold,
color: Colors.white,
color: Theme.of(context).colorScheme.onSecondary,
),
),
const SizedBox(height: 4),
Expand Down
2 changes: 0 additions & 2 deletions lib/amap/ui/pages/detail_page/detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import 'package:myecl/amap/ui/amap.dart';
import 'package:myecl/amap/ui/components/order_ui.dart';
import 'package:myecl/amap/ui/components/product_ui.dart';
import 'package:myecl/tools/ui/widgets/align_left_text.dart';
import 'package:myecl/tools/providers/theme_provider.dart';

class DetailPage extends HookConsumerWidget {
const DetailPage({super.key});

@override
Widget build(BuildContext context, WidgetRef ref) {
final order = ref.watch(orderProvider);
final isDarkTheme = ref.watch(themeProvider);
return AmapTemplate(
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
Expand Down
1 change: 0 additions & 1 deletion lib/amap/ui/pages/list_products_page/category_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import 'package:myecl/amap/ui/pages/list_products_page/product_ui_list.dart';
import 'package:myecl/tools/functions.dart';
import 'package:myecl/tools/ui/widgets/align_left_text.dart';
import 'package:myecl/tools/providers/theme_provider.dart';
import 'package:myecl/amap/tools/constants.dart';

class CategoryPage extends HookConsumerWidget {
final String category;
Expand Down
3 changes: 0 additions & 3 deletions lib/amap/ui/pages/list_products_page/list_products.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import 'package:myecl/amap/tools/constants.dart';
import 'package:myecl/amap/ui/pages/list_products_page/category_page.dart';
import 'package:myecl/amap/ui/pages/list_products_page/web_page_navigation_button.dart';
import 'package:myecl/drawer/providers/is_web_format_provider.dart';
import 'package:myecl/tools/providers/theme_provider.dart';
import 'package:myecl/amap/tools/constants.dart';

class ListProducts extends HookConsumerWidget {
const ListProducts({super.key});
Expand All @@ -28,7 +26,6 @@ class ListProducts extends HookConsumerWidget {
final scrollNotifier = ref.watch(scrollProvider.notifier);
final pageController = ref.watch(amapPageControllerProvider);
final isWebFormat = ref.watch(isWebFormatProvider);
final isDarkTheme = ref.watch(themeProvider);
pageController.addListener(() {
scrollNotifier.setScroll(pageController.page!);
});
Expand Down
Loading

0 comments on commit 8693e4e

Please sign in to comment.