Skip to content

Commit

Permalink
Flutter 3.27 (#464)
Browse files Browse the repository at this point in the history
Replaces and closes #463 with @Rotheem's branch
Goal of this PR: see the title of #463

---------

Co-authored-by: Thonyk <[email protected]>
  • Loading branch information
2 people authored and maximeroucher committed Jan 11, 2025
1 parent 1190695 commit 3803f1f
Show file tree
Hide file tree
Showing 155 changed files with 418 additions and 395 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.22.2'
flutter-version-file: pubspec.yaml
cache: true

- name: Cleanup 🧹
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lintandformat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version-file: pubspec.yaml

- name: Install Pub Dependencies
run: flutter pub get
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-mobile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.22.2'
flutter-version-file: pubspec.yaml
cache: true

- name: Cleanup 🧹
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: "3.22.2"
flutter-version-file: pubspec.yaml
cache: true

- name: Cleanup 🧹
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version-file: pubspec.yaml

- name: Install Pub Dependencies
run: flutter pub get
Expand Down
2 changes: 1 addition & 1 deletion lib/admin/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import 'package:myecl/tools/middlewares/deferred_middleware.dart';
import 'package:qlevar_router/qlevar_router.dart';

class AdminRouter {
final ProviderRef ref;
final Ref ref;
static const String root = '/admin';
static const String groups = '/groups';
static const String addGroup = '/add_group';
Expand Down
2 changes: 1 addition & 1 deletion lib/admin/ui/components/admin_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class AdminButton extends StatelessWidget {
),
boxShadow: [
BoxShadow(
color: ColorConstants.gradient2.withOpacity(0.5),
color: ColorConstants.gradient2.withValues(alpha: 0.5),
blurRadius: 5,
offset: const Offset(2, 2),
spreadRadius: 2,
Expand Down
2 changes: 1 addition & 1 deletion lib/admin/ui/components/item_card_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ItemCardUi extends StatelessWidget {
borderRadius: BorderRadius.circular(10),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.2),
color: Colors.grey.withValues(alpha: 0.2),
blurRadius: 5,
spreadRadius: 2,
),
Expand Down
2 changes: 1 addition & 1 deletion lib/admin/ui/components/user_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class UserUi extends HookConsumerWidget {
),
boxShadow: [
BoxShadow(
color: ColorConstants.background2.withOpacity(0.4),
color: ColorConstants.background2.withValues(alpha: 0.4),
offset: const Offset(2, 3),
blurRadius: 5,
),
Expand Down
2 changes: 1 addition & 1 deletion lib/admin/ui/pages/edit_group_page/search_user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class SearchUser extends HookConsumerWidget {
),
boxShadow: [
BoxShadow(
color: ColorConstants.gradient2.withOpacity(0.4),
color: ColorConstants.gradient2.withValues(alpha: 0.4),
offset: const Offset(2, 3),
blurRadius: 5,
),
Expand Down
2 changes: 1 addition & 1 deletion lib/admin/ui/pages/school_page/school_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class SchoolButton extends StatelessWidget {
),
boxShadow: [
BoxShadow(
color: gradient2.withOpacity(0.3),
color: gradient2.withValues(alpha: 0.3),
spreadRadius: 2,
blurRadius: 4,
offset: const Offset(2, 3),
Expand Down
2 changes: 1 addition & 1 deletion lib/advert/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import 'package:myecl/tools/middlewares/deferred_middleware.dart';
import 'package:qlevar_router/qlevar_router.dart';

class AdvertRouter {
final ProviderRef ref;
final Ref ref;
static const String root = '/advert';
static const String admin = '/admin';
static const String addEditAdvert = '/add_edit_advert';
Expand Down
12 changes: 6 additions & 6 deletions lib/advert/tools/functions.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'dart:ui';

Color invert(Color color) {
return Color.fromARGB(
color.alpha,
255 - color.red,
255 - color.green,
255 - color.blue,
return Color.from(
alpha: color.a * 255,
red: 1.0 - color.r,
green: 1.0 - color.g,
blue: 1.0 - color.b,
);
}

Expand All @@ -14,7 +14,7 @@ Color generateColor(String uuid) {
for (int i = 0; i < uuid.length; i++) {
hash = 20 * hash + uuid.codeUnitAt(i);
}
Color color = Color(hash & 0xFFFFFF).withOpacity(1.0);
Color color = Color(hash & 0xFFFFFF).withValues(alpha: 1.0);
double luminance = color.computeLuminance();
return luminance < 0.5 ? color : invert(color);
}
4 changes: 2 additions & 2 deletions lib/advert/ui/components/advert_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class AdvertCard extends HookConsumerWidget {
boxShadow: [
BoxShadow(
blurRadius: 5,
color: Colors.black.withOpacity(0.3),
color: Colors.black.withValues(alpha: 0.3),
offset: const Offset(2, 2),
spreadRadius: 3,
),
Expand Down Expand Up @@ -292,7 +292,7 @@ class AdvertCard extends HookConsumerWidget {
boxShadow: [
BoxShadow(
blurRadius: 5,
color: Colors.black.withOpacity(0.3),
color: Colors.black.withValues(alpha: 0.3),
offset: const Offset(2, 2),
spreadRadius: 3,
),
Expand Down
10 changes: 5 additions & 5 deletions lib/advert/ui/components/tag_chip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ class TagChip extends StatelessWidget {
Color bgColor = generateColor(tagName);
Color borderColor =
bgColor.computeLuminance() > 0.1 ? bgColor : Colors.white;
Color darkerBgColor = Color.fromARGB(
bgColor.alpha,
max(bgColor.red - 30, 0),
max(bgColor.green - 30, 0),
max(bgColor.blue - 30, 0),
Color darkerBgColor = Color.from(
alpha: bgColor.a,
red: max(bgColor.r - 0.12, 0), // 0.12 = 30/255
green: max(bgColor.g - 0.12, 0),
blue: max(bgColor.b - 0.12, 0),
);

return Container(
Expand Down
6 changes: 3 additions & 3 deletions lib/advert/ui/pages/admin_page/admin_advert_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class AdminAdvertCard extends HookConsumerWidget {
Colors.grey.shade100,
Colors.grey.shade400,
],
shadowColor: Colors.grey.shade300.withOpacity(0.2),
shadowColor: Colors.grey.shade300.withValues(alpha: 0.2),
child:
const HeroIcon(HeroIcons.pencil, color: Colors.black),
),
Expand All @@ -55,8 +55,8 @@ class AdminAdvertCard extends HookConsumerWidget {
AdvertColorConstants.redGradient1,
AdvertColorConstants.redGradient2,
],
shadowColor:
AdvertColorConstants.redGradient2.withOpacity(0.2),
shadowColor: AdvertColorConstants.redGradient2
.withValues(alpha: 0.2),
child: child,
),
child: const HeroIcon(HeroIcons.trash, color: Colors.white),
Expand Down
2 changes: 1 addition & 1 deletion lib/advert/ui/pages/admin_page/admin_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class AdvertAdminPage extends HookConsumerWidget {
Colors.white,
Colors.grey.shade100,
],
shadowColor: Colors.grey.withOpacity(0.2),
shadowColor: Colors.grey.withValues(alpha: 0.2),
child: Center(
child: HeroIcon(
HeroIcons.plus,
Expand Down
10 changes: 5 additions & 5 deletions lib/advert/ui/pages/detail_page/detail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class AdvertDetailPage extends HookConsumerWidget {
end: Alignment.bottomCenter,
colors: [
const Color.fromARGB(0, 255, 255, 255),
Colors.grey.shade50.withOpacity(0.85),
Colors.grey.shade50..withValues(alpha: 0.85),
Colors.grey.shade50,
],
stops: const [0.0, 0.65, 1.0],
Expand Down Expand Up @@ -149,11 +149,11 @@ class AdvertDetailPage extends HookConsumerWidget {
child: Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.9),
color: Colors.white.withValues(alpha: 0.9),
borderRadius: BorderRadius.circular(18),
boxShadow: [
BoxShadow(
color: Colors.white.withOpacity(0.3),
color: Colors.white.withValues(alpha: 0.3),
blurRadius: 7,
spreadRadius: 2,
offset: const Offset(2, 3),
Expand All @@ -171,11 +171,11 @@ class AdvertDetailPage extends HookConsumerWidget {
padding:
const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.9),
color: Colors.white.withValues(alpha: 0.9),
borderRadius: BorderRadius.circular(18),
boxShadow: [
BoxShadow(
color: Colors.white.withOpacity(0.3),
color: Colors.white.withValues(alpha: 0.3),
blurRadius: 7,
spreadRadius: 2,
offset: const Offset(2, 3),
Expand Down
6 changes: 3 additions & 3 deletions lib/advert/ui/pages/form_page/add_edit_advert_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class AdvertAddEditAdvertPage extends HookConsumerWidget {
BoxShadow(
color: formFieldState.hasError
? Colors.red
: Colors.black.withOpacity(0.1),
: Colors.black.withValues(alpha: 0.1),
spreadRadius: 5,
blurRadius: 10,
offset: const Offset(2, 3),
Expand Down Expand Up @@ -140,13 +140,13 @@ class AdvertAddEditAdvertPage extends HookConsumerWidget {
Radius.circular(5),
),
color: Colors.white
.withOpacity(0.4),
.withValues(alpha: 0.4),
),
child: HeroIcon(
HeroIcons.photo,
size: 40,
color: Colors.black
.withOpacity(0.5),
.withValues(alpha: 0.5),
),
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/amap/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import 'package:myecl/tools/middlewares/deferred_middleware.dart';
import 'package:qlevar_router/qlevar_router.dart';

class AmapRouter {
final ProviderRef ref;
final Ref ref;
static const String root = '/amap';
static const String admin = '/admin';
static const String addEditDelivery = '/add_edit_delivery';
Expand Down
2 changes: 1 addition & 1 deletion lib/amap/ui/pages/admin_page/account_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class AccountHandler extends HookConsumerWidget {
AMAPColorConstants.green1,
AMAPColorConstants.textLight,
],
shadowColor: AMAPColorConstants.textDark.withOpacity(0.2),
shadowColor: AMAPColorConstants.textDark.withValues(alpha: 0.2),
padding: const EdgeInsets.symmetric(horizontal: 17.0),
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 12.0),
Expand Down
2 changes: 1 addition & 1 deletion lib/amap/ui/pages/admin_page/delivery_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class DeliveryHandler extends HookConsumerWidget {
child: CardLayout(
height: 160,
width: 100,
shadowColor: AMAPColorConstants.textDark.withOpacity(0.2),
shadowColor: AMAPColorConstants.textDark.withValues(alpha: 0.2),
child: const Center(
child: HeroIcon(
HeroIcons.plus,
Expand Down
7 changes: 4 additions & 3 deletions lib/amap/ui/pages/admin_page/delivery_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class DeliveryUi extends HookConsumerWidget {
id: delivery.id,
height: 160,
width: 280,
shadowColor: AMAPColorConstants.textDark.withOpacity(0.2),
shadowColor: AMAPColorConstants.textDark.withValues(alpha: 0.2),
padding: const EdgeInsets.all(10),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
Expand Down Expand Up @@ -322,9 +322,10 @@ class DeliveryUi extends HookConsumerWidget {
boxShadow: [
BoxShadow(
color: !(delivery.status == DeliveryStatus.creation)
? AMAPColorConstants.redGradient2.withOpacity(0.5)
? AMAPColorConstants.redGradient2
.withValues(alpha: 0.5)
: AMAPColorConstants.greenGradient2
.withOpacity(0.5),
.withValues(alpha: 0.5),
blurRadius: 10,
offset: const Offset(2, 3),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/amap/ui/pages/admin_page/product_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class ProductHandler extends HookConsumerWidget {
AMAPColorConstants.lightGradient1,
AMAPColorConstants.lightGradient2,
],
shadowColor: AMAPColorConstants.textDark.withOpacity(0.3),
shadowColor: AMAPColorConstants.textDark.withValues(alpha: 0.3),
child: const Center(
child: HeroIcon(
HeroIcons.plus,
Expand Down
2 changes: 1 addition & 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 @@ -12,7 +12,7 @@ class UserCashUiLayout extends StatelessWidget {
width: 150,
height: 100,
colors: const [AMAPColorConstants.green1, AMAPColorConstants.textLight],
shadowColor: AMAPColorConstants.textDark.withOpacity(0.2),
shadowColor: AMAPColorConstants.textDark.withValues(alpha: 0.2),
padding: const EdgeInsets.symmetric(horizontal: 17.0, vertical: 5),
child: child,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ProductDetailCard extends StatelessWidget {
AMAPColorConstants.lightGradient1,
AMAPColorConstants.lightGradient2,
],
shadowColor: AMAPColorConstants.textDark.withOpacity(0.3),
shadowColor: AMAPColorConstants.textDark.withValues(alpha: 0.3),
padding: const EdgeInsets.only(left: 17.0, top: 5, right: 17),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
Expand Down
2 changes: 1 addition & 1 deletion lib/amap/ui/pages/detail_page/detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DetailPage extends HookConsumerWidget {
color: Colors.grey.shade50,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.2),
color: Colors.grey.withValues(alpha: 0.2),
blurRadius: 10,
offset: const Offset(0, 10),
),
Expand Down
8 changes: 4 additions & 4 deletions lib/amap/ui/pages/list_products_page/category_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class CategoryPage extends HookConsumerWidget {
child: Container(
decoration: BoxDecoration(
color: AMAPColorConstants.background2
.withOpacity(0.5),
.withValues(alpha: 0.5),
),
child: Column(
children: listWidgetProduct,
Expand Down Expand Up @@ -138,7 +138,7 @@ class CategoryPage extends HookConsumerWidget {
boxShadow: [
BoxShadow(
color: AMAPColorConstants.green2
.withOpacity(0.4),
.withValues(alpha: 0.4),
offset: const Offset(2, 3),
blurRadius: 5,
),
Expand Down Expand Up @@ -180,8 +180,8 @@ class CategoryPage extends HookConsumerWidget {
filter: ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
child: Container(
decoration: BoxDecoration(
color:
AMAPColorConstants.background2.withOpacity(0.5),
color: AMAPColorConstants.background2
.withValues(alpha: 0.5),
),
child: Column(children: listWidgetProduct),
),
Expand Down
6 changes: 3 additions & 3 deletions lib/amap/ui/pages/list_products_page/list_products_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class ListProductPage extends HookConsumerWidget {
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Colors.white.withOpacity(1.0),
Colors.white.withOpacity(0.8),
Colors.white.withOpacity(0.0),
Colors.white..withValues(alpha: 1.0),
Colors.white.withValues(alpha: 0.8),
Colors.white.withValues(alpha: 0.0),
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
Expand Down
Loading

0 comments on commit 3803f1f

Please sign in to comment.