parent
e736b13fc1
commit
3b5ada0858
@ -0,0 +1,40 @@
|
||||
// Flutter imports:
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// Project imports:
|
||||
import 'package:akuCommunity/base/base_style.dart';
|
||||
import 'package:akuCommunity/utils/headers.dart';
|
||||
|
||||
class BeeCheckButton<T> extends StatefulWidget {
|
||||
final Function(T value) onChange;
|
||||
final T value;
|
||||
final T groupValue;
|
||||
final String title;
|
||||
BeeCheckButton(
|
||||
{Key key, this.onChange, this.value, this.groupValue, this.title})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_BeeCheckButtonState createState() => _BeeCheckButtonState();
|
||||
}
|
||||
|
||||
class _BeeCheckButtonState extends State<BeeCheckButton> {
|
||||
bool get isSelect => widget.groupValue == widget.value;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return FlatButton(
|
||||
onPressed: () {
|
||||
widget.onChange(widget.value);
|
||||
},
|
||||
child: widget.title.text
|
||||
.color(isSelect ? ktextPrimary : Color(0xFF979797))
|
||||
.size(32.sp)
|
||||
.make(),
|
||||
padding: EdgeInsets.symmetric(horizontal: 34.w, vertical: 14.w),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
color: isSelect ? kPrimaryColor : ktextSubColor, width: 3.w),
|
||||
borderRadius: BorderRadius.circular(36.w)),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
// Flutter imports:
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// Package imports:
|
||||
import 'package:get/get.dart';
|
||||
|
||||
// Project imports:
|
||||
import 'package:akuCommunity/utils/headers.dart';
|
||||
|
||||
class BeeCustomPicker extends StatefulWidget {
|
||||
|
||||
final Widget body;
|
||||
final VoidCallback onPressed;
|
||||
BeeCustomPicker({Key key, this.body, this.onPressed}) : super(key: key);
|
||||
|
||||
@override
|
||||
_BeeCustomPickerState createState() => _BeeCustomPickerState();
|
||||
}
|
||||
|
||||
class _BeeCustomPickerState extends State<BeeCustomPicker> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
child: Material(
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(10)),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 48,
|
||||
child: NavigationToolbar(
|
||||
leading: TextButton(
|
||||
onPressed: Get.back,
|
||||
child: '取消'.text.black.make(),
|
||||
),
|
||||
trailing: TextButton(
|
||||
onPressed: widget.onPressed,
|
||||
child: '确定'.text.black.make(),
|
||||
),
|
||||
),
|
||||
),
|
||||
widget.body,
|
||||
],
|
||||
),
|
||||
),
|
||||
height: Get.height / 3,
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue