diff --git a/mobile/assets/boykisser.png b/mobile/assets/boykisser.png new file mode 100644 index 0000000..63967cc Binary files /dev/null and b/mobile/assets/boykisser.png differ diff --git a/mobile/lib/dashboard.dart b/mobile/lib/dashboard.dart index 04cc13f..3398ef6 100644 --- a/mobile/lib/dashboard.dart +++ b/mobile/lib/dashboard.dart @@ -1,19 +1,98 @@ import 'package:flutter/material.dart'; import 'global_components.dart'; +class ProductListItem extends StatelessWidget { + final String name; + final int price; + final String imagePath; + const ProductListItem( + {super.key, + required this.name, + required this.price, + required this.imagePath}); + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.all(10), + height: 100, + decoration: BoxDecoration( + color: Color(0xFFFFFFFF), + border: Border.all(), + borderRadius: BorderRadius.all(Radius.circular(10))), + child: ElevatedButton( + style: ButtonStyle( + backgroundColor: WidgetStateProperty.all(Colors.transparent), + elevation: WidgetStateProperty.all(0), + shape: WidgetStateProperty.all(RoundedRectangleBorder()), + padding: WidgetStateProperty.all(EdgeInsets.zero), + splashFactory: NoSplash.splashFactory), + onPressed: () {}, + child: Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + padding: EdgeInsets.fromLTRB(10, 10, 0, 10), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + name, + style: TextStyle(fontSize: 24, color: Colors.black), + ), + Text( + "${price.toString()} kr", + style: TextStyle(fontSize: 16, color: Colors.black), + ) + ], + )), + ClipRRect( + borderRadius: BorderRadius.only( + topRight: Radius.circular(10), + bottomRight: Radius.circular(10)), + child: + Image(image: AssetImage(imagePath), fit: BoxFit.contain)) + ], + ))), + ); + } +} + class Dashboard extends StatelessWidget { const Dashboard({super.key}); @override Widget build(BuildContext context) { - return const Scaffold( - body: Row(mainAxisAlignment: MainAxisAlignment.center, children: [ - Column(mainAxisAlignment: MainAxisAlignment.center, children: [ - Text( - "Not implemented", - style: TextStyle(fontSize: 32), - ) - ]) - ])); + return Scaffold( + body: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Column(children: [ + TextField( + decoration: InputDecoration( + label: Text("Search"), + contentPadding: EdgeInsets.only(top: 20))), + Expanded( + child: ListView( + children: [ + ProductListItem( + name: "idk", + price: 12, + imagePath: "assets/boykisser.png", + ), + ProductListItem( + name: "idk", + price: 12, + imagePath: "assets/boykisser.png", + ), + ], + ), + ) + ]), + ), + ], + )); } } diff --git a/mobile/lib/global_components.dart b/mobile/lib/global_components.dart index f8debba..2652f76 100644 --- a/mobile/lib/global_components.dart +++ b/mobile/lib/global_components.dart @@ -4,8 +4,11 @@ class PrimaryButton extends StatelessWidget { final void Function()? onPressed; final Widget child; - const PrimaryButton( - {super.key, required this.onPressed, required this.child}); + const PrimaryButton({ + super.key, + required this.onPressed, + required this.child, + }); @override Widget build(BuildContext context) { @@ -22,14 +25,15 @@ class PrimaryInput extends StatelessWidget { final double height; final String label; final String placeholderText; + final bool obscure; const PrimaryInput( {super.key, this.width = 300, this.height = 100, + this.obscure = false, required this.label, required this.placeholderText}); - @override Widget build(BuildContext context) { return SizedBox( @@ -40,6 +44,7 @@ class PrimaryInput extends StatelessWidget { border: const OutlineInputBorder(), label: Text(label), hintText: placeholderText), + obscureText: obscure, )); } } diff --git a/mobile/lib/log_in_page.dart b/mobile/lib/log_in_page.dart index 354e8bd..88b1cb6 100644 --- a/mobile/lib/log_in_page.dart +++ b/mobile/lib/log_in_page.dart @@ -18,7 +18,8 @@ class LogInPage extends StatelessWidget { ), const PrimaryInput( label: "Mail/Tlf", placeholderText: "f.eks. example@example.com"), - const PrimaryInput(label: "Password", placeholderText: "*********"), + const PrimaryInput( + label: "Password", placeholderText: "*********", obscure: true), PrimaryButton( onPressed: () => { Navigator.of(context).push(MaterialPageRoute( diff --git a/mobile/lib/main.dart b/mobile/lib/main.dart index a4ef6d1..286baf3 100644 --- a/mobile/lib/main.dart +++ b/mobile/lib/main.dart @@ -14,6 +14,7 @@ class MyApp extends StatelessWidget { title: 'Fresh Plaza', theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue), + scaffoldBackgroundColor: const Color(0xECF6F0FF), useMaterial3: true, ), home: const MyHomePage(title: 'Fresh Plaza'), diff --git a/mobile/lib/register_page.dart b/mobile/lib/register_page.dart index 6aaaef8..c06e2a4 100644 --- a/mobile/lib/register_page.dart +++ b/mobile/lib/register_page.dart @@ -19,9 +19,12 @@ class RegisterPage extends StatelessWidget { const PrimaryInput(label: "Fornavn", placeholderText: "Fornavn"), const PrimaryInput( label: "Mail/Tlf", placeholderText: "f.eks. example@example.com"), - const PrimaryInput(label: "Password", placeholderText: "*********"), const PrimaryInput( - label: "Password (igen)", placeholderText: "*********"), + label: "Password", placeholderText: "*********", obscure: true), + const PrimaryInput( + label: "Password (igen)", + placeholderText: "*********", + obscure: true), PrimaryButton( onPressed: () => { Navigator.of(context).push(MaterialPageRoute( diff --git a/mobile/pubspec.yaml b/mobile/pubspec.yaml index a26d816..0653022 100644 --- a/mobile/pubspec.yaml +++ b/mobile/pubspec.yaml @@ -51,7 +51,8 @@ dev_dependencies: # The following section is specific to Flutter packages. flutter: - + assets: + - assets/ # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class.