change auth dialog to support different type auth task

This commit is contained in:
DASHU
2024-08-31 21:24:43 +08:00
parent 47f02c72b0
commit 666c546d93
5 changed files with 238 additions and 105 deletions

View File

@@ -1,8 +1,7 @@
import 'package:flutter/material.dart';
import 'package:nowser/const/base.dart';
import 'package:nowser/component/auth_dialog/auth_dialog_base_componnet.dart';
import '../logo_component.dart';
import 'auth_app_info_component.dart';
import '../../const/base.dart';
class AuthDialog extends StatefulWidget {
static void show(BuildContext context) {
@@ -33,56 +32,6 @@ class _AuthDialog extends State<AuthDialog> {
var hintColor = themeData.hintColor;
List<Widget> list = [];
var topWidget = Container(
child: Row(
children: [
Container(
margin: EdgeInsets.only(
left: Base.BASE_PADDING,
right: Base.BASE_PADDING,
top: Base.BASE_PADDING_HALF,
bottom: Base.BASE_PADDING_HALF,
),
child: LogoComponent(),
),
Expanded(
child: Container(
margin: EdgeInsets.only(right: Base.BASE_PADDING_HALF),
alignment: Alignment.centerRight,
child: DropdownButton<String>(
items: [
DropdownMenuItem(
child: Text("npubxxxxxx"),
value: "npubxxxxxx",
)
],
onChanged: (Object? value) {},
value: "npubxxxxxx",
),
),
),
],
),
);
list.add(Container(
alignment: Alignment.center,
margin: baseMargin,
child: Text(
"Action Title",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: themeData.textTheme.bodyLarge!.fontSize,
),
),
));
list.add(Container(
margin: baseMargin,
child: AuthAppInfoComponent(),
));
list.add(Container(
margin: baseMargin,
child: Text(
@@ -136,58 +85,11 @@ class _AuthDialog extends State<AuthDialog> {
),
));
list.add(Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
// FilledButton(onPressed: () {}, child: Text("Cancel")),
// OutlinedButton(
// onPressed: () {},
// child: Text(
// "Cancel",
// style: TextStyle(
// color: Colors.red,
// ),
// ),
// style: ,
// ),
FilledButton(
onPressed: () {},
child: Text("Cancel"),
style: ButtonStyle(
backgroundColor: WidgetStateProperty.all(Colors.red),
),
),
Container(
margin: EdgeInsets.only(
left: Base.BASE_PADDING_HALF,
),
child: FilledButton(onPressed: () {}, child: Text("Confirm")),
)
],
),
));
return Dialog(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
padding: const EdgeInsets.all(Base.BASE_PADDING),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(color: hintColor.withOpacity(0.3)))),
child: topWidget,
),
Container(
padding: EdgeInsets.all(Base.BASE_PADDING),
child: Column(
mainAxisSize: MainAxisSize.min,
children: list,
),
),
],
),
var child = Column(
mainAxisSize: MainAxisSize.min,
children: list,
);
return AuthDialogBaseComponnet(title: "Sign Event", child: child);
}
}