File tree Expand file tree Collapse file tree 1 file changed +25
-3
lines changed
packages/firebase_ui_shared/lib/src Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Original file line number Diff line number Diff line change 44
55import 'package:flutter/cupertino.dart' ;
66import 'package:flutter/material.dart' ;
7+ import 'package:firebase_ui_shared/firebase_ui_shared.dart' ;
78
8- class UniversalAlert extends StatelessWidget {
9+ class UniversalAlert extends PlatformWidget {
910 final void Function () onConfirm;
1011 final void Function () onCancel;
1112
@@ -49,8 +50,29 @@ class UniversalAlert extends StatelessWidget {
4950 }
5051
5152 @override
52- Widget build (BuildContext context) {
53- return AlertDialog .adaptive (
53+ Widget buildMaterial (BuildContext context) {
54+ return AlertDialog (
55+ title: Text (title),
56+ content: Text (message),
57+ actions: [
58+ adaptiveAction (
59+ context: context,
60+ onPressed: onConfirm,
61+ child: Text (confirmButtonText),
62+ isDestructiveAction: true ,
63+ ),
64+ adaptiveAction (
65+ context: context,
66+ onPressed: onCancel,
67+ child: Text (cancelButtonText),
68+ ),
69+ ],
70+ );
71+ }
72+
73+ @override
74+ Widget buildCupertino (BuildContext context) {
75+ return CupertinoAlertDialog (
5476 title: Text (title),
5577 content: Text (message),
5678 actions: [
You can’t perform that action at this time.
0 commit comments