mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-11 07:37:48 +00:00
228 lines
7.1 KiB
Dart
228 lines
7.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
|
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
|
|
|
class DisconnectDeviceDialog extends StatelessWidget {
|
|
final Function()? cancelTab;
|
|
final Function()? confirmTab;
|
|
|
|
const DisconnectDeviceDialog({
|
|
super.key,
|
|
required this.cancelTab,
|
|
required this.confirmTab,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AlertDialog(
|
|
contentPadding: EdgeInsets.zero,
|
|
content: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: <Widget>[
|
|
const SizedBox(
|
|
height: 10,
|
|
),
|
|
const BodyLarge(
|
|
text: 'Disconnect Device',
|
|
fontWeight: FontWeight.w700,
|
|
fontColor: ColorsManager.red,
|
|
fontSize: 16,
|
|
),
|
|
const Padding(
|
|
padding: EdgeInsets.only(left: 15, right: 15),
|
|
child: Divider(
|
|
color: ColorsManager.textGray,
|
|
),
|
|
),
|
|
const Padding(
|
|
padding: EdgeInsets.only(left: 15, right: 20, top: 15, bottom: 20),
|
|
child: Column(
|
|
children: [
|
|
Center(
|
|
child: Text(
|
|
'This will disconnect your device from this Application')),
|
|
],
|
|
),
|
|
),
|
|
Row(
|
|
children: [
|
|
Expanded(
|
|
child: Container(
|
|
decoration: const BoxDecoration(
|
|
border: Border(
|
|
right: BorderSide(
|
|
color: ColorsManager.textGray,
|
|
width: 0.5,
|
|
),
|
|
top: BorderSide(
|
|
color: ColorsManager.textGray,
|
|
width: 1.0,
|
|
),
|
|
)),
|
|
child: SizedBox(
|
|
child: InkWell(
|
|
onTap: cancelTab,
|
|
child: const Padding(
|
|
padding: EdgeInsets.all(15),
|
|
child: Center(
|
|
child: Text(
|
|
'Cancel',
|
|
style: TextStyle(
|
|
color: ColorsManager.textGray,
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.w400),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Expanded(
|
|
child: Container(
|
|
decoration: const BoxDecoration(
|
|
border: Border(
|
|
left: BorderSide(
|
|
color: ColorsManager.textGray,
|
|
width: 0.5,
|
|
),
|
|
top: BorderSide(
|
|
color: ColorsManager.textGray,
|
|
width: 1.0,
|
|
),
|
|
)),
|
|
child: InkWell(
|
|
onTap: confirmTab,
|
|
child: const Padding(
|
|
padding: EdgeInsets.all(15),
|
|
child: Center(
|
|
child: Text(
|
|
'Disconnect',
|
|
style: TextStyle(
|
|
color: ColorsManager.red,
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.w400),
|
|
),
|
|
),
|
|
)),
|
|
))
|
|
],
|
|
)
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class DisconnectWipeData extends StatelessWidget {
|
|
final Function()? cancelTab;
|
|
final Function()? confirmTab;
|
|
|
|
const DisconnectWipeData({
|
|
super.key,
|
|
required this.cancelTab,
|
|
required this.confirmTab,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AlertDialog(
|
|
contentPadding: EdgeInsets.zero,
|
|
content: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: <Widget>[
|
|
const SizedBox(
|
|
height: 10,
|
|
),
|
|
const BodyLarge(
|
|
text: 'Disconnect and Wipe Data',
|
|
fontWeight: FontWeight.w700,
|
|
fontColor: ColorsManager.red,
|
|
fontSize: 16,
|
|
),
|
|
const Padding(
|
|
padding: EdgeInsets.only(left: 15, right: 15),
|
|
child: Divider(
|
|
color: ColorsManager.textGray,
|
|
),
|
|
),
|
|
const Padding(
|
|
padding: EdgeInsets.only(left: 15, right: 20, top: 15, bottom: 20),
|
|
child: Column(
|
|
children: [
|
|
Center(
|
|
child: Text(
|
|
'This will disconnect your device from this Application and wipe all the data')),
|
|
],
|
|
),
|
|
),
|
|
Row(
|
|
children: [
|
|
Expanded(
|
|
child: Container(
|
|
decoration: const BoxDecoration(
|
|
border: Border(
|
|
right: BorderSide(
|
|
color: ColorsManager.textGray,
|
|
width: 0.5,
|
|
),
|
|
top: BorderSide(
|
|
color: ColorsManager.textGray,
|
|
width: 1.0,
|
|
),
|
|
)),
|
|
child: SizedBox(
|
|
child: InkWell(
|
|
onTap: cancelTab,
|
|
child: const Padding(
|
|
padding: EdgeInsets.all(15),
|
|
child: Center(
|
|
child: Text(
|
|
'Cancel',
|
|
style: TextStyle(
|
|
color: ColorsManager.textGray,
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.w400),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Expanded(
|
|
child: Container(
|
|
decoration: const BoxDecoration(
|
|
border: Border(
|
|
left: BorderSide(
|
|
color: ColorsManager.textGray,
|
|
width: 0.5,
|
|
),
|
|
top: BorderSide(
|
|
color: ColorsManager.textGray,
|
|
width: 1.0,
|
|
),
|
|
)),
|
|
child: InkWell(
|
|
onTap: confirmTab,
|
|
child: const Padding(
|
|
padding: EdgeInsets.all(15),
|
|
child: Center(
|
|
child: Text(
|
|
'Disconnect',
|
|
style: TextStyle(
|
|
color: ColorsManager.red,
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.w400),
|
|
),
|
|
),
|
|
)),
|
|
))
|
|
],
|
|
)
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|