'How to implement search page via TextField in Flutter?

I need to make a search page. Made by means of TextField a field on clicking on which the page of search should open. Tell me how to implement clicking on the TextField and so that the back button appears on the left and the buttons disappear on the right?

code

TextFormField(
                style: constants.Styles.textFieldTextStyleWhite,
                cursorColor: Colors.white,
                decoration: InputDecoration(
                    contentPadding: const EdgeInsets.only(
                      top: 15, // HERE THE IMPORTANT PART
                    ),
                    border: InputBorder.none,
                    prefixIcon: Align(
                        alignment: Alignment.centerLeft,
                        child: SvgPicture.asset(
                          constants.Assets.search,
                          width: 20,
                          height: 20,
                        ))),
              )

Normal state

enter image description here

After clicking on the line

enter image description here



Solution 1:[1]

As @PaulMcKenzie has stated, there isn't a single best way to do something.

For zero initializing the entire array, you can probably use aggregate initialization method.

std::array<std::array<int, N>, N> arr{0};

This method only works for zero-initialization of the array.

But if you want to initialize the array with a custom number throughout, you would need to iterate through all the elements and assign them manually.

std::array<std::array<int, N>, N> arr;

for(auto& row : arr)
  for(auto& i : row)
    i = -1;

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 alphapanda