Skip to content

Commit

Permalink
Merge pull request #2 from deandreamatias/feature/home
Browse files Browse the repository at this point in the history
Feature/home
  • Loading branch information
deandreamatias authored Sep 8, 2023
2 parents 50cd595 + 0b87383 commit 407b49c
Show file tree
Hide file tree
Showing 65 changed files with 1,301 additions and 260 deletions.
6 changes: 3 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
Website for dog grooming services
Mimos Copyright (C) 2023 Matias de Andrea

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

<program> Copyright (C) <year> <name of author>
Mimos Copyright (C) 2023 Matias de Andrea
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
Expand Down
23 changes: 18 additions & 5 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
include: package:flutter_lints/flutter.yaml
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

analyzer:
exclude:
- fvm/
- lib/**/*.config.dart
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
rules:
Expand All @@ -20,6 +24,7 @@ linter:
- literal_only_boolean_expressions
- prefer_asserts_with_message
- prefer_null_aware_method_calls
- prefer_single_quotes
- require_trailing_commas
- secure_pubspec_urls
- sized_box_shrink_expand
Expand All @@ -37,3 +42,11 @@ linter:
- use_string_buffers
- use_super_parameters
- prefer_final_locals
analyzer:
exclude:
- fvm/
- lib/**/*.config.dart
- test/**/*.config.dart
- lib/generated_plugin_registrant.dart
- test/**/*.mocks.dart

Binary file removed assets/images/1.5x/splash.png
Binary file not shown.
Binary file removed assets/images/2.0x/splash.png
Binary file not shown.
Binary file removed assets/images/3.0x/splash.png
Binary file not shown.
Binary file removed assets/images/4.0x/light-4x.png
Binary file not shown.
Binary file removed assets/images/4.0x/splash.png
Binary file not shown.
1 change: 1 addition & 0 deletions assets/images/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/images/splash.png
Binary file not shown.
14 changes: 14 additions & 0 deletions assets/translations/en.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"coming_soon": "Coming soon",
"menu": {
"home": "home",
"about": "about",
"services": "services",
"gallery": "gallery"
},
"home": {
"slogan": "We take care of your pet. As if it were ours",
"appointment": "Make an appointment",
"semantic_logo": "Logo of pet grooming salon Mimos",
"contact_number": "123456798",
"contact_number_tooltip": "Open dialer and call to {}",
"whatsapp_tooltip": "Open whatsapp and send a message to {}"
},
"errors": {
"not_found": "No se ha encontrado el recurso",
"server": "Error en el servidor",
Expand Down
14 changes: 14 additions & 0 deletions assets/translations/es.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"coming_soon": "Próximamente",
"menu": {
"home": "inicio",
"about": "sobre",
"services": "servicios",
"gallery": "galería"
},
"home": {
"slogan": "La peluquería que mima a tus mascotas. Donde cuidamos a tu peludet",
"appointment": "Marca tu cita",
"semantic_logo": "Logo de la peluquería canina Mimos",
"contact_number": "123456798",
"contact_number_tooltip": "Abrir marcador y llamar a {}",
"whatsapp_tooltip": "Abrir WhatsApp y enviar mensaje a {}"
},
"errors": {
"not_found": "No se ha encontrado el recurso",
"server": "Error en el servidor",
Expand Down
14 changes: 14 additions & 0 deletions assets/translations/pt.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"coming_soon": "Em breve",
"menu": {
"home": "inicio",
"about": "sobre",
"services": "serviços",
"gallery": "galeria"
},
"home": {
"slogan": "La peluquería que mima a tus mascotas. Donde cuidamos a tu peludet",
"appointment": "Marque um horário",
"semantic_logo": "Logo da peluquería canina Mimos",
"contact_number": "123456798",
"contact_number_tooltip": "Abrir discador e ligar a {}",
"whatsapp_tooltip": "Abrir WhatsApp e enviar mensagem a {}"
},
"errors": {
"not_found": "No se ha encontrado el recurso",
"server": "Error en el servidor",
Expand Down
15 changes: 6 additions & 9 deletions lib/di/di.config.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/di/di.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ final getIt = GetIt.instance;
void configureDependencies({required String env}) =>
getIt.init(environment: env);

const dev = Environment("dev");
const prod = Environment("prod");
const dev = Environment('dev');
const prod = Environment('prod');

@module
abstract class DiModule {
Expand Down
1 change: 1 addition & 0 deletions lib/env/constants.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
class Constants {
static const String home = 'https://peluqueriacaninamimos.com/';
static const String phone = '+34666666666';
}
6 changes: 3 additions & 3 deletions lib/env/env.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ abstract class Env {

class EnvConfig implements Env {
@override
String get packageName => const String.fromEnvironment("PACKAGE_NAME");
String get packageName => const String.fromEnvironment('PACKAGE_NAME');

@override
String get urlRestService => const String.fromEnvironment("URL_REST_SERVICE");
String get urlRestService => const String.fromEnvironment('URL_REST_SERVICE');

@override
String get appName => const String.fromEnvironment("APP_NAME");
String get appName => const String.fromEnvironment('APP_NAME');
}
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'package:flutter/widgets.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart';

void main() async {
const String env = String.fromEnvironment("ENVIRONMENT");
const String env = String.fromEnvironment('ENVIRONMENT');
configureDependencies(env: env);

final widgetBindings = WidgetsFlutterBinding.ensureInitialized();
Expand Down
40 changes: 10 additions & 30 deletions lib/ui/navigation/main_navigator.dart
Original file line number Diff line number Diff line change
@@ -1,48 +1,28 @@
import 'package:dog_gromming_website/ui/navigation/menu_navigation.dart';
import 'package:dog_gromming_website/ui/navigation/routes.dart';
import 'package:dog_gromming_website/ui/widgets/screens/announcement/announcement_screen.dart';
import 'package:dog_gromming_website/ui/widgets/screens/home/home_screen.dart';
import 'package:dog_gromming_website/ui/widgets/screens/splash/splash_screen.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart';
import 'package:go_router/go_router.dart';

final GlobalKey<NavigatorState> rootNavigatorKey =
final GlobalKey<NavigatorState> _rootNavigatorKey =
GlobalKey<NavigatorState>(debugLabel: 'root');

class MainNavigator {
final GoRouter router = GoRouter(
navigatorKey: rootNavigatorKey,
initialLocation: Routes.splash,
navigatorKey: _rootNavigatorKey,
initialLocation: Routes.home,
redirect: (context, state) {
FlutterNativeSplash.remove();
return null;
},
routes: <RouteBase>[
GoRoute(
path: Routes.splash,
builder: (BuildContext context, GoRouterState state) =>
const SplashScreen(),
),
GoRoute(
path: Routes.home,
builder: (BuildContext context, GoRouterState state) => HomeScreen(),
),
GoRoute(
path: Routes.announcement,
builder: (BuildContext context, GoRouterState state) =>
const AnnouncementScreen(),
),
menuNavigation,
],
);

Future<void> navigateToSplash() {
return router.push(Routes.splash);
}

Future<void> navigateToHome() {
return router.push(Routes.home);
}

Future<void> navigateToAnnouncement() {
return router.push(Routes.announcement);
}

void pop() {
if (router.canPop()) router.pop();
}
}
48 changes: 48 additions & 0 deletions lib/ui/navigation/menu_navigation.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import 'package:dog_gromming_website/ui/navigation/routes.dart';
import 'package:dog_gromming_website/ui/widgets/screens/home/home_screen.dart';
import 'package:dog_gromming_website/ui/widgets/screens/scaffold_with_nav_bar.dart';
import 'package:flutter/widgets.dart';
import 'package:go_router/go_router.dart';

final GlobalKey<NavigatorState> _menuNavigatorKey =
GlobalKey<NavigatorState>(debugLabel: 'menu');

final menuNavigation = ShellRoute(
navigatorKey: _menuNavigatorKey,
builder: (BuildContext context, GoRouterState state, Widget child) {
return ScaffoldWithNavBar(child: child);
},
routes: <RouteBase>[
GoRoute(
path: Routes.home,
builder: (BuildContext context, GoRouterState state) {
return const HomeScreen();
},
),
GoRoute(
path: Routes.services,
builder: (BuildContext context, GoRouterState state) {
return const Text('Services');
},
),
GoRoute(
path: Routes.gallery,
builder: (BuildContext context, GoRouterState state) {
return const Text('Gallery');
},
),
GoRoute(
path: Routes.about,
builder: (BuildContext context, GoRouterState state) {
return const Text('about');
},
),
],
);

enum MenuNavigation {
home,
services,
gallery,
about,
}
21 changes: 20 additions & 1 deletion lib/ui/navigation/routes.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
import 'package:dog_gromming_website/ui/navigation/menu_navigation.dart';

class Routes {
static const String splash = '/';
static const String home = '/home';
static const String announcement = '/announcement';
static const String services = '/services';
static const String about = '/about';
static const String gallery = '/gallery';
}

extension MenuRoutes on MenuNavigation {
String get route {
switch (this) {
case MenuNavigation.home:
return Routes.home;
case MenuNavigation.services:
return Routes.services;
case MenuNavigation.gallery:
return Routes.gallery;
case MenuNavigation.about:
return Routes.about;
}
}
}
12 changes: 12 additions & 0 deletions lib/ui/styles/box_shadows.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'package:dog_gromming_website/ui/styles/app_colors.dart';
import 'package:flutter/cupertino.dart';

class BoxShadows {
static final List<BoxShadow> bs1 = [
BoxShadow(
color: AppColors.black.withOpacity(0.12),
blurRadius: 12,
offset: const Offset(2, 2),
),
];
}
19 changes: 11 additions & 8 deletions lib/ui/styles/sizes.dart
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
enum Sizes {
small,
medium,
large,
extraLarge,
xs,
s,
m,
l,
xl,
}

extension ResponsiveSizes on Sizes {
double get width {
switch (this) {
case Sizes.small:
case Sizes.xs:
return 320;
case Sizes.medium:
case Sizes.s:
return 768;
case Sizes.large:
case Sizes.m:
return 1024;
case Sizes.extraLarge:
case Sizes.l:
return 1440;
case Sizes.xl:
return 1920;
default:
return 0;
}
Expand Down
11 changes: 11 additions & 0 deletions lib/ui/styles/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ import 'package:flutter/material.dart';
final themeData = ThemeData(
colorSchemeSeed: AppColors.primary,
scaffoldBackgroundColor: AppColors.white,
elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(AppColors.secondary),
textStyle: MaterialStateProperty.all(TextStyles.labelLarge),
shape: MaterialStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(56),
),
),
),
),
textTheme: const TextTheme(
labelLarge: TextStyles.labelLarge,
labelMedium: TextStyles.labelMedium,
Expand Down
Loading

0 comments on commit 407b49c

Please sign in to comment.