67 lines
1.4 KiB
Dart
67 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
///分割线
|
|
class LoginDivider extends StatelessWidget {
|
|
const LoginDivider({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
margin: EdgeInsets.only(top: 20, bottom: 20),
|
|
child: Row(
|
|
spacing: 8,
|
|
children: [
|
|
Expanded(
|
|
child: Container(
|
|
height: 1,
|
|
color: Theme.of(context).colorScheme.surfaceContainer,
|
|
),
|
|
),
|
|
Text(
|
|
"or",
|
|
style: Theme.of(context).textTheme.labelMedium,
|
|
),
|
|
Expanded(
|
|
child: Container(
|
|
height: 1,
|
|
color: Theme.of(context).colorScheme.surfaceContainer,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class OtherButton extends StatelessWidget {
|
|
final Function() onTap;
|
|
final String icon;
|
|
|
|
const OtherButton({
|
|
super.key,
|
|
required this.onTap,
|
|
required this.icon,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GestureDetector(
|
|
onTap: onTap,
|
|
child: Container(
|
|
width: 45,
|
|
padding: EdgeInsets.all(10),
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
border: Border.all(
|
|
color: Theme.of(context).colorScheme.surfaceContainer,
|
|
),
|
|
),
|
|
child: AspectRatio(
|
|
aspectRatio: 1,
|
|
child: Image.asset(icon),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|