You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cloudsolutions-atoms/lib/new_views/common_widgets/app_dashed_button.dart

34 lines
1.3 KiB
Dart

import 'package:dotted_border/dotted_border.dart';
import 'package:flutter/material.dart';
import 'package:test_sa/extensions/context_extension.dart';
import 'package:test_sa/extensions/int_extensions.dart';
import 'package:test_sa/extensions/text_extensions.dart';
import 'package:test_sa/extensions/widget_extensions.dart';
import '../app_style/app_color.dart';
class AppDashedButton extends StatelessWidget {
final String title;
final VoidCallback onPressed;
const AppDashedButton({@required this.title, @required this.onPressed, Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 2.toScreenWidth),
decoration: BoxDecoration(color: Theme.of(context).cardColor, borderRadius: BorderRadius.circular(10)),
child: DottedBorder(
strokeWidth: 2,
padding: EdgeInsets.symmetric(vertical: 16.toScreenHeight, horizontal: 16.toScreenWidth),
color: context.isDark ? AppColor.primary40 : AppColor.primary60,
dashPattern: const [4, 3],
radius: const Radius.circular(10),
borderType: BorderType.RRect,
child: title.heading6(context).custom(color: context.isDark ? AppColor.primary40 : AppColor.primary60).center,
),
).onPress(onPressed);
}
}