Skip to content

Commit

Permalink
AMAP: completed more than half of the pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-Andrieu committed Dec 26, 2024
1 parent 13076eb commit b0dac09
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 36 deletions.
1 change: 0 additions & 1 deletion lib/amap/ui/components/order_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,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 OrderUI extends HookConsumerWidget {
final Order order;
Expand Down
15 changes: 10 additions & 5 deletions lib/amap/ui/components/product_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ class ProductCard extends ConsumerWidget {
product.name,
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 All @@ -85,7 +85,10 @@ class ProductCard extends ConsumerWidget {
AMAPColors(isDarkTheme).greenGradientSecondary,
AMAPColors(isDarkTheme).textOnPrimary,
],
child: HeroIcon(HeroIcons.pencil, color: Colors.white),
child: HeroIcon(
HeroIcons.pencil,
color: Theme.of(context).colorScheme.onSecondary,
),
),
),
WaitingButton(
Expand All @@ -97,8 +100,10 @@ class ProductCard extends ConsumerWidget {
],
child: child,
),
child:
const HeroIcon(HeroIcons.trash, color: Colors.white),
child: HeroIcon(
HeroIcons.trash,
color: Theme.of(context).colorScheme.onSecondary,
),
),
],
)
Expand Down
5 changes: 2 additions & 3 deletions lib/amap/ui/pages/detail_page/detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ 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';
import 'package:myecl/amap/tools/constants.dart';

class DetailPage extends HookConsumerWidget {
const DetailPage({super.key});
Expand All @@ -30,10 +29,10 @@ class DetailPage extends HookConsumerWidget {
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: Colors.grey.shade50,
color: Theme.of(context).colorScheme.secondaryFixed,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.2),
color: Theme.of(context).shadowColor,
blurRadius: 10,
offset: const Offset(0, 10),
),
Expand Down
8 changes: 4 additions & 4 deletions lib/amap/ui/pages/main_page/collection_slot_selector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'package:myecl/amap/tools/constants.dart';
import 'package:myecl/amap/tools/functions.dart';
import 'package:myecl/tools/functions.dart';
import 'package:myecl/tools/providers/theme_provider.dart';
import 'package:myecl/amap/tools/constants.dart';

class CollectionSlotSelector extends HookConsumerWidget {
final CollectionSlot collectionSlot;
Expand Down Expand Up @@ -37,8 +36,9 @@ class CollectionSlotSelector extends HookConsumerWidget {
topRight: Radius.circular(!isFirst ? 22 : 0),
bottomRight: Radius.circular(!isFirst ? 22 : 0),
),
color:
isSelected ? Colors.white.withOpacity(0.7) : Colors.transparent,
color: isSelected
? Theme.of(context).colorScheme.surface.withOpacity(0.7)
: Colors.transparent,
),
child: Center(
child: Text(
Expand All @@ -48,7 +48,7 @@ class CollectionSlotSelector extends HookConsumerWidget {
fontWeight: FontWeight.bold,
color: isSelected
? AMAPColors(isDarkTheme).greenGradientSecondary
: Colors.white,
: Theme.of(context).colorScheme.onSecondary,
),
),
),
Expand Down
3 changes: 1 addition & 2 deletions lib/amap/ui/pages/main_page/delivery_section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'package:myecl/amap/ui/pages/main_page/delivery_ui.dart';
import 'package:myecl/tools/ui/widgets/align_left_text.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 DeliverySection extends HookConsumerWidget {
final bool showSelected;
Expand Down Expand Up @@ -36,7 +35,7 @@ class DeliverySection extends HookConsumerWidget {
AMAPTextConstants.deliveries,
padding: const EdgeInsets.symmetric(horizontal: 30),
color: showSelected
? Colors.white
? Theme.of(context).colorScheme.onSecondary
: AMAPColors(isDarkTheme).textOnPrimary,
),
AsyncChild(
Expand Down
9 changes: 4 additions & 5 deletions lib/amap/ui/pages/main_page/delivery_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'package:myecl/amap/providers/delivery_provider.dart';
import 'package:myecl/amap/tools/constants.dart';
import 'package:myecl/tools/functions.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 @@ -36,10 +35,10 @@ class DeliveryUi extends HookConsumerWidget {
colors: [
(selected && showSelected)
? AMAPColors(isDarkTheme).greenGradientSecondary
: Colors.white,
: Theme.of(context).colorScheme.surface,
(selected && showSelected)
? AMAPColors(isDarkTheme).textOnPrimary
: Colors.white,
: Theme.of(context).colorScheme.surface,
],
),
boxShadow: [
Expand All @@ -63,7 +62,7 @@ class DeliveryUi extends HookConsumerWidget {
fontSize: 18,
fontWeight: FontWeight.bold,
color: (selected && showSelected)
? Colors.white
? Theme.of(context).colorScheme.onSecondary
: AMAPColors(isDarkTheme).textOnPrimary,
),
),
Expand All @@ -74,7 +73,7 @@ class DeliveryUi extends HookConsumerWidget {
fontSize: 18,
fontWeight: FontWeight.w700,
color: (selected && showSelected)
? Colors.white
? Theme.of(context).colorScheme.onSecondary
: AMAPColors(isDarkTheme).textOnSecondary,
),
),
Expand Down
20 changes: 13 additions & 7 deletions lib/amap/ui/pages/main_page/main_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,16 @@ class AmapMainPage extends HookConsumerWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const AlignLeftText(
AlignLeftText(
AMAPTextConstants.addOrder,
color: Colors.white,
color:
Theme.of(context).colorScheme.onSecondary,
),
IconButton(
icon: const HeroIcon(
icon: HeroIcon(
HeroIcons.xMark,
color: Colors.white,
color:
Theme.of(context).colorScheme.onSecondary,
size: 30,
),
onPressed: () {
Expand All @@ -212,7 +214,10 @@ class AmapMainPage extends HookConsumerWidget {
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
border: Border.all(color: Colors.white, width: 2),
border: Border.all(
color:
Theme.of(context).colorScheme.onSecondary,
width: 2),
),
child: Row(
children: CollectionSlot.values
Expand Down Expand Up @@ -279,13 +284,14 @@ class AmapMainPage extends HookConsumerWidget {
child: Container(
padding: const EdgeInsets.only(bottom: 5),
width: double.infinity,
child: const Center(
child: Center(
child: Text(
AMAPTextConstants.nextStep,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.w900,
color: Colors.white,
color:
Theme.of(context).colorScheme.onSecondary,
),
),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/amap/ui/pages/main_page/orders_section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class OrderSection extends HookConsumerWidget {
children: [
AlignLeftText(
AMAPTextConstants.orders,
padding: EdgeInsets.symmetric(horizontal: 30),
padding: const EdgeInsets.symmetric(horizontal: 30),
color: AMAPColors(isDarkTheme).textOnPrimary,
),
const SizedBox(height: 10),
Expand All @@ -68,7 +68,7 @@ class OrderSection extends HookConsumerWidget {
child: Center(
child: HeroIcon(
HeroIcons.plus,
color: Colors.white,
color: Theme.of(context).colorScheme.onSecondary,
size: 50,
),
),
Expand Down
13 changes: 8 additions & 5 deletions lib/amap/ui/pages/presentation_page/text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,17 @@ class PresentationPage extends HookConsumerWidget {
}
},
),
error: (Object error, StackTrace stackTrace) =>
const TextSpan(
error: (Object error, StackTrace stackTrace) => TextSpan(
text: AMAPTextConstants.loadingError,
style: TextStyle(color: Colors.red),
style: TextStyle(
color: Theme.of(context).colorScheme.error,
),
),
loading: () => const TextSpan(
loading: () => TextSpan(
text: AMAPTextConstants.loading,
style: TextStyle(color: Colors.red),
style: TextStyle(
color: Theme.of(context).colorScheme.error,
),
),
),
TextSpan(
Expand Down
4 changes: 2 additions & 2 deletions lib/amap/ui/pages/product_pages/add_edit_product.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ class AddEditProduct extends HookConsumerWidget {
child: DropdownButtonFormField<String>(
value: categoryController,
decoration: InputDecoration(
enabledBorder: UnderlineInputBorder(
enabledBorder: const UnderlineInputBorder(
borderSide: BorderSide(
color: AMAPColorConstants.enabled,
),
),
errorBorder: UnderlineInputBorder(
errorBorder: const UnderlineInputBorder(
borderSide:
BorderSide(color: AMAPColorConstants.red),
),
Expand Down

0 comments on commit b0dac09

Please sign in to comment.