Skip to content

Commit

Permalink
redo top header
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas-Heiligenbrunner committed Dec 3, 2024
1 parent 14fcc3d commit 5889738
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 71 deletions.
88 changes: 74 additions & 14 deletions frontend/lib/components/dashboard/header.dart
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
import 'package:aurcache/components/dashboard/search_field.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:go_router/go_router.dart';
import '../../constants/color_constants.dart';
import '../../utils/responsive.dart';

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

@override
Widget build(BuildContext context) {
return Row(
children: [
if (!context.desktop)
if (context.mobile)
IconButton(
icon: const Icon(Icons.menu),
onPressed: () {
Scaffold.of(context).openDrawer();
},
),
if (!context.mobile)
if (context.desktop)
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
Expand All @@ -38,22 +36,84 @@ class Header extends StatelessWidget {
),
],
),
if (!context.mobile) Spacer(flex: context.desktop ? 2 : 1),
Expanded(child: SearchField()),
ElevatedButton.icon(
style: TextButton.styleFrom(
backgroundColor: darkgreenColor,
Spacer(flex: context.desktop ? 2 : 1),

if (context.desktop) ...[
KeyboardListener(
focusNode: FocusNode(),
onKeyEvent: (event) {
if (event.runtimeType == KeyDownEvent &&
event.logicalKey == LogicalKeyboardKey.enter) {
//context.push("/aur?query=${controller.text}");
}
},
child: SizedBox(
width: 350,
child: TextField(
//controller: controller,
decoration: InputDecoration(
hintText: "Search",
fillColor: secondaryColor,
filled: true,
border: const OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.all(Radius.circular(8)),
),
),
),
),
),
SizedBox(
width: 15,
),
OutlinedButton.icon(
style: OutlinedButton.styleFrom(
backgroundColor: bgColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)),
padding: EdgeInsets.symmetric(
horizontal: defaultPadding,
vertical: defaultPadding / (context.mobile ? 2 : 1),
),
),
onPressed: () {
// todo
// context.push("/aur");
},
icon: const Icon(
Icons.filter_list,
color: Colors.white54,
),
label: const Text(
"Filter",
style: TextStyle(color: Colors.white54),
),
),
SizedBox(
width: 15,
),
],
OutlinedButton.icon(
style: OutlinedButton.styleFrom(
backgroundColor: Color(0xff0059FF),
side: BorderSide(color: Color(0xff0059FF), width: 0),
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
padding: EdgeInsets.symmetric(
horizontal: defaultPadding * 1.5,
horizontal: defaultPadding,
vertical: defaultPadding / (context.mobile ? 2 : 1),
),
),
onPressed: () {
context.push("/aur");
},
icon: const Icon(Icons.add),
icon: const Icon(
Icons.add,
color: Colors.white,
),
label: const Text(
"Add New",
"Add Package",
style: TextStyle(color: Colors.white),
),
),
//ProfileCard()
Expand Down
4 changes: 2 additions & 2 deletions frontend/lib/components/dashboard/quick_info_banner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import '../../models/stats.dart';

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

final Stats stats;

Expand Down
55 changes: 0 additions & 55 deletions frontend/lib/components/dashboard/search_field.dart

This file was deleted.

0 comments on commit 5889738

Please sign in to comment.