build method

  1. @override
dynamic build(
  1. dynamic context,
  2. dynamic ref
)

Implementation

@override
Widget build(BuildContext context, WidgetRef ref) {
  final canPostNews = ref
          .watch(
            hasSpaceWithPermissionProvider('CanPostNews'),
          )
          .valueOrNull ==
      true;

  return Scaffold(
    extendBodyBehindAppBar: true,
    appBar: AppBar(
      elevation: 0,
      backgroundColor: Colors.transparent,
      centerTitle: true,
      actions: <Widget>[
        Visibility(
          visible: canPostNews,
          child: PlusIconWidget(
            onPressed: () => context.pushNamed(Routes.actionAddUpdate.name),
          ),
        ),
      ],
    ),
    body: const NewsWidget(),
  );
}