build method

  1. @override
Widget build(
  1. BuildContext context
)
override

Describes the part of the user interface represented by this widget.

The framework calls this method when this widget is inserted into the tree in a given BuildContext and when the dependencies of this widget change.

Implementation

@override
Widget build(BuildContext context) {
  return Container(
    height: context.bottomPadding + kToolbarHeight,
    alignment: Alignment.topCenter,
    child: Padding(
      padding: const EdgeInsets.only(top: 4, right: 16),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.end,
        children: [
          ElevatedButton(
            onPressed: onDone,
            style: ButtonStyle(
              shape: MaterialStateProperty.all(
                const RoundedRectangleBorder(
                  borderRadius: BorderRadius.all(
                    Radius.circular(18),
                  ),
                ),
              ),
              shadowColor: MaterialStateProperty.all(Colors.white),
              backgroundColor: MaterialStateProperty.all(Colors.white),
            ),
            child: isLoading
                ? const CupertinoActivityIndicator()
                : doneButtonChild ??
                    const Row(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: [
                        Row(
                          children: [
                            SizedBox(width: 4),
                            Text(
                              'Add to story',
                              style: TextStyle(
                                color: Colors.black,
                                fontSize: 12,
                              ),
                            ),
                            SizedBox(width: 4),
                            Icon(
                              CupertinoIcons.forward,
                              color: Colors.black,
                              size: 18,
                            ),
                          ],
                        ),
                      ],
                    ),
          ),
        ],
      ),
    ),
  );
}