Skip to content

Commit

Permalink
Merge branch 'main' into 62-créer-test-api
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelson-Jnrnd authored Aug 30, 2022
2 parents 4dda3e5 + b111320 commit f238dd8
Show file tree
Hide file tree
Showing 17 changed files with 598 additions and 87 deletions.
Binary file added assets/images/default_user_pic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import 'package:cloud_firestore/cloud_firestore.dart';

import 'dart:developer';

import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:pdg_app/model/message.dart';
Expand All @@ -19,6 +22,7 @@ void main() async {

final m1 = Message(id: '', fromId: 'alice', toId: 'bob', content: "HELLOW");
msg.createMessage(m1);
log("test");
runApp(MyApp());
}

Expand Down
30 changes: 23 additions & 7 deletions lib/router/router.dart
Original file line number Diff line number Diff line change
@@ -1,21 +1,37 @@
import 'package:auto_route/auto_route.dart';
import 'package:pdg_app/screens/chat.dart';
import 'package:pdg_app/screens/home.dart';
import 'package:pdg_app/screens/diary.dart';
import 'package:pdg_app/screens/login.dart';
import 'package:pdg_app/screens/profile.dart';
import 'package:pdg_app/screens/register.dart';

import '../screens/home.dart';

@MaterialAutoRouter(
// replaceInRouteName: 'Page,Route',
routes: <AutoRoute>[
AutoRoute(
path: '/home',
page: HomeScreen,
children: [],
),
AutoRoute(
page: ChatScreen,
path: '/chat',
initial: true,
children: [
RedirectRoute(
path: '',
redirectTo: 'diary',
),
AutoRoute(
page: ChatScreen,
path: 'chat',
),
AutoRoute(
page: DiaryScreen,
path: 'diary',
),
AutoRoute(
page: ProfileScreen,
path: 'my',
)
],
),
AutoRoute(
page: LoginScreen,
Expand All @@ -27,7 +43,7 @@ import 'package:pdg_app/screens/register.dart';
),
RedirectRoute(
path: '*',
redirectTo: '/home',
redirectTo: '/home/diary',
),
],
)
Expand Down
118 changes: 78 additions & 40 deletions lib/router/router.gr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,80 +11,118 @@
// ignore_for_file: type=lint

// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:auto_route/auto_route.dart' as _i5;
import 'package:flutter/material.dart' as _i6;
import 'package:auto_route/auto_route.dart' as _i7;
import 'package:flutter/material.dart' as _i8;

import '../screens/chat.dart' as _i2;
import '../screens/chat.dart' as _i4;
import '../screens/diary.dart' as _i5;
import '../screens/home.dart' as _i1;
import '../screens/login.dart' as _i3;
import '../screens/register.dart' as _i4;
import '../screens/login.dart' as _i2;
import '../screens/profile.dart' as _i6;
import '../screens/register.dart' as _i3;

class AppRouter extends _i5.RootStackRouter {
AppRouter([_i6.GlobalKey<_i6.NavigatorState>? navigatorKey])
class AppRouter extends _i7.RootStackRouter {
AppRouter([_i8.GlobalKey<_i8.NavigatorState>? navigatorKey])
: super(navigatorKey);

@override
final Map<String, _i5.PageFactory> pagesMap = {
final Map<String, _i7.PageFactory> pagesMap = {
HomeScreenRoute.name: (routeData) {
return _i5.MaterialPageX<dynamic>(
return _i7.MaterialPageX<dynamic>(
routeData: routeData, child: const _i1.HomeScreen());
},
ChatScreenRoute.name: (routeData) {
return _i5.MaterialPageX<dynamic>(
routeData: routeData, child: const _i2.ChatScreen());
},
LoginScreenRoute.name: (routeData) {
return _i5.MaterialPageX<dynamic>(
routeData: routeData, child: const _i3.LoginScreen());
return _i7.MaterialPageX<dynamic>(
routeData: routeData, child: const _i2.LoginScreen());
},
RegisterScreenRoute.name: (routeData) {
return _i5.MaterialPageX<dynamic>(
routeData: routeData, child: const _i4.RegisterScreen());
return _i7.MaterialPageX<dynamic>(
routeData: routeData, child: const _i3.RegisterScreen());
},
ChatScreenRoute.name: (routeData) {
return _i7.MaterialPageX<dynamic>(
routeData: routeData, child: const _i4.ChatScreen());
},
DiaryScreenRoute.name: (routeData) {
return _i7.MaterialPageX<dynamic>(
routeData: routeData, child: const _i5.DiaryScreen());
},
ProfileScreenRoute.name: (routeData) {
return _i7.MaterialPageX<dynamic>(
routeData: routeData, child: const _i6.ProfileScreen());
}
};

@override
List<_i5.RouteConfig> get routes => [
_i5.RouteConfig('/#redirect',
path: '/', redirectTo: '/chat', fullMatch: true),
_i5.RouteConfig(HomeScreenRoute.name, path: '/home'),
_i5.RouteConfig(ChatScreenRoute.name, path: '/chat'),
_i5.RouteConfig(LoginScreenRoute.name, path: '/login'),
_i5.RouteConfig(RegisterScreenRoute.name, path: '/register'),
_i5.RouteConfig('*#redirect',
path: '*', redirectTo: '/home', fullMatch: true)
List<_i7.RouteConfig> get routes => [
_i7.RouteConfig('/#redirect',
path: '/', redirectTo: '/home', fullMatch: true),
_i7.RouteConfig(HomeScreenRoute.name, path: '/home', children: [
_i7.RouteConfig('#redirect',
path: '',
parent: HomeScreenRoute.name,
redirectTo: 'diary',
fullMatch: true),
_i7.RouteConfig(ChatScreenRoute.name,
path: 'chat', parent: HomeScreenRoute.name),
_i7.RouteConfig(DiaryScreenRoute.name,
path: 'diary', parent: HomeScreenRoute.name),
_i7.RouteConfig(ProfileScreenRoute.name,
path: 'my', parent: HomeScreenRoute.name)
]),
_i7.RouteConfig(LoginScreenRoute.name, path: '/login'),
_i7.RouteConfig(RegisterScreenRoute.name, path: '/register'),
_i7.RouteConfig('*#redirect',
path: '*', redirectTo: '/home/diary', fullMatch: true)
];
}

/// generated route for
/// [_i1.HomeScreen]
class HomeScreenRoute extends _i5.PageRouteInfo<void> {
const HomeScreenRoute() : super(HomeScreenRoute.name, path: '/home');
class HomeScreenRoute extends _i7.PageRouteInfo<void> {
const HomeScreenRoute({List<_i7.PageRouteInfo>? children})
: super(HomeScreenRoute.name, path: '/home', initialChildren: children);

static const String name = 'HomeScreenRoute';
}

/// generated route for
/// [_i2.ChatScreen]
class ChatScreenRoute extends _i5.PageRouteInfo<void> {
const ChatScreenRoute() : super(ChatScreenRoute.name, path: '/chat');

static const String name = 'ChatScreenRoute';
}

/// generated route for
/// [_i3.LoginScreen]
class LoginScreenRoute extends _i5.PageRouteInfo<void> {
/// [_i2.LoginScreen]
class LoginScreenRoute extends _i7.PageRouteInfo<void> {
const LoginScreenRoute() : super(LoginScreenRoute.name, path: '/login');

static const String name = 'LoginScreenRoute';
}

/// generated route for
/// [_i4.RegisterScreen]
class RegisterScreenRoute extends _i5.PageRouteInfo<void> {
/// [_i3.RegisterScreen]
class RegisterScreenRoute extends _i7.PageRouteInfo<void> {
const RegisterScreenRoute()
: super(RegisterScreenRoute.name, path: '/register');

static const String name = 'RegisterScreenRoute';
}

/// generated route for
/// [_i4.ChatScreen]
class ChatScreenRoute extends _i7.PageRouteInfo<void> {
const ChatScreenRoute() : super(ChatScreenRoute.name, path: 'chat');

static const String name = 'ChatScreenRoute';
}

/// generated route for
/// [_i5.DiaryScreen]
class DiaryScreenRoute extends _i7.PageRouteInfo<void> {
const DiaryScreenRoute() : super(DiaryScreenRoute.name, path: 'diary');

static const String name = 'DiaryScreenRoute';
}

/// generated route for
/// [_i6.ProfileScreen]
class ProfileScreenRoute extends _i7.PageRouteInfo<void> {
const ProfileScreenRoute() : super(ProfileScreenRoute.name, path: 'my');

static const String name = 'ProfileScreenRoute';
}
Loading

0 comments on commit f238dd8

Please sign in to comment.