-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from chebizarro/notifiers
Refactored with notifier pattern
- Loading branch information
Showing
144 changed files
with
3,609 additions
and
2,427 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
</adaptive-icon> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 1 addition & 122 deletions
123
ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,122 +1 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"size" : "20x20", | ||
"idiom" : "iphone", | ||
"filename" : "[email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"size" : "20x20", | ||
"idiom" : "iphone", | ||
"filename" : "[email protected]", | ||
"scale" : "3x" | ||
}, | ||
{ | ||
"size" : "29x29", | ||
"idiom" : "iphone", | ||
"filename" : "[email protected]", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"size" : "29x29", | ||
"idiom" : "iphone", | ||
"filename" : "[email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"size" : "29x29", | ||
"idiom" : "iphone", | ||
"filename" : "[email protected]", | ||
"scale" : "3x" | ||
}, | ||
{ | ||
"size" : "40x40", | ||
"idiom" : "iphone", | ||
"filename" : "[email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"size" : "40x40", | ||
"idiom" : "iphone", | ||
"filename" : "[email protected]", | ||
"scale" : "3x" | ||
}, | ||
{ | ||
"size" : "60x60", | ||
"idiom" : "iphone", | ||
"filename" : "[email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"size" : "60x60", | ||
"idiom" : "iphone", | ||
"filename" : "[email protected]", | ||
"scale" : "3x" | ||
}, | ||
{ | ||
"size" : "20x20", | ||
"idiom" : "ipad", | ||
"filename" : "[email protected]", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"size" : "20x20", | ||
"idiom" : "ipad", | ||
"filename" : "[email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"size" : "29x29", | ||
"idiom" : "ipad", | ||
"filename" : "[email protected]", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"size" : "29x29", | ||
"idiom" : "ipad", | ||
"filename" : "[email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"size" : "40x40", | ||
"idiom" : "ipad", | ||
"filename" : "[email protected]", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"size" : "40x40", | ||
"idiom" : "ipad", | ||
"filename" : "[email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"size" : "76x76", | ||
"idiom" : "ipad", | ||
"filename" : "[email protected]", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"size" : "76x76", | ||
"idiom" : "ipad", | ||
"filename" : "[email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"size" : "83.5x83.5", | ||
"idiom" : "ipad", | ||
"filename" : "[email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"size" : "1024x1024", | ||
"idiom" : "ios-marketing", | ||
"filename" : "[email protected]", | ||
"scale" : "1x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} | ||
{"images":[{"size":"20x20","idiom":"iphone","filename":"[email protected]","scale":"2x"},{"size":"20x20","idiom":"iphone","filename":"[email protected]","scale":"3x"},{"size":"29x29","idiom":"iphone","filename":"[email protected]","scale":"1x"},{"size":"29x29","idiom":"iphone","filename":"[email protected]","scale":"2x"},{"size":"29x29","idiom":"iphone","filename":"[email protected]","scale":"3x"},{"size":"40x40","idiom":"iphone","filename":"[email protected]","scale":"2x"},{"size":"40x40","idiom":"iphone","filename":"[email protected]","scale":"3x"},{"size":"57x57","idiom":"iphone","filename":"[email protected]","scale":"1x"},{"size":"57x57","idiom":"iphone","filename":"[email protected]","scale":"2x"},{"size":"60x60","idiom":"iphone","filename":"[email protected]","scale":"2x"},{"size":"60x60","idiom":"iphone","filename":"[email protected]","scale":"3x"},{"size":"20x20","idiom":"ipad","filename":"[email protected]","scale":"1x"},{"size":"20x20","idiom":"ipad","filename":"[email protected]","scale":"2x"},{"size":"29x29","idiom":"ipad","filename":"[email protected]","scale":"1x"},{"size":"29x29","idiom":"ipad","filename":"[email protected]","scale":"2x"},{"size":"40x40","idiom":"ipad","filename":"[email protected]","scale":"1x"},{"size":"40x40","idiom":"ipad","filename":"[email protected]","scale":"2x"},{"size":"50x50","idiom":"ipad","filename":"[email protected]","scale":"1x"},{"size":"50x50","idiom":"ipad","filename":"[email protected]","scale":"2x"},{"size":"72x72","idiom":"ipad","filename":"[email protected]","scale":"1x"},{"size":"72x72","idiom":"ipad","filename":"[email protected]","scale":"2x"},{"size":"76x76","idiom":"ipad","filename":"[email protected]","scale":"1x"},{"size":"76x76","idiom":"ipad","filename":"[email protected]","scale":"2x"},{"size":"83.5x83.5","idiom":"ipad","filename":"[email protected]","scale":"2x"},{"size":"1024x1024","idiom":"ios-marketing","filename":"[email protected]","scale":"1x"}],"info":{"version":1,"author":"xcode"}} |
Binary file modified
BIN
+56.8 KB
(630%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+565 Bytes
(290%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.53 KB
(490%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.57 KB
(690%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.06 KB
(490%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.45 KB
(640%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4.02 KB
(680%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.53 KB
(490%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.72 KB
(750%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.84 KB
(790%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.84 KB
(790%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+8.86 KB
(640%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.27 KB
(540%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+7.49 KB
(730%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Oops, something went wrong.
Binary file modified
BIN
+8.25 KB
(700%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_localizations/flutter_localizations.dart'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:go_router/go_router.dart'; | ||
import 'package:mostro_mobile/app/app_routes.dart'; | ||
import 'package:mostro_mobile/app/app_theme.dart'; | ||
import 'package:mostro_mobile/features/auth/providers/auth_notifier_provider.dart'; | ||
import 'package:mostro_mobile/generated/l10n.dart'; | ||
import 'package:mostro_mobile/features/auth/notifiers/auth_state.dart'; | ||
|
||
class MostroApp extends ConsumerWidget { | ||
const MostroApp({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
ref.listen<AuthState>(authNotifierProvider, (previous, state) { | ||
WidgetsBinding.instance.addPostFrameCallback((_) { | ||
if (!context.mounted) return; | ||
if (state is AuthAuthenticated || state is AuthRegistrationSuccess) { | ||
context.go('/'); | ||
} else if (state is AuthUnregistered || state is AuthUnauthenticated) { | ||
context.go('/welcome'); | ||
} | ||
}); | ||
}); | ||
|
||
return MaterialApp.router( | ||
title: 'Mostro', | ||
theme: AppTheme.theme, | ||
routerConfig: goRouter, | ||
localizationsDelegates: const [ | ||
S.delegate, | ||
GlobalMaterialLocalizations.delegate, | ||
GlobalWidgetsLocalizations.delegate, | ||
GlobalCupertinoLocalizations.delegate, | ||
], | ||
supportedLocales: S.delegate.supportedLocales, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:go_router/go_router.dart'; | ||
import 'package:mostro_mobile/features/add_order/screens/add_order_screen.dart'; | ||
import 'package:mostro_mobile/features/add_order/screens/order_confirmation_screen.dart'; | ||
import 'package:mostro_mobile/features/auth/screens/welcome_screen.dart'; | ||
import 'package:mostro_mobile/features/home/screens/home_screen.dart'; | ||
import 'package:mostro_mobile/features/take_order/screens/add_lightning_invoice_screen.dart'; | ||
import 'package:mostro_mobile/features/take_order/screens/pay_lightning_invoice_screen.dart'; | ||
import 'package:mostro_mobile/features/take_order/screens/take_buy_order_screen.dart'; | ||
import 'package:mostro_mobile/features/take_order/screens/take_sell_order_screen.dart'; | ||
import 'package:mostro_mobile/presentation/chat_list/screens/chat_list_screen.dart'; | ||
import 'package:mostro_mobile/presentation/profile/screens/profile_screen.dart'; | ||
import 'package:mostro_mobile/features/auth/screens/register_screen.dart'; | ||
import 'package:mostro_mobile/shared/widgets/navigation_listener_widget.dart'; | ||
import 'package:mostro_mobile/shared/widgets/notification_listener_widget.dart'; | ||
|
||
final goRouter = GoRouter( | ||
navigatorKey: GlobalKey<NavigatorState>(), | ||
routes: [ | ||
ShellRoute( | ||
builder: (BuildContext context, GoRouterState state, Widget child) { | ||
// Wrap the Navigator with your listener widgets | ||
return NotificationListenerWidget( | ||
child: NavigationListenerWidget( | ||
child: child, | ||
), | ||
); | ||
}, | ||
routes: [ | ||
GoRoute( | ||
path: '/welcome', | ||
builder: (context, state) => const WelcomeScreen(), | ||
), | ||
GoRoute( | ||
path: '/', | ||
builder: (context, state) => const HomeScreen(), | ||
), | ||
GoRoute( | ||
path: '/chat_list', | ||
builder: (context, state) => const ChatListScreen(), | ||
), | ||
GoRoute( | ||
path: '/profile', | ||
builder: (context, state) => const ProfileScreen(), | ||
), | ||
GoRoute( | ||
path: '/register', | ||
builder: (context, state) => const RegisterScreen(), | ||
), | ||
GoRoute( | ||
path: '/add_order', | ||
builder: (context, state) => AddOrderScreen(), | ||
), | ||
GoRoute( | ||
path: '/take_sell/:orderId', | ||
builder: (context, state) => | ||
TakeSellOrderScreen(orderId: state.pathParameters['orderId']!), | ||
), | ||
GoRoute( | ||
path: '/take_buy/:orderId', | ||
builder: (context, state) => | ||
TakeBuyOrderScreen(orderId: state.pathParameters['orderId']!), | ||
), | ||
GoRoute( | ||
path: '/order_confirmed/:orderId', | ||
builder: (context, state) => OrderConfirmationScreen( | ||
orderId: state.pathParameters['orderId']!, | ||
), | ||
), | ||
GoRoute( | ||
path: '/pay_invoice/:orderId', | ||
builder: (context, state) => PayLightningInvoiceScreen( | ||
orderId: state.pathParameters['orderId']!), | ||
), | ||
GoRoute( | ||
path: '/add_invoice/:orderId', | ||
builder: (context, state) => AddLightningInvoiceScreen( | ||
orderId: state.pathParameters['orderId']!), | ||
), | ||
], | ||
), | ||
], | ||
initialLocation: '/welcome', | ||
errorBuilder: (context, state) => Scaffold( | ||
body: Center(child: Text(state.error.toString())), | ||
), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class AppSettings { | ||
final bool isFirstLaunch; | ||
|
||
AppSettings(this.isFirstLaunch); | ||
|
||
factory AppSettings.intial() => AppSettings(true); | ||
|
||
AppSettings copyWith({bool isFirstLaunch = false}) { | ||
return AppSettings(isFirstLaunch); | ||
} | ||
} |
Oops, something went wrong.