add frontend and put backend in seperate folder
This commit is contained in:
		
							
								
								
									
										22
									
								
								frontend/lib/core/constants/color_constants.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								frontend/lib/core/constants/color_constants.dart
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
 | 
			
		||||
const primaryColor = Color(0xFF2697FF);
 | 
			
		||||
//const secondaryColor = Color(0xFF2A2D3E);
 | 
			
		||||
//const bgColor = Color(0xFF212132);
 | 
			
		||||
 | 
			
		||||
const secondaryColor = Color(0xFF292929);
 | 
			
		||||
const bgColor = Color(0xFF212121);
 | 
			
		||||
const darkgreenColor = Color(0xFF2c614f);
 | 
			
		||||
const greenColor = Color(0xFF6bab58);
 | 
			
		||||
 | 
			
		||||
const defaultPadding = 16.0;
 | 
			
		||||
const double defaultBorderRadius = 15;
 | 
			
		||||
 | 
			
		||||
class ColorConstants {
 | 
			
		||||
  static Color blue = Color(0xFF0D46BB);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class Palette {
 | 
			
		||||
  static const Color background = Color(0xFFEDEEF2);
 | 
			
		||||
  static const Color wrapperBg = Color(0xFF212121);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										22
									
								
								frontend/lib/core/utils/colorful_tag.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								frontend/lib/core/utils/colorful_tag.dart
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
import 'dart:ui';
 | 
			
		||||
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
 | 
			
		||||
Color getRoleColor(String? role) {
 | 
			
		||||
  if (role == "Doctor") {
 | 
			
		||||
    return Colors.green;
 | 
			
		||||
  } else if (role == "Software Architect") {
 | 
			
		||||
    return Colors.red;
 | 
			
		||||
  } else if (role == "Software Engineer") {
 | 
			
		||||
    return Colors.blueAccent;
 | 
			
		||||
  } else if (role == "Solution Architect") {
 | 
			
		||||
    return Colors.amberAccent;
 | 
			
		||||
  } else if (role == "Project Manager") {
 | 
			
		||||
    return Colors.cyanAccent;
 | 
			
		||||
  } else if (role == "Business Analyst") {
 | 
			
		||||
    return Colors.deepPurpleAccent;
 | 
			
		||||
  } else if (role == "UI/UX Designer") {
 | 
			
		||||
    return Colors.indigoAccent;
 | 
			
		||||
  }
 | 
			
		||||
  return Colors.black38;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										63
									
								
								frontend/lib/core/widgets/app_button_widget.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								frontend/lib/core/widgets/app_button_widget.dart
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,63 @@
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
 | 
			
		||||
enum ButtonType { PRIMARY, PLAIN }
 | 
			
		||||
 | 
			
		||||
class AppButton extends StatelessWidget {
 | 
			
		||||
  final ButtonType? type;
 | 
			
		||||
  final VoidCallback? onPressed;
 | 
			
		||||
  final String? text;
 | 
			
		||||
 | 
			
		||||
  AppButton({this.type, this.onPressed, this.text});
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    return InkWell(
 | 
			
		||||
      onTap: this.onPressed,
 | 
			
		||||
      child: Container(
 | 
			
		||||
        width: double.infinity,
 | 
			
		||||
        height: 45,
 | 
			
		||||
        decoration: BoxDecoration(
 | 
			
		||||
          color: getButtonColor(context, type!),
 | 
			
		||||
          borderRadius: BorderRadius.circular(4.0),
 | 
			
		||||
          boxShadow: [
 | 
			
		||||
            BoxShadow(
 | 
			
		||||
                //color: Color.fromRGBO(169, 176, 185, 0.42),
 | 
			
		||||
                //spreadRadius: 0,
 | 
			
		||||
                //blurRadius: 3.0,
 | 
			
		||||
                //offset: Offset(0, 2),
 | 
			
		||||
                )
 | 
			
		||||
          ],
 | 
			
		||||
        ),
 | 
			
		||||
        child: Center(
 | 
			
		||||
          child: Text(this.text!,
 | 
			
		||||
              style: Theme.of(context)
 | 
			
		||||
                  .textTheme
 | 
			
		||||
                  .subtitle1!
 | 
			
		||||
                  .copyWith(color: getTextColor(context, type!))),
 | 
			
		||||
        ),
 | 
			
		||||
      ),
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Color getButtonColor(context, ButtonType type) {
 | 
			
		||||
  switch (type) {
 | 
			
		||||
    case ButtonType.PRIMARY:
 | 
			
		||||
      return Theme.of(context).buttonTheme.colorScheme!.background;
 | 
			
		||||
    case ButtonType.PLAIN:
 | 
			
		||||
      return Colors.white;
 | 
			
		||||
    default:
 | 
			
		||||
      return Theme.of(context).primaryColor;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Color getTextColor(context, ButtonType type) {
 | 
			
		||||
  switch (type) {
 | 
			
		||||
    case ButtonType.PLAIN:
 | 
			
		||||
      return Theme.of(context).primaryColor;
 | 
			
		||||
    case ButtonType.PRIMARY:
 | 
			
		||||
      return Colors.white;
 | 
			
		||||
    default:
 | 
			
		||||
      return Theme.of(context).buttonTheme.colorScheme!.background;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										94
									
								
								frontend/lib/core/widgets/input_widget.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										94
									
								
								frontend/lib/core/widgets/input_widget.dart
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,94 @@
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
 | 
			
		||||
import '../constants/color_constants.dart';
 | 
			
		||||
 | 
			
		||||
class InputWidget extends StatelessWidget {
 | 
			
		||||
  final String? hintText;
 | 
			
		||||
  final String? errorText;
 | 
			
		||||
  final Widget? prefixIcon;
 | 
			
		||||
  final double? height;
 | 
			
		||||
  final String? topLabel;
 | 
			
		||||
  final bool? obscureText;
 | 
			
		||||
  final FormFieldSetter<String>? onSaved;
 | 
			
		||||
  final ValueChanged<String>? onChanged;
 | 
			
		||||
  final FormFieldValidator<String>? validator;
 | 
			
		||||
  final TextInputType? keyboardType;
 | 
			
		||||
  final Key? kKey;
 | 
			
		||||
  final TextEditingController? kController;
 | 
			
		||||
  final String? kInitialValue;
 | 
			
		||||
 | 
			
		||||
  InputWidget({
 | 
			
		||||
    this.hintText,
 | 
			
		||||
    this.prefixIcon,
 | 
			
		||||
    this.height = 48.0,
 | 
			
		||||
    this.topLabel = "",
 | 
			
		||||
    this.obscureText = false,
 | 
			
		||||
    required this.onSaved,
 | 
			
		||||
    this.keyboardType,
 | 
			
		||||
    this.errorText,
 | 
			
		||||
    this.onChanged,
 | 
			
		||||
    this.validator,
 | 
			
		||||
    this.kKey,
 | 
			
		||||
    this.kController,
 | 
			
		||||
    this.kInitialValue,
 | 
			
		||||
  });
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    return Column(
 | 
			
		||||
      crossAxisAlignment: CrossAxisAlignment.start,
 | 
			
		||||
      children: [
 | 
			
		||||
        Text(this.topLabel!),
 | 
			
		||||
        SizedBox(height: 4.0),
 | 
			
		||||
        Container(
 | 
			
		||||
          height: 50,
 | 
			
		||||
          decoration: BoxDecoration(
 | 
			
		||||
            color: secondaryColor,
 | 
			
		||||
            //color: Theme.of(context).buttonColor,
 | 
			
		||||
            borderRadius: BorderRadius.circular(4.0),
 | 
			
		||||
          ),
 | 
			
		||||
          child: TextFormField(
 | 
			
		||||
            initialValue: this.kInitialValue,
 | 
			
		||||
            controller: this.kController,
 | 
			
		||||
            key: this.kKey,
 | 
			
		||||
            keyboardType: this.keyboardType,
 | 
			
		||||
            onSaved: this.onSaved,
 | 
			
		||||
            onChanged: this.onChanged,
 | 
			
		||||
            validator: this.validator,
 | 
			
		||||
            obscureText: this.obscureText!,
 | 
			
		||||
            decoration: InputDecoration(
 | 
			
		||||
                prefixIcon: this.prefixIcon,
 | 
			
		||||
                enabledBorder: OutlineInputBorder(
 | 
			
		||||
                  borderSide: BorderSide(
 | 
			
		||||
                    color: Color.fromRGBO(74, 77, 84, 0.2),
 | 
			
		||||
                  ),
 | 
			
		||||
                ),
 | 
			
		||||
                focusedBorder: OutlineInputBorder(
 | 
			
		||||
                  //gapPadding: 16,
 | 
			
		||||
                  borderSide: BorderSide(
 | 
			
		||||
                    color: Theme.of(context).primaryColor,
 | 
			
		||||
                  ),
 | 
			
		||||
                ),
 | 
			
		||||
                errorStyle: TextStyle(height: 0, color: Colors.transparent),
 | 
			
		||||
                errorBorder: OutlineInputBorder(
 | 
			
		||||
                  borderSide: BorderSide(
 | 
			
		||||
                    color: Theme.of(context).errorColor,
 | 
			
		||||
                  ),
 | 
			
		||||
                ),
 | 
			
		||||
                focusedErrorBorder: OutlineInputBorder(
 | 
			
		||||
                  //gapPaddings: 16,
 | 
			
		||||
                  borderSide: BorderSide(
 | 
			
		||||
                    color: Theme.of(context).errorColor,
 | 
			
		||||
                  ),
 | 
			
		||||
                ),
 | 
			
		||||
                hintText: this.hintText,
 | 
			
		||||
                hintStyle: Theme.of(context)
 | 
			
		||||
                    .textTheme
 | 
			
		||||
                    .bodyText1!
 | 
			
		||||
                    .copyWith(color: Colors.white54),
 | 
			
		||||
                errorText: this.errorText),
 | 
			
		||||
          ),
 | 
			
		||||
        )
 | 
			
		||||
      ],
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										34
									
								
								frontend/lib/core/widgets/wrapper.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								frontend/lib/core/widgets/wrapper.dart
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,34 @@
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
 | 
			
		||||
import '../constants/color_constants.dart';
 | 
			
		||||
 | 
			
		||||
class Wrapper extends StatelessWidget {
 | 
			
		||||
  final Widget? title;
 | 
			
		||||
  final Widget child;
 | 
			
		||||
 | 
			
		||||
  const Wrapper({Key? key, this.title, required this.child}) : super(key: key);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    return Container(
 | 
			
		||||
      padding: const EdgeInsets.all(defaultPadding),
 | 
			
		||||
      decoration: BoxDecoration(
 | 
			
		||||
        color: Palette.wrapperBg,
 | 
			
		||||
        borderRadius: BorderRadius.circular(defaultBorderRadius),
 | 
			
		||||
      ),
 | 
			
		||||
      child: Column(
 | 
			
		||||
        crossAxisAlignment: CrossAxisAlignment.start,
 | 
			
		||||
        children: [
 | 
			
		||||
          if (title != null)
 | 
			
		||||
            Column(
 | 
			
		||||
              children: [
 | 
			
		||||
                title!,
 | 
			
		||||
                const SizedBox(height: defaultPadding),
 | 
			
		||||
              ],
 | 
			
		||||
            ),
 | 
			
		||||
          child
 | 
			
		||||
        ],
 | 
			
		||||
      ),
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user