Skip to content

Commit

Permalink
Provider version : Improve code style using lint rules v3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
SinaSys committed Nov 24, 2023
1 parent dbe806c commit e2825dc
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:flutter_japanese_restaurant_app/src/business_logic/provider/cate
void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});

@override
Widget build(BuildContext context) {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/presentation/animation/fade_animation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ class FadeAnimation extends StatelessWidget {
final Widget child;

const FadeAnimation({
Key? key,
super.key,
required this.delay,
required this.child,
}) : super(key: key);
});

@override
Widget build(BuildContext context) {
Expand Down
5 changes: 4 additions & 1 deletion lib/src/presentation/animation/page_transition.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import 'package:animations/animations.dart';
import 'package:flutter/material.dart';

class PageTransition extends StatelessWidget {
const PageTransition({Key? key, required this.child}) : super(key: key);
const PageTransition({
super.key,
required this.child,
});

final Widget child;

Expand Down
5 changes: 4 additions & 1 deletion lib/src/presentation/animation/scale_animation.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import 'package:flutter/material.dart';

class ScaleAnimation extends StatefulWidget {
const ScaleAnimation({Key? key, required this.child}) : super(key: key);
const ScaleAnimation({
super.key,
required this.child,
});

final Widget child;

Expand Down
2 changes: 1 addition & 1 deletion lib/src/presentation/screen/cart_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'package:flutter_japanese_restaurant_app/src/business_logic/provider/them
import 'package:provider/provider.dart';

class CartScreen extends StatelessWidget {
const CartScreen({Key? key}) : super(key: key);
const CartScreen({super.key});

PreferredSizeWidget _appBar(BuildContext context) {
return AppBar(
Expand Down
2 changes: 1 addition & 1 deletion lib/src/presentation/screen/favorite_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'package:flutter_japanese_restaurant_app/src/business_logic/provider/food
import 'package:flutter_japanese_restaurant_app/src/business_logic/provider/theme/theme_provider.dart';

class FavoriteScreen extends StatelessWidget {
const FavoriteScreen({Key? key}) : super(key: key);
const FavoriteScreen({super.key});

@override
Widget build(BuildContext context) {
Expand Down
5 changes: 4 additions & 1 deletion lib/src/presentation/screen/food_detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import 'package:flutter_japanese_restaurant_app/src/business_logic/provider/food
import 'package:flutter_japanese_restaurant_app/src/business_logic/provider/theme/theme_provider.dart';

class FoodDetailScreen extends StatelessWidget {
const FoodDetailScreen({Key? key, required this.food}) : super(key: key);
const FoodDetailScreen({
super.key,
required this.food,
});

final Food food;

Expand Down
2 changes: 1 addition & 1 deletion lib/src/presentation/screen/food_list_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'package:flutter_japanese_restaurant_app/src/business_logic/provider/them
import 'package:flutter_japanese_restaurant_app/src/business_logic/provider/category/category_provider.dart';

class FoodListScreen extends StatelessWidget {
const FoodListScreen({Key? key}) : super(key: key);
const FoodListScreen({super.key});

PreferredSizeWidget _appBar(BuildContext context) {
return AppBar(
Expand Down
2 changes: 1 addition & 1 deletion lib/src/presentation/screen/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'package:flutter_japanese_restaurant_app/src/presentation/screen/food_lis
import 'package:flutter_japanese_restaurant_app/src/presentation/animation/page_transition.dart';

class HomeScreen extends HookWidget {
HomeScreen({Key? key}) : super(key: key);
HomeScreen({super.key});

final List<Widget> screen = [
const FoodListScreen(),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/presentation/screen/profile_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_japanese_restaurant_app/core/app_asset.dart';

class ProfileScreen extends StatelessWidget {
const ProfileScreen({Key? key}) : super(key: key);
const ProfileScreen({super.key});

@override
Widget build(BuildContext context) {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/presentation/widget/counter_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ class CounterButton extends StatelessWidget {
final double padding;

const CounterButton({
Key? key,
super.key,
required this.onIncrementSelected,
required this.onDecrementSelected,
required this.label,
this.padding = 10.0,
this.size = const Size(36, 36),
this.orientation = Axis.horizontal,
}) : super(key: key);
});

Widget button(Icon icon, Function() onTap) {
return RawMaterialButton(
Expand Down
4 changes: 2 additions & 2 deletions lib/src/presentation/widget/empty_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ class EmptyWidget extends StatelessWidget {
final Widget child;

const EmptyWidget({
Key? key,
super.key,
this.type = EmptyWidgetType.cart,
required this.title,
this.condition = false,
required this.child,
}) : super(key: key);
});

@override
Widget build(BuildContext context) {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/presentation/widget/food_list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import 'package:flutter_japanese_restaurant_app/src/business_logic/provider/them

class FoodListView extends StatelessWidget {
const FoodListView({
Key? key,
super.key,
required this.foods,
this.isReversedList = false,
}) : super(key: key);
});

final List<Food> foods;
final bool isReversedList;
Expand Down
16 changes: 16 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.20.3"
flutter_lints:
dependency: "direct dev"
description:
name: flutter_lints
sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7
url: "https://pub.dev"
source: hosted
version: "3.0.1"
flutter_rating_bar:
dependency: "direct main"
description:
Expand All @@ -107,6 +115,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "10.6.0"
lints:
dependency: transitive
description:
name: lints
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
url: "https://pub.dev"
source: hosted
version: "3.0.0"
matcher:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ dependencies:
provider: ^6.1.1

dev_dependencies:
flutter_lints: ^3.0.1
flutter_test:
sdk: flutter

Expand Down

0 comments on commit e2825dc

Please sign in to comment.