mirror of
https://github.com/haorendashu/nowser.git
synced 2025-12-18 02:04:18 +01:00
change auth dialog to support different type auth task
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user