kasy-cli 1.18.0 → 1.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/kasy.js +3 -1
- package/lib/commands/new.js +99 -105
- package/lib/commands/run.js +34 -6
- package/lib/scaffold/backends/firebase/setup-from-scratch.js +79 -0
- package/lib/utils/brand.js +1 -1
- package/lib/utils/i18n/messages-en.js +6 -0
- package/lib/utils/i18n/messages-es.js +6 -0
- package/lib/utils/i18n/messages-pt.js +6 -0
- package/package.json +1 -2
- package/templates/firebase/lib/components/kasy_date_picker.dart +1670 -331
- package/templates/firebase/lib/components/kasy_tabs.dart +111 -72
- package/templates/firebase/lib/components/kasy_text_area.dart +9 -4
- package/templates/firebase/lib/components/kasy_text_field.dart +96 -36
- package/templates/firebase/lib/components/kasy_text_field_otp.dart +1 -2
- package/templates/firebase/lib/core/bottom_menu/bottom_menu.dart +88 -35
- package/templates/firebase/lib/core/bottom_menu/bottom_router.dart +7 -43
- package/templates/firebase/lib/core/dev_inspector/dev_inspector.dart +118 -16
- package/templates/firebase/lib/core/dev_inspector/dev_inspector_service.dart +14 -20
- package/templates/firebase/lib/core/security/secured_storage.dart +56 -15
- package/templates/firebase/lib/core/theme/providers/theme_provider.dart +3 -0
- package/templates/firebase/lib/core/theme/web_background_sync.dart +3 -0
- package/templates/firebase/lib/core/theme/web_background_sync_web.dart +18 -0
- package/templates/firebase/lib/core/web_device_preview/web_device_preview.dart +3 -6
- package/templates/firebase/lib/features/authentication/api/authentication_api.dart +6 -0
- package/templates/firebase/lib/features/home/home_components_page.dart +3 -2
- package/templates/firebase/lib/features/home/home_components_preview_registry.dart +457 -73
- package/templates/firebase/lib/features/home/home_page.dart +17 -40
- package/templates/firebase/lib/features/notifications/ui/notifications_page.dart +1 -16
- package/templates/firebase/lib/features/notifications/ui/widgets/empty_notifications.dart +0 -4
- package/templates/firebase/lib/main.dart +34 -34
- package/templates/firebase/pubspec.yaml +1 -0
- package/templates/firebase/storage.cors.json +8 -0
- package/templates/firebase/web/index.html +15 -2
- package/templates/firebase/lib/core/bottom_menu/kasy_bart_navigation.dart +0 -22
|
@@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
|
|
|
4
4
|
import 'package:flutter/rendering.dart';
|
|
5
5
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
6
6
|
import 'package:kasy_kit/components/components.dart';
|
|
7
|
-
import 'package:kasy_kit/core/bottom_menu/kasy_bart_navigation.dart';
|
|
8
7
|
import 'package:kasy_kit/core/theme/theme.dart';
|
|
9
8
|
import 'package:kasy_kit/features/notifications/providers/models/notification.dart'
|
|
10
9
|
as app;
|
|
@@ -21,39 +20,25 @@ class NotificationsPage extends ConsumerStatefulWidget {
|
|
|
21
20
|
ConsumerState<NotificationsPage> createState() => _NotificationsPageState();
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
class _NotificationsPageState extends ConsumerState<NotificationsPage>
|
|
25
|
-
with WidgetsBindingObserver {
|
|
23
|
+
class _NotificationsPageState extends ConsumerState<NotificationsPage> {
|
|
26
24
|
final ScrollController _scrollController = ScrollController();
|
|
27
25
|
Timer? _autoReadTimer;
|
|
28
26
|
|
|
29
27
|
@override
|
|
30
28
|
void initState() {
|
|
31
29
|
super.initState();
|
|
32
|
-
WidgetsBinding.instance.addObserver(this);
|
|
33
30
|
_scrollController.addListener(_onScrollChange);
|
|
34
31
|
requestReadAll();
|
|
35
32
|
}
|
|
36
33
|
|
|
37
34
|
@override
|
|
38
35
|
void dispose() {
|
|
39
|
-
WidgetsBinding.instance.removeObserver(this);
|
|
40
36
|
_autoReadTimer?.cancel();
|
|
41
37
|
_scrollController.removeListener(_onScrollChange);
|
|
42
38
|
_scrollController.dispose();
|
|
43
39
|
super.dispose();
|
|
44
40
|
}
|
|
45
41
|
|
|
46
|
-
@override
|
|
47
|
-
void didChangeAppLifecycleState(AppLifecycleState state) {
|
|
48
|
-
super.didChangeAppLifecycleState(state);
|
|
49
|
-
if (state == AppLifecycleState.resumed && mounted) {
|
|
50
|
-
// Native permission dialogs push the app to the background briefly. When
|
|
51
|
-
// we come back, the Bart bottom bar can stay hidden because its internal
|
|
52
|
-
// visibility state is reset. Force it back so the user is never stranded.
|
|
53
|
-
kasyShowBottomBar(context);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
42
|
void _onScrollChange() {
|
|
58
43
|
final direction = _scrollController.position.userScrollDirection;
|
|
59
44
|
final isScrollingDown = direction == ScrollDirection.reverse;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import 'package:flutter/material.dart';
|
|
2
2
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
3
3
|
import 'package:kasy_kit/components/components.dart';
|
|
4
|
-
import 'package:kasy_kit/core/bottom_menu/kasy_bart_navigation.dart';
|
|
5
4
|
import 'package:kasy_kit/core/theme/theme.dart';
|
|
6
5
|
import 'package:kasy_kit/features/notifications/providers/models/notification.dart';
|
|
7
6
|
import 'package:kasy_kit/features/notifications/repositories/notifications_repository.dart';
|
|
@@ -30,9 +29,6 @@ class _EmptyNotificationsState extends ConsumerState<EmptyNotifications> {
|
|
|
30
29
|
Future<void> _onAskPressed(NotificationPermission permission) async {
|
|
31
30
|
await permission.maybeAsk();
|
|
32
31
|
if (!mounted) return;
|
|
33
|
-
// The native permission dialog pulls the app out of focus; restore the
|
|
34
|
-
// bottom bar defensively before refreshing the local state.
|
|
35
|
-
kasyShowBottomBar(context);
|
|
36
32
|
setState(() {
|
|
37
33
|
_permissionFuture = _loadPermission();
|
|
38
34
|
});
|
|
@@ -161,47 +161,47 @@ class _MyAppState extends ConsumerState<MyApp> {
|
|
|
161
161
|
return WebDevicePreview.wrap(
|
|
162
162
|
child: DevInspector.wrap(
|
|
163
163
|
child: MaterialApp.router(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
],
|
|
176
|
-
locale: TranslationProvider.of(context).flutterLocale,
|
|
177
|
-
supportedLocales: AppLocaleUtils.supportedLocales,
|
|
178
|
-
builder: (context, child) => Initializer(
|
|
179
|
-
services: [
|
|
180
|
-
authenticationApiProvider,
|
|
181
|
-
sharedPreferencesProvider,
|
|
182
|
-
remoteConfigApiProvider,
|
|
183
|
-
notificationsSettingsProvider,
|
|
184
|
-
notificationRepositoryProvider,
|
|
185
|
-
subscriptionRepositoryProvider,
|
|
186
|
-
userStateNotifierProvider.notifier,
|
|
187
|
-
homeWidgetsManagerProvider,
|
|
188
|
-
analyticsApiProvider,
|
|
189
|
-
facebookEventApiProvider,
|
|
164
|
+
title: 'Kasy',
|
|
165
|
+
scaffoldMessengerKey: devInspectorRootScaffoldMessengerKey,
|
|
166
|
+
theme: ThemeProvider.of(context).light,
|
|
167
|
+
darkTheme: ThemeProvider.of(context).dark,
|
|
168
|
+
themeMode: ThemeProvider.of(context).mode,
|
|
169
|
+
themeAnimationDuration: Duration.zero,
|
|
170
|
+
routerConfig: goRouter,
|
|
171
|
+
localizationsDelegates: const [
|
|
172
|
+
GlobalMaterialLocalizations.delegate,
|
|
173
|
+
GlobalWidgetsLocalizations.delegate,
|
|
174
|
+
GlobalCupertinoLocalizations.delegate,
|
|
190
175
|
],
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
176
|
+
locale: TranslationProvider.of(context).flutterLocale,
|
|
177
|
+
supportedLocales: AppLocaleUtils.supportedLocales,
|
|
178
|
+
builder: (context, child) => Initializer(
|
|
179
|
+
services: [
|
|
180
|
+
authenticationApiProvider,
|
|
181
|
+
sharedPreferencesProvider,
|
|
182
|
+
remoteConfigApiProvider,
|
|
183
|
+
notificationsSettingsProvider,
|
|
184
|
+
notificationRepositoryProvider,
|
|
185
|
+
subscriptionRepositoryProvider,
|
|
186
|
+
userStateNotifierProvider.notifier,
|
|
187
|
+
homeWidgetsManagerProvider,
|
|
188
|
+
analyticsApiProvider,
|
|
189
|
+
facebookEventApiProvider,
|
|
190
|
+
],
|
|
191
|
+
onReady: DevicePreview.appBuilder(context, child),
|
|
192
|
+
onError: (_, error) => InitializationErrorPage(error: error),
|
|
193
|
+
onLoading: Scaffold(
|
|
194
|
+
body: Center(
|
|
195
|
+
child: CircularProgressIndicator.adaptive(
|
|
196
|
+
valueColor: AlwaysStoppedAnimation<Color>(
|
|
197
|
+
context.colors.primary,
|
|
198
|
+
),
|
|
198
199
|
),
|
|
199
200
|
),
|
|
200
201
|
),
|
|
201
202
|
),
|
|
202
203
|
),
|
|
203
204
|
),
|
|
204
|
-
),
|
|
205
205
|
);
|
|
206
206
|
},
|
|
207
207
|
),
|
|
@@ -48,7 +48,9 @@
|
|
|
48
48
|
|
|
49
49
|
<style id="splash-screen-style">
|
|
50
50
|
html {
|
|
51
|
-
height: 100
|
|
51
|
+
height: 100%;
|
|
52
|
+
background-color: #FFFFFF;
|
|
53
|
+
color-scheme: light dark;
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
body {
|
|
@@ -58,6 +60,10 @@
|
|
|
58
60
|
background-size: 100% 100%;
|
|
59
61
|
}
|
|
60
62
|
|
|
63
|
+
flutter-view, flt-glass-pane, flt-scene-host {
|
|
64
|
+
background-color: #FFFFFF;
|
|
65
|
+
}
|
|
66
|
+
|
|
61
67
|
.center {
|
|
62
68
|
margin: 0;
|
|
63
69
|
position: absolute;
|
|
@@ -105,16 +111,23 @@
|
|
|
105
111
|
}
|
|
106
112
|
|
|
107
113
|
@media (prefers-color-scheme: dark) {
|
|
114
|
+
html {
|
|
115
|
+
background-color: #000000;
|
|
116
|
+
}
|
|
108
117
|
body {
|
|
109
118
|
background-color: #000000;
|
|
110
119
|
}
|
|
120
|
+
flutter-view, flt-glass-pane, flt-scene-host {
|
|
121
|
+
background-color: #000000;
|
|
122
|
+
}
|
|
111
123
|
}
|
|
112
124
|
</style>
|
|
113
125
|
<script id="splash-screen-script">
|
|
114
126
|
function removeSplashFromWeb() {
|
|
115
127
|
document.getElementById("splash")?.remove();
|
|
116
128
|
document.getElementById("splash-branding")?.remove();
|
|
117
|
-
|
|
129
|
+
const isDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
130
|
+
document.body.style.backgroundColor = isDark ? "#000000" : "#FFFFFF";
|
|
118
131
|
}
|
|
119
132
|
</script>
|
|
120
133
|
</head>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import 'package:bart/bart/bart_bottombar_actions.dart';
|
|
2
|
-
import 'package:flutter/material.dart';
|
|
3
|
-
|
|
4
|
-
/// Restores the Bart bottom bar after leaving a home inner route.
|
|
5
|
-
void kasyShowBottomBar(BuildContext context) {
|
|
6
|
-
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
7
|
-
if (!context.mounted) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
Actions.invoke(context, BottomBarIntent.show());
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/// Hides the Bart bottom bar for home inner routes, including web reloads.
|
|
15
|
-
void kasyHideBottomBar(BuildContext context) {
|
|
16
|
-
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
17
|
-
if (!context.mounted) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
Actions.invoke(context, BottomBarIntent.hide());
|
|
21
|
-
});
|
|
22
|
-
}
|