-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add saving data to db
- Loading branch information
Showing
31 changed files
with
643 additions
and
864 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import 'package:syncfusion_flutter_sliders/sliders.dart'; | ||
|
||
extension CustomSfRangeValues on SfRangeValues { | ||
bool get isInitial => start == 0 && end == 1000; | ||
bool isContains(int other) { | ||
// TODO: change end and start typing | ||
final typedStart = | ||
double == start.runtimeType ? (start as double).toInt() : start as int; | ||
final typedEnd = | ||
double == end.runtimeType ? (end as double).toInt() : end as int; | ||
|
||
return typedStart <= other && other <= typedEnd; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
import 'package:shop/src/feature/shop/model/shop/shop.dart'; | ||
import 'package:syncfusion_flutter_sliders/sliders.dart'; | ||
|
||
part 'shop_data.freezed.dart'; | ||
|
||
@freezed | ||
class ShopData with _$ShopData { | ||
factory ShopData({ | ||
required List<Shop> shops, | ||
required String query, | ||
required SfRangeValues weightValues, | ||
required SfRangeValues priceValues, | ||
}) = _ShopData; | ||
|
||
factory ShopData.initial() => ShopData(shops: []); | ||
factory ShopData.initial() => ShopData( | ||
query: '', | ||
shops: [], | ||
weightValues: const SfRangeValues(0, 1000), | ||
priceValues: const SfRangeValues(0, 1000), | ||
); | ||
} |
Oops, something went wrong.