refactor : base page
This commit is contained in:
@@ -23,6 +23,7 @@ RAppBar chickenAppBar({
|
||||
hasNews: hasNews,
|
||||
isBase: isBase,
|
||||
backId: backId,
|
||||
hasFilter: hasFilter,
|
||||
onSearchTap: onSearchTap,
|
||||
onBackTap: onBackTap,
|
||||
onNotificationTap: onNotificationTap,
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
BackGroundWidget chickenBackground() {
|
||||
return BackGroundWidget(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(1.00, 0.01),
|
||||
end: Alignment(0.04, 0.99),
|
||||
colors: [
|
||||
const Color(0xFFD6DCEF).withValues(alpha: .8),
|
||||
const Color(0xFFD6E6E9).withValues(alpha: .8),
|
||||
const Color(0xFFD6E4E3).withValues(alpha: .8),
|
||||
],
|
||||
),
|
||||
vecPath: Assets.vec.chickenPatternSvg.path,
|
||||
);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/app_bar.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/back_ground.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class ChickenBasePage extends GetView<BaseLogic> {
|
||||
@@ -25,8 +26,8 @@ class ChickenBasePage extends GetView<BaseLogic> {
|
||||
this.scrollable = false,
|
||||
this.floatingActionButtonLocation,
|
||||
this.floatingActionButton,
|
||||
|
||||
this.filteringWidget,
|
||||
this.backGroundWidget,
|
||||
}) : assert(
|
||||
(routes != null) || routesWidget != null,
|
||||
'Either routes or routesWidget must be provided.',
|
||||
@@ -58,6 +59,8 @@ class ChickenBasePage extends GetView<BaseLogic> {
|
||||
final Widget? filteringWidget;
|
||||
final void Function(String?)? onSearchChanged;
|
||||
|
||||
final BackGroundWidget? backGroundWidget;
|
||||
|
||||
void _onFilterTap() {
|
||||
if (hasFilter && filteringWidget != null) {
|
||||
final currentRoute = ModalRoute.of(Get.context!);
|
||||
@@ -82,6 +85,7 @@ class ChickenBasePage extends GetView<BaseLogic> {
|
||||
scrollable: scrollable,
|
||||
floatingActionButtonLocation: floatingActionButtonLocation,
|
||||
floatingActionButton: floatingActionButton,
|
||||
backGroundWidget: backGroundWidget ?? chickenBackground(),
|
||||
appBar: chickenAppBar(
|
||||
isBase: isBase,
|
||||
hasBack: isBase ? false : hasBack,
|
||||
|
||||
Reference in New Issue
Block a user