fix: Resolve Dart type inference errors and update Android build configuration for Gradle 8.14
Type Annotation Fixes:
- fireNotificationList.dart: Added DeleteFireNotificationFunction and TapFireNotificationFunction types to _buildRow and _buildSavedFireNotifications parameters
- homePage.dart: Added Object type to catchError handler parameters
- redux/appReducer.dart: Added dynamic type annotation to action parameter
- redux/fetchDataMiddleware.dart: Added explicit type annotations and improved type casting
- redux/reducers.dart: Added dynamic type annotation to action parameter
- redux/userReducer.dart: Added dynamic type annotation to action parameter
Android Build Configuration Updates:
- Updated compileSdkVersion and targetSdkVersion from 34 to 36 to match plugin requirements
- Moved plugins {} block to first position (Gradle 8.14 requirement)
- Added dev.flutter.flutter-gradle-plugin to plugins block for modern Flutter integration
- Removed deprecated useProguard setting, replaced with shrinkResources
- Disabled Jetifier (android.enableJetifier=false) to improve build performance
- Increased JVM heap allocation to 4096M for large project compilation
- Added Kotlin language version 1.8 override for plugin compatibility
- Added ProGuard rules to exclude optional Google Play Core classes
Build Results:
- ✅ APK builds successfully (146MB debug APK)
- ✅ Zero type inference errors detected by dart analyze
- ✅ Kotlin compilation passes
- ✅ R8 minification configured correctly
- ✅ 301 remaining issues are all INFO-level style suggestions (non-blocking)
This commit is contained in:
parent
956165c524
commit
7812ed951e
19 changed files with 129 additions and 111 deletions
|
|
@ -20,7 +20,6 @@ import 'objectIdUtils.dart';
|
|||
import 'redux/actions.dart';
|
||||
|
||||
class _ViewModel {
|
||||
|
||||
_ViewModel({required this.isLoaded});
|
||||
final bool isLoaded;
|
||||
|
||||
|
|
@ -36,7 +35,6 @@ class _ViewModel {
|
|||
}
|
||||
|
||||
class HomePage extends StatefulWidget {
|
||||
|
||||
const HomePage({super.key});
|
||||
static const String routeName = '/home';
|
||||
|
||||
|
|
@ -72,7 +70,8 @@ class _HomePageState extends State<HomePage> {
|
|||
debugPrint(
|
||||
'onMessage in fireApp (isLoaded: ${store.state.isLoaded}): $message');
|
||||
if (message.data.isNotEmpty) {
|
||||
final FireNotification? notif = _notifForMessage(message.data, store.state.isLoaded);
|
||||
final FireNotification? notif =
|
||||
_notifForMessage(message.data, store.state.isLoaded);
|
||||
if (notif != null) {
|
||||
_showItemDialog(message.data, notif);
|
||||
}
|
||||
|
|
@ -160,8 +159,7 @@ class _HomePageState extends State<HomePage> {
|
|||
},
|
||||
heroTag: 'notifyFire',
|
||||
backgroundColor: fires600,
|
||||
label: Text(S.of(context).notifyAFire,
|
||||
style: _btnFont),
|
||||
label: Text(S.of(context).notifyAFire, style: _btnFont),
|
||||
icon:
|
||||
const Icon(Icons.notifications_active, size: 32.0),
|
||||
),
|
||||
|
|
@ -172,15 +170,14 @@ class _HomePageState extends State<HomePage> {
|
|||
: SafeArea(
|
||||
child: Center(
|
||||
child: CenteredColumn(children: <Widget>[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
_scaffoldKey.currentState?.openDrawer();
|
||||
},
|
||||
icon: const Icon(Icons.menu,
|
||||
size: 30.0, color: Colors.black38)),
|
||||
]),
|
||||
Row(children: <Widget>[
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
_scaffoldKey.currentState?.openDrawer();
|
||||
},
|
||||
icon: const Icon(Icons.menu,
|
||||
size: 30.0, color: Colors.black38)),
|
||||
]),
|
||||
Expanded(
|
||||
child: FractionallySizedBox(
|
||||
alignment: FractionalOffset.center,
|
||||
|
|
@ -238,7 +235,9 @@ class _HomePageState extends State<HomePage> {
|
|||
if (shouldNavigate ?? false) {
|
||||
_navigateToItemDetail(message);
|
||||
}
|
||||
}).catchError((e) => print('$e'));
|
||||
}).catchError((Object e) {
|
||||
print('$e');
|
||||
});
|
||||
}
|
||||
|
||||
Widget _buildDialog(BuildContext context, FireNotification item) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue