fix product page.
This commit is contained in:
parent
552f962f4f
commit
39fd6383a9
|
|
@ -5,7 +5,6 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:proxibuy/presentation/providers/category/cubit/categories_children_cubit.dart';
|
import 'package:proxibuy/presentation/providers/category/cubit/categories_children_cubit.dart';
|
||||||
import 'package:proxibuy/presentation/providers/category/cubit/categories_cubit.dart';
|
import 'package:proxibuy/presentation/providers/category/cubit/categories_cubit.dart';
|
||||||
import 'package:proxibuy/presentation/providers/category/cubit/category_cubit.dart';
|
|
||||||
import 'package:proxibuy/presentation/providers/user_info_cubit.dart';
|
import 'package:proxibuy/presentation/providers/user_info_cubit.dart';
|
||||||
import 'package:proxibuy/presentation/ui/screens/auth/auth_page.dart';
|
import 'package:proxibuy/presentation/ui/screens/auth/auth_page.dart';
|
||||||
import 'package:proxibuy/presentation/ui/screens/home/screens/categories_screen.dart';
|
import 'package:proxibuy/presentation/ui/screens/home/screens/categories_screen.dart';
|
||||||
|
|
@ -13,8 +12,8 @@ import 'package:proxibuy/presentation/ui/screens/home/screens/explore_screen.dar
|
||||||
import 'package:proxibuy/presentation/ui/screens/home/home_page.dart';
|
import 'package:proxibuy/presentation/ui/screens/home/home_page.dart';
|
||||||
import 'package:proxibuy/presentation/ui/screens/home/screens/home_screen.dart';
|
import 'package:proxibuy/presentation/ui/screens/home/screens/home_screen.dart';
|
||||||
import 'package:proxibuy/presentation/ui/screens/home/screens/setting_screen.dart';
|
import 'package:proxibuy/presentation/ui/screens/home/screens/setting_screen.dart';
|
||||||
|
import 'package:proxibuy/presentation/ui/screens/product/product_page.dart';
|
||||||
import 'package:proxibuy/presentation/ui/theme/responsive.dart';
|
import 'package:proxibuy/presentation/ui/theme/responsive.dart';
|
||||||
import 'package:proxibuy/presentation/ui/widgets/navigations/drop_down_demo2.dart';
|
|
||||||
|
|
||||||
class AppRouter {
|
class AppRouter {
|
||||||
static final initial = '/';
|
static final initial = '/';
|
||||||
|
|
@ -87,7 +86,7 @@ class AppRouter {
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: product,
|
path: product,
|
||||||
builder: (BuildContext context, GoRouterState state) {
|
builder: (BuildContext context, GoRouterState state) {
|
||||||
return DropDownDemo3();
|
return ProductPage();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,11 @@
|
||||||
import 'package:bottom_navy_bar/bottom_navy_bar.dart';
|
import 'package:bottom_navy_bar/bottom_navy_bar.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:proxibuy/core/gen/assets.gen.dart';
|
import 'package:proxibuy/core/gen/assets.gen.dart';
|
||||||
import 'package:proxibuy/core/routes/app_router.dart';
|
import 'package:proxibuy/core/routes/app_router.dart';
|
||||||
import 'package:proxibuy/core/utils/empty_space.dart';
|
|
||||||
import 'package:proxibuy/data/models/screen_model.dart';
|
import 'package:proxibuy/data/models/screen_model.dart';
|
||||||
import 'package:proxibuy/presentation/providers/them_mode_cubit.dart';
|
|
||||||
import 'package:proxibuy/presentation/ui/screens/home/home_desk_page.dart';
|
import 'package:proxibuy/presentation/ui/screens/home/home_desk_page.dart';
|
||||||
import 'package:proxibuy/presentation/ui/theme/responsive.dart';
|
import 'package:proxibuy/presentation/ui/theme/responsive.dart';
|
||||||
import 'package:proxibuy/presentation/ui/theme/theme.dart';
|
|
||||||
import 'package:proxibuy/presentation/ui/widgets/navigations/categories_mega_menu.dart';
|
|
||||||
|
|
||||||
class HomePage extends StatefulWidget {
|
class HomePage extends StatefulWidget {
|
||||||
final Widget child;
|
final Widget child;
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,10 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
|
||||||
import 'package:proxibuy/core/utils/empty_space.dart';
|
import 'package:proxibuy/core/utils/empty_space.dart';
|
||||||
import 'package:proxibuy/presentation/providers/category/cubit/categories_children_cubit.dart';
|
import 'package:proxibuy/presentation/providers/category/cubit/categories_children_cubit.dart';
|
||||||
import 'package:proxibuy/presentation/providers/category/cubit/categories_cubit.dart';
|
import 'package:proxibuy/presentation/providers/category/cubit/categories_cubit.dart';
|
||||||
import 'package:proxibuy/presentation/ui/screens/home/screens/categories_screen.dart';
|
import 'package:proxibuy/presentation/ui/screens/home/screens/categories_screen.dart';
|
||||||
import 'package:proxibuy/presentation/ui/theme/colors.dart';
|
|
||||||
import 'package:proxibuy/presentation/ui/theme/theme.dart';
|
import 'package:proxibuy/presentation/ui/theme/theme.dart';
|
||||||
import 'package:proxibuy/presentation/ui/widgets/default_placeholder.dart';
|
|
||||||
|
|
||||||
class CategoriesMegaMenu extends StatefulWidget {
|
class CategoriesMegaMenu extends StatefulWidget {
|
||||||
const CategoriesMegaMenu({super.key});
|
const CategoriesMegaMenu({super.key});
|
||||||
|
|
|
||||||
|
|
@ -1,264 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:ll_dropdown_menu/ll_dropdown_menu.dart';
|
|
||||||
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
|
|
||||||
/// Wrapper AppBar for customizing default values
|
|
||||||
class WrapperAppBar extends AppBar {
|
|
||||||
static Widget? _defaultLeading;
|
|
||||||
static Widget? _defaultTitle;
|
|
||||||
static TextStyle? _defaultToolbarTextStyle;
|
|
||||||
static TextStyle? _defaultTitleTextStyle;
|
|
||||||
static double? _defaultToolbarHeight;
|
|
||||||
static SystemUiOverlayStyle? _defaultSystemOverlayStyle;
|
|
||||||
|
|
||||||
static void initConfig({
|
|
||||||
Widget? defaultLeading,
|
|
||||||
Widget? defaultTitle,
|
|
||||||
TextStyle? defaultToolbarTextStyle,
|
|
||||||
TextStyle? defaultTitleTextStyle,
|
|
||||||
double? defaultToolbarHeight,
|
|
||||||
SystemUiOverlayStyle? defaultSystemOverlayStyle,
|
|
||||||
}) {
|
|
||||||
_defaultLeading = defaultLeading;
|
|
||||||
_defaultTitle = defaultTitle;
|
|
||||||
_defaultToolbarTextStyle = defaultToolbarTextStyle;
|
|
||||||
_defaultTitleTextStyle = defaultTitleTextStyle;
|
|
||||||
_defaultToolbarHeight = defaultToolbarHeight;
|
|
||||||
_defaultSystemOverlayStyle = defaultSystemOverlayStyle;
|
|
||||||
}
|
|
||||||
|
|
||||||
WrapperAppBar({
|
|
||||||
super.key,
|
|
||||||
Widget? leading,
|
|
||||||
super.automaticallyImplyLeading,
|
|
||||||
Widget? title,
|
|
||||||
super.actions,
|
|
||||||
super.flexibleSpace,
|
|
||||||
super.bottom,
|
|
||||||
double super.elevation = 0,
|
|
||||||
super.scrolledUnderElevation,
|
|
||||||
super.notificationPredicate,
|
|
||||||
super.shadowColor,
|
|
||||||
super.surfaceTintColor,
|
|
||||||
super.shape,
|
|
||||||
Color super.backgroundColor = Colors.white,
|
|
||||||
super.foregroundColor,
|
|
||||||
super.iconTheme,
|
|
||||||
super.actionsIconTheme,
|
|
||||||
super.primary,
|
|
||||||
bool super.centerTitle = true,
|
|
||||||
super.excludeHeaderSemantics,
|
|
||||||
super.titleSpacing,
|
|
||||||
super.toolbarOpacity,
|
|
||||||
super.bottomOpacity,
|
|
||||||
double? toolbarHeight,
|
|
||||||
super.leadingWidth,
|
|
||||||
TextStyle? toolbarTextStyle,
|
|
||||||
TextStyle? titleTextStyle,
|
|
||||||
SystemUiOverlayStyle? systemOverlayStyle,
|
|
||||||
super.forceMaterialTransparency,
|
|
||||||
super.clipBehavior,
|
|
||||||
String? titleText,
|
|
||||||
}) : super(
|
|
||||||
leading:
|
|
||||||
leading ?? (automaticallyImplyLeading ? _defaultLeading : null),
|
|
||||||
title: title ??
|
|
||||||
_defaultTitle ??
|
|
||||||
Text(titleText ?? '', style: titleTextStyle),
|
|
||||||
toolbarHeight: toolbarHeight ?? _defaultToolbarHeight,
|
|
||||||
toolbarTextStyle: toolbarTextStyle ?? _defaultToolbarTextStyle,
|
|
||||||
titleTextStyle: titleTextStyle ??
|
|
||||||
_defaultTitleTextStyle ??
|
|
||||||
const TextStyle(color: Colors.black, fontSize: 18),
|
|
||||||
systemOverlayStyle: systemOverlayStyle ?? _defaultSystemOverlayStyle,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
class DropDownDemo3 extends StatefulWidget {
|
|
||||||
const DropDownDemo3({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<DropDownDemo3> createState() => _DropDownDemoState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _DropDownDemoState extends State<DropDownDemo3>
|
|
||||||
with SingleTickerProviderStateMixin {
|
|
||||||
final DropDownController dropDownController = DropDownController();
|
|
||||||
final DropDownCascadeListDataController dataController1 =
|
|
||||||
DropDownCascadeListDataController();
|
|
||||||
final DropDownCascadeListDataController dataController2 =
|
|
||||||
DropDownCascadeListDataController();
|
|
||||||
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey();
|
|
||||||
|
|
||||||
List<DropDownItem<List<DropDownItem>>> data1 = List.generate(
|
|
||||||
6,
|
|
||||||
(index) => DropDownItem<List<DropDownItem>>(
|
|
||||||
text: "Tab $index",
|
|
||||||
data: List.generate(
|
|
||||||
index + 2,
|
|
||||||
(index) => DropDownItem(
|
|
||||||
text: "Tab Second $index",
|
|
||||||
activeIcon: const Icon(Icons.check),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
List<DropDownItem<List<DropDownItem>>> data2 = List.generate(
|
|
||||||
6,
|
|
||||||
(index) => DropDownItem<List<DropDownItem>>(
|
|
||||||
text: "Tab $index",
|
|
||||||
data: List.generate(
|
|
||||||
index + 2,
|
|
||||||
(index) => DropDownItem(
|
|
||||||
text: "Tab Second $index",
|
|
||||||
activeIcon: const Icon(Icons.check),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
key: scaffoldKey,
|
|
||||||
appBar: WrapperAppBar(
|
|
||||||
titleText: "DropDownDemo Custom",
|
|
||||||
backgroundColor: Colors.white,
|
|
||||||
actions: const <Widget>[
|
|
||||||
SizedBox(),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
body: Column(children: [
|
|
||||||
DropDownHeader(
|
|
||||||
controller: dropDownController,
|
|
||||||
boxStyle: const DropDownBoxStyle(
|
|
||||||
height: 50,
|
|
||||||
backgroundColor: Colors.white,
|
|
||||||
margin: EdgeInsets.symmetric(horizontal: 10),
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
|
||||||
),
|
|
||||||
itemStyle: DropDownItemStyle(
|
|
||||||
activeIconColor: Colors.blue,
|
|
||||||
activeTextStyle: const TextStyle(color: Colors.blue),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.grey.shade100,
|
|
||||||
borderRadius: BorderRadius.circular(20),
|
|
||||||
),
|
|
||||||
activeDecoration: BoxDecoration(
|
|
||||||
color: Colors.grey.shade100,
|
|
||||||
borderRadius: BorderRadius.circular(20),
|
|
||||||
),
|
|
||||||
margin: const EdgeInsets.symmetric(vertical: 6, horizontal: 10),
|
|
||||||
alignment: Alignment.center,
|
|
||||||
highlightTextStyle: const TextStyle(color: Colors.white),
|
|
||||||
highlightDecoration: BoxDecoration(
|
|
||||||
color: Colors.black,
|
|
||||||
borderRadius: BorderRadius.circular(20),
|
|
||||||
),
|
|
||||||
highlightIcon: const Icon(
|
|
||||||
Icons.arrow_drop_down,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
items: List.generate(
|
|
||||||
3,
|
|
||||||
(index) => DropDownItem<Tab>(
|
|
||||||
text: index == 2 ? "Filter" : "Tab $index",
|
|
||||||
icon: index == 2
|
|
||||||
? const Icon(Icons.filter_alt)
|
|
||||||
: const Icon(Icons.arrow_drop_down),
|
|
||||||
activeIcon: index == 2
|
|
||||||
? const Icon(Icons.filter_alt)
|
|
||||||
: const Icon(Icons.arrow_drop_up),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onItemTap: (index, item) {
|
|
||||||
if (index == 2) {
|
|
||||||
dropDownController.hide();
|
|
||||||
scaffoldKey.currentState?.openEndDrawer();
|
|
||||||
} else {
|
|
||||||
dropDownController.toggle(index);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Stack(
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
color: Colors.blue[200],
|
|
||||||
child: Center(
|
|
||||||
child: TextButton(
|
|
||||||
onPressed: () {
|
|
||||||
dataController1.resetAllItemsStatus();
|
|
||||||
dataController2.resetAllItemsStatus();
|
|
||||||
for (int i = 0; i < 2; i++) {
|
|
||||||
dropDownController.hide(
|
|
||||||
index: i,
|
|
||||||
status: DropDownHeaderStatus(text: "Tab$i"),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: const Text("Reset"),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
DropDownView(
|
|
||||||
controller: dropDownController,
|
|
||||||
builders: [
|
|
||||||
DropDownCascadeList(
|
|
||||||
controller: dropDownController,
|
|
||||||
dataController: dataController1,
|
|
||||||
headerIndex: 0,
|
|
||||||
secondFloorItemStyle: const DropDownItemStyle(
|
|
||||||
backgroundColor: Colors.white,
|
|
||||||
activeBackgroundColor: Color(0xFFF5F5F5),
|
|
||||||
activeTextStyle:
|
|
||||||
TextStyle(fontSize: 14, color: Colors.blue),
|
|
||||||
activeIconColor: Colors.blue,
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
|
||||||
alignment: Alignment.centerLeft,
|
|
||||||
textExpand: true,
|
|
||||||
),
|
|
||||||
items: data1,
|
|
||||||
),
|
|
||||||
DropDownCascadeList(
|
|
||||||
controller: dropDownController,
|
|
||||||
dataController: dataController2,
|
|
||||||
headerIndex: 1,
|
|
||||||
secondFloorItemStyle: const DropDownItemStyle(
|
|
||||||
backgroundColor: Colors.white,
|
|
||||||
activeBackgroundColor: Color(0xFFF5F5F5),
|
|
||||||
activeTextStyle:
|
|
||||||
TextStyle(fontSize: 14, color: Colors.blue),
|
|
||||||
activeIconColor: Colors.blue,
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
|
||||||
alignment: Alignment.centerLeft,
|
|
||||||
textExpand: true,
|
|
||||||
),
|
|
||||||
items: data2,
|
|
||||||
maxMultiChoiceSize: 3,
|
|
||||||
),
|
|
||||||
DropDownViewWrapper(
|
|
||||||
width: MediaQuery.of(context).size.width,
|
|
||||||
height: 300,
|
|
||||||
child: Container(
|
|
||||||
color: Colors.yellow,
|
|
||||||
height: 300,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
dropDownController.dispose();
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class MyMegaMenu extends StatelessWidget {
|
|
||||||
const MyMegaMenu({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return SizedBox(
|
|
||||||
width: 300,
|
|
||||||
height: 120,
|
|
||||||
child: DropdownButton<String>(
|
|
||||||
value: 'Menu',
|
|
||||||
icon: Icon(Icons.av_timer),
|
|
||||||
iconSize: 24,
|
|
||||||
elevation: 16,
|
|
||||||
style: TextStyle(color: Colors.deepPurple),
|
|
||||||
underline: Container(
|
|
||||||
height: 2,
|
|
||||||
color: Colors.deepPurpleAccent,
|
|
||||||
),
|
|
||||||
onChanged: (newValue) {},
|
|
||||||
items: <String>['Menu', 'Home', 'Profile', 'Settings']
|
|
||||||
.map<DropdownMenuItem<String>>((String value) {
|
|
||||||
return DropdownMenuItem<String>(
|
|
||||||
value: value,
|
|
||||||
child: Text(value),
|
|
||||||
);
|
|
||||||
}).toList()
|
|
||||||
..add(DropdownMenuItem(
|
|
||||||
child: ExpansionTile(
|
|
||||||
title: Text('Menu'),
|
|
||||||
children: [
|
|
||||||
ListTile(
|
|
||||||
title: Text('Submenu 1'),
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
title: Text('Submenu 2'),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
))),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue