11import 'package:flutter/material.dart' ;
2+ import 'package:flutter_it/flutter_it.dart' ;
23import 'package:school_data_hub_flutter/common/theme/app_colors.dart' ;
34import 'package:school_data_hub_flutter/core/updater/shorebird_update_manager.dart' ;
45import 'package:shorebird_code_push/shorebird_code_push.dart' ;
5- import 'package:flutter_it/flutter_it .dart' ;
6+ import 'package:terminate_restart/terminate_restart .dart' ;
67
78/// Widget that displays update status and provides update controls
89class UpdateStatusWidget extends WatchingWidget {
@@ -115,7 +116,17 @@ class UpdateStatusWidget extends WatchingWidget {
115116 ),
116117
117118 const SizedBox (height: 12 ),
118-
119+ ElevatedButton (
120+ onPressed: () async {
121+ await TerminateRestart .instance.restartAppWithConfirmation (
122+ context,
123+ title: 'Restart App' ,
124+ message: 'Do you want to restart the app?' ,
125+ terminate: true ,
126+ );
127+ },
128+ child: const Text ('App neu starten' ),
129+ ),
119130 // Action buttons
120131 Row (
121132 children: [
@@ -191,7 +202,7 @@ class UpdateStatusWidget extends WatchingWidget {
191202 }
192203
193204 void _showRestartDialog (BuildContext context) {
194- showDialog (
205+ showDialog < void > (
195206 context: context,
196207 builder: (context) => AlertDialog (
197208 title: const Text ('Restart Required' ),
@@ -205,10 +216,13 @@ class UpdateStatusWidget extends WatchingWidget {
205216 child: const Text ('Later' ),
206217 ),
207218 ElevatedButton (
208- onPressed: () {
209- Navigator .of (context).pop ();
210- // You could add app restart logic here if needed
211- // For now, user needs to manually restart
219+ onPressed: () async {
220+ await TerminateRestart .instance.restartAppWithConfirmation (
221+ context,
222+ title: 'Restart App' ,
223+ message: 'Do you want to restart the app?' ,
224+ terminate: true ,
225+ );
212226 },
213227 child: const Text ('OK' ),
214228 ),
0 commit comments