问:
How to get the value of multidimensional array based on the ID
I have a multidimensional array, i display all of the values in a table using foreach loop. in that table i have an view profile (a href=). what i want to do is to get the array and pass it to another page and display the value of the array based on the id</p>

```<code><?php include_once('fake_db.php'); ?>

<--index.php-->

<div class="widget-body">
<table class="table table-condensed table-striped table-bordered table-hover no-margin">
    <thead>
    <tr>
        <th>Name</th><th>Position</th><th>Action</th>
    </tr>
    </thead>
    <?php foreach($employees as $key => $value){ ?>
        <tr>
            <td><?= $value['name']?></td>
            <td><?= $value['position']; ?></td>
            <td><a href="profile.php?id=<?= $key; ?>">View Profile</a></td>
        </tr>
    <?php } ?>
</table>
</div>

<-- profile.php -->
<h3>Employee Profile : Employee Name</h3>
<a href="index.php">Back to Employee List</a>
<table class="table table-condensed table-striped table-bordered table-hover no-margin">
    <thead>
    <tr>
        <td>Name </td>
        <td>Employee Position</td>
    </tr>
    </thead>
    <tr>

            <td></td>
            <td></td>
    </tr>
</table>

<--fake_db.php-->
<?php

$employees = array
             (
               1 => array("name" => 'Jason Alipala', "employee_id" => 'G1001-05', 'position' => 1),
               2 => array("name" => 'Bryann Revina', "employee_id" => 'G1009-03', 'position' => 2),
               3 => array("name" => 'Jeniel Mangahis', "employee_id" => 'G1009-04', 'position' => 2),
               4 => array("name" => 'Arjay Bussala', "employee_id" => 'G1009-05', 'position' => 3),
               5 => array("name" => 'Ronnel Ines', "employee_id" => 'G1002-06', 'position' => 3)
             );

$emp_positions = array_count_values(array_column($employees, 'position'));

$positions = array(1 => 'TL', 2 => 'Programmer', 3 => 'Converter');

?>

</code>```

答:
you can get you id from your with $_GET[•id']
 and you can check ur id by isset if pass or not...
if(isset($_GET['id'])

thn pass that id to your database or if you passing key of array ..pass that key to array

Body:
I have a multidimensional array, i display all of the values in a table using foreach loop. in that table i have an view profile (a href=). what i want to do is to get the array and pass it to another page and display the value of the array based on the id

<?php include_once('fake_db.php'); ?>

<--index.php-->

        Name	Position	Action

    <?php foreach($employees as $key => $value){ ?>

            <?= $value['name']?>
            <?= $value['position']; ?>
            <a href="profile.php?id=<?= $key; ?>">View Profile

    <?php } ?>

<-- profile.php -->

Employee Profile : Employee Name

Back to Employee List

        Name
        Employee Position

<--fake_db.php-->
<?php

$employees = array
             (
               1 => array("name" => 'Jason Alipala', "employee_id" => 'G1001-05', 'position' => 1),
               2 => array("name" => 'Bryann Revina', "employee_id" => 'G1009-03', 'position' => 2),
               3 => array("name" => 'Jeniel Mangahis', "employee_id" => 'G1009-04', 'position' => 2),
               4 => array("name" => 'Arjay Bussala', "employee_id" => 'G1009-05', 'position' => 3),
               5 => array("name" => 'Ronnel Ines', "employee_id" => 'G1002-06', 'position' => 3)
             );

$emp_positions = array_count_values(array_column($employees, 'position'));

$positions = array(1 => 'TL', 2 => 'Programmer', 3 => 'Converter');

?>


来源: stackexchange

问:
error is occured by delete function (django fbv)
I ran the deletion with the following function

Deletion is succeeded but error occurred

```<code>
def todo_delete (request, pk):
    # template = 'todo / todo_confirm_delete.html'
    todo = get_object_or_404 (Todo, pk = pk)
    todo.delete ()
    Profile.objects.filter (Q (user = request.user.id)). Update (uncompletecount = F ('uncompletecount') - 1)
    print ("todo", todo, delete ')

    return reverse_lazy ('todo: todo_list')

</code>```

error

```<code>
 AttributeError: '__proxy__' object has no attribute 'get'

</code>```

this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error

error

```<code>
(venv) (base) C:\django_inflearn2>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
May 30, 2019 - 14:28:12
Django version 2.2, using settings 'reservation_app.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
[30/May/2019 14:28:12] "GET /todo/ HTTP/1.1" 200 15022
[30/May/2019 14:28:12] "GET /summernote/editor/id_text/ HTTP/1.1" 200 6349
[30/May/2019 14:28:12] "GET /static/summernote/lang/summernote-en-US.min.js?_=1559194092912 HTTP/1.1" 200 27

Traceback (most recent call last):
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
    response = get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\utils\deprecation.py", line 96, in __call__
    response = self.process_response(request, response)
  File "C:\django_inflearn2\venv\lib\site-packages\django\middleware\clickjacking.py", line 26, in process_response
    if response.get('X-Frame-Options') is not None:
AttributeError: '__proxy__' object has no attribute 'get'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
    response = get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\utils\deprecation.py", line 94, in __call__
    response = response or self.get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner
    response = response_for_exception(request, exc)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response
    html = reporter.get_traceback_html()
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html
    t = DEBUG_ENGINE.from_string(fh.read())
UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
    response = get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\utils\deprecation.py", line 94, in __call__
    response = response or self.get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner
    response = response_for_exception(request, exc)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response
    html = reporter.get_traceback_html()
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html
    t = DEBUG_ENGINE.from_string(fh.read())
UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
    response = get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\utils\deprecation.py", line 94, in __call__
    response = response or self.get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner
    response = response_for_exception(request, exc)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response
    html = reporter.get_traceback_html()
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html
    t = DEBUG_ENGINE.from_string(fh.read())
UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
    response = get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\utils\deprecation.py", line 94, in __call__
    response = response or self.get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner
    response = response_for_exception(request, exc)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response
    html = reporter.get_traceback_html()
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html
    t = DEBUG_ENGINE.from_string(fh.read())
UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
    response = get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\utils\deprecation.py", line 94, in __call__
    response = response or self.get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner
    response = response_for_exception(request, exc)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response
    html = reporter.get_traceback_html()
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html
    t = DEBUG_ENGINE.from_string(fh.read())
UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
    response = get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\utils\deprecation.py", line 94, in __call__
    response = response or self.get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner
    response = response_for_exception(request, exc)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response
    html = reporter.get_traceback_html()
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html
    t = DEBUG_ENGINE.from_string(fh.read())
UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\hyunsepk\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
  File "C:\django_inflearn2\venv\lib\site-packages\django\contrib\staticfiles\handlers.py", line 65, in __call__
    return self.application(environ, start_response)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\wsgi.py", line 141, in __call__
    response = self.get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\base.py", line 75, in get_response
    response = self._middleware_chain(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner
    response = response_for_exception(request, exc)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response
    html = reporter.get_traceback_html()
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html
    t = DEBUG_ENGINE.from_string(fh.read())
UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence
[30/May/2019 14:28:17] "GET /todo/60/delete/ HTTP/1.1" 500 59

</code>```

thanks for let me know what is reason for error and how to fix

答:
Your view todo_delete is expecting a html response and you are returning a url.

I believe the purpose of

```<code>return reverse_lazy ('todo: todo_list')
</code>```

is to redirect to some todo_list page.

try to use redirect:

```<code>return redirect(reverse_lazy ('todo: todo_list'))
</code>```

You got the idea. I haven't tested the code but I believe you will understand.

ContentLicense: CC BY-SA 4.0

Body:
I ran the deletion with the following function

Deletion is succeeded but error occurred

def todo_delete (request, pk):
    # template = 'todo / todo_confirm_delete.html'
    todo = get_object_or_404 (Todo, pk = pk)
    todo.delete ()
    Profile.objects.filter (Q (user = request.user.id)). Update (uncompletecount = F ('uncompletecount') - 1)
    print ("todo", todo, delete ')

    return reverse_lazy ('todo: todo_list')

error

 AttributeError: '__proxy__' object has no attribute 'get'

this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error this is error

error

(venv) (base) C:\django_inflearn2>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
May 30, 2019 - 14:28:12
Django version 2.2, using settings 'reservation_app.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
[30/May/2019 14:28:12] "GET /todo/ HTTP/1.1" 200 15022
[30/May/2019 14:28:12] "GET /summernote/editor/id_text/ HTTP/1.1" 200 6349
[30/May/2019 14:28:12] "GET /static/summernote/lang/summernote-en-US.min.js?_=1559194092912 HTTP/1.1" 200 27

Traceback (most recent call last):
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
    response = get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\utils\deprecation.py", line 96, in __call__
    response = self.process_response(request, response)
  File "C:\django_inflearn2\venv\lib\site-packages\django\middleware\clickjacking.py", line 26, in process_response
    if response.get('X-Frame-Options') is not None:
AttributeError: '__proxy__' object has no attribute 'get'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
    response = get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\utils\deprecation.py", line 94, in __call__
    response = response or self.get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner
    response = response_for_exception(request, exc)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response
    html = reporter.get_traceback_html()
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html
    t = DEBUG_ENGINE.from_string(fh.read())
UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
    response = get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\utils\deprecation.py", line 94, in __call__
    response = response or self.get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner
    response = response_for_exception(request, exc)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response
    html = reporter.get_traceback_html()
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html
    t = DEBUG_ENGINE.from_string(fh.read())
UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
    response = get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\utils\deprecation.py", line 94, in __call__
    response = response or self.get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner
    response = response_for_exception(request, exc)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response
    html = reporter.get_traceback_html()
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html
    t = DEBUG_ENGINE.from_string(fh.read())
UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
    response = get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\utils\deprecation.py", line 94, in __call__
    response = response or self.get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner
    response = response_for_exception(request, exc)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response
    html = reporter.get_traceback_html()
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html
    t = DEBUG_ENGINE.from_string(fh.read())
UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
    response = get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\utils\deprecation.py", line 94, in __call__
    response = response or self.get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner
    response = response_for_exception(request, exc)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response
    html = reporter.get_traceback_html()
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html
    t = DEBUG_ENGINE.from_string(fh.read())
UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
    response = get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\utils\deprecation.py", line 94, in __call__
    response = response or self.get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner
    response = response_for_exception(request, exc)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response
    html = reporter.get_traceback_html()
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html
    t = DEBUG_ENGINE.from_string(fh.read())
UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\hyunsepk\AppData\Local\Programs\Python\Python36\lib\wsgiref\handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
  File "C:\django_inflearn2\venv\lib\site-packages\django\contrib\staticfiles\handlers.py", line 65, in __call__
    return self.application(environ, start_response)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\wsgi.py", line 141, in __call__
    response = self.get_response(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\base.py", line 75, in get_response
    response = self._middleware_chain(request)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 36, in inner
    response = response_for_exception(request, exc)
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 90, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "C:\django_inflearn2\venv\lib\site-packages\django\core\handlers\exception.py", line 125, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 94, in technical_500_response
    html = reporter.get_traceback_html()
  File "C:\django_inflearn2\venv\lib\site-packages\django\views\debug.py", line 332, in get_traceback_html
    t = DEBUG_ENGINE.from_string(fh.read())
UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 9735: illegal multibyte sequence
[30/May/2019 14:28:17] "GET /todo/60/delete/ HTTP/1.1" 500 59

thanks for let me know what is reason for error and how to fix

Body:
Your view todo_delete is expecting a html response and you are returning a url.

I believe the purpose of

return reverse_lazy ('todo: todo_list')

is to redirect to some todo_list page.

try to use redirect:

return redirect(reverse_lazy ('todo: todo_list'))

You got the idea. I haven't tested the code but I believe you will understand.


问:
C# MVC Query with WHERE clause and 2 params from the View
I need to query my database with a WHERE clause and pass to parameters from my view to the controller. I am at a total loss as I am a JavaScript and PHP developer and am currently learning dotnet MVC (I am using vs10 framework4).

I need to in essence make this query:

```<code>select * from myTable where column1=16 and column2=24
</code>```

The values of column1 and column2 are in my View.  I have found a million examples on how to pull either a whole table, or a result based upon one parameter, I cannot figure out how to do that simple query.

This seems like a simple task and I would appreciate any help as I have spent 5 hours trying to figure this out.

Here are some key components of my code that will hopefully help someone help me.  I sincerely appreciate any help.

Controller:

```<code>    public class SignBuilderController : Controller
    {

        SignBuilderModel signBuilderModel = new SignBuilderModel();

        //
        // Initialize database entities
        SignBuilderEntities _db;
        public SignBuilderController()
        {
            _db = new SignBuilderEntities();
        }

 //
        // Get /SignBuilder/PrintSetup
        [Authorize]
        public ActionResult PrintSetup()
        {

            var pricesList = signBuilderModel.GetPricingList().ToList();
            return View("PrintSetup", pricesList);

        }

// get Column1 and column 2 query
public ActionResult TestPage(int column1, int column1)
{
     //do something here
     return View();
}
</code>```

And in my View I would retrieve the values for my where clause from input fields.
Example:

```<code><input type="text" name="column1value" id="column1value" />
<input type="text" name="column2value" id="column2value" />
</code>```

Obviously I am using a Model as well, so if that is needed to make this work no problem.  I am really looking for sample code I can use as an example to learn from.  I really appreciate any help, and am about to pull out my hair.

答:
Try this(I assume your view is strongly typed):

```<code>public ActionResult(int column1, int column2)
{
   //do something here.
     var model =
        (
            from p in this.GetPricingList()
            where (p.column1 == column1) && (p.column2 == column2)
            select p
        ).FirstOrDefault();
     return View(model);
}
</code>```

and in the View:

```<code><input type="text" name="column1" id="column1value"  value="<%=Model.column1%>"/>
<input type="text" name="column2" id="column2value"  value="<%=Model.column2%>"/>
</code>```

ContentLicense: CC BY-SA 3.0

Body:
I need to query my database with a WHERE clause and pass to parameters from my view to the controller. I am at a total loss as I am a JavaScript and PHP developer and am currently learning dotnet MVC (I am using vs10 framework4).

I need to in essence make this query:

select * from myTable where column1=16 and column2=24

The values of column1 and column2 are in my View.  I have found a million examples on how to pull either a whole table, or a result based upon one parameter, I cannot figure out how to do that simple query.

This seems like a simple task and I would appreciate any help as I have spent 5 hours trying to figure this out.

Here are some key components of my code that will hopefully help someone help me.  I sincerely appreciate any help.

Controller:

    public class SignBuilderController : Controller
    {

        SignBuilderModel signBuilderModel = new SignBuilderModel();

        //
        // Initialize database entities
        SignBuilderEntities _db;
        public SignBuilderController()
        {
            _db = new SignBuilderEntities();
        }

 //
        // Get /SignBuilder/PrintSetup
        [Authorize]
        public ActionResult PrintSetup()
        {

            var pricesList = signBuilderModel.GetPricingList().ToList();
            return View("PrintSetup", pricesList);

        }

// get Column1 and column 2 query
public ActionResult TestPage(int column1, int column1)
{
     //do something here
     return View();
}

And in my View I would retrieve the values for my where clause from input fields.
Example:

<input type="text" name="column1value" id="column1value" />
<input type="text" name="column2value" id="column2value" />

Obviously I am using a Model as well, so if that is needed to make this work no problem.  I am really looking for sample code I can use as an example to learn from.  I really appreciate any help, and am about to pull out my hair.

Body:
Try this(I assume your view is strongly typed):

public ActionResult(int column1, int column2)
{
   //do something here.
     var model =
        (
            from p in this.GetPricingList()
            where (p.column1 == column1) && (p.column2 == column2)
            select p
        ).FirstOrDefault();
     return View(model);
}

and in the View:

<input type="text" name="column1" id="column1value"  value="<%=Model.column1%>"/>
<input type="text" name="column2" id="column2value"  value="<%=Model.column2%>"/>


问:
Cucumber feature file does not identify the steps
I have written my firsy cucumber feature file. When I run the feature file as Cucumber Feature, I get below errors

"WARNING: Cucumber-JVM's --format option is deprecated. Please use --plugin instead." - I used "plugin" in my @CucumberOptions of runner class, but still getting the same error

2.It says I do not have any scenario and steps
Feature: Validate Modular GUI pages

Scenario: Validate Login Page # C:/Selenium/RegressionTest/ModularRegression/src/GUI/features/Validate.feature:3
    Given: Modular GUI is opened
    When: Validate the login page
    Then: Login to the Modular

0 Scenarios
0 Steps

I'm not getting snippets for my steps.

I have added following jars to the library
Jars

This is my runner class,
package GUI;

```<code>import org.junit.runner.RunWith;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(
        format = {"pretty", "json:target/"},
        features = {"src/GUI/"}
        )
public class GUIRunner {

}
</code>```

This is my feature file,

```<code>Feature: Validate Modular GUI pages

  Scenario: Validate Login Page
    Given: Modular GUI is opened
    When: Validate the login page
    Then: Login to the Modular
</code>```

I would really appreciate if someone can point out what is missing in my code.

Thank you very much

[EDITED]
This is the actual error:

WARNING: Cucumber-JVM's --format option is deprecated. Please use
  --plugin instead. Feature: Validate Modular GUI pages

Scenario: Validate Login Page #
  C:/Selenium/RegressionTest/ModularRegression/src/GUI/features/Validate.feature:3
      Given: Modular GUI is opened
      When: Validate the login page
      Then: Login to the Modular

0 Scenarios 0 Steps 0m0.000s

答: please add  tags= {"@SmokeTest","@RegressionTest"} in @CucumberOptions()

Body:
I have written my firsy cucumber feature file. When I run the feature file as Cucumber Feature, I get below errors

"WARNING: Cucumber-JVM's --format option is deprecated. Please use --plugin instead." - I used "plugin" in my @CucumberOptions of runner class, but still getting the same error

2.It says I do not have any scenario and steps
Feature: Validate Modular GUI pages

Scenario: Validate Login Page # C:/Selenium/RegressionTest/ModularRegression/src/GUI/features/Validate.feature:3
    Given: Modular GUI is opened
    When: Validate the login page
    Then: Login to the Modular

0 Scenarios
0 Steps

I'm not getting snippets for my steps.

I have added following jars to the library
Jars

This is my runner class,
package GUI;

import org.junit.runner.RunWith;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(
        format = {"pretty", "json:target/"},
        features = {"src/GUI/"}
        )
public class GUIRunner {

}

This is my feature file,

Feature: Validate Modular GUI pages

  Scenario: Validate Login Page
    Given: Modular GUI is opened
    When: Validate the login page
    Then: Login to the Modular

I would really appreciate if someone can point out what is missing in my code.

Thank you very much

[EDITED]
This is the actual error:

WARNING: Cucumber-JVM's --format option is deprecated. Please use
  --plugin instead. Feature: Validate Modular GUI pages

Scenario: Validate Login Page #
  C:/Selenium/RegressionTest/ModularRegression/src/GUI/features/Validate.feature:3
      Given: Modular GUI is opened
      When: Validate the login page
      Then: Login to the Modular

0 Scenarios 0 Steps 0m0.000s


问:
The following assertion was thrown during performLayout():
I'm new to flutter and I'm following up with this Udemy course but I face this error when I run the app on Android emulater on windows machine it shows the button on the whole screen

the app simple I'm just trying to get data from the user to store it in s file then print it in the console

My Result

Expected result

My code:-

main.dart

```<code>import 'dart:async';
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:path_provider/path_provider.dart';

void main() async{

  var data = await readData();
  if(data != null){
    print(data);
  }

  runApp(
      MaterialApp(
        title: "IO",
        home: Home(),
      )
  );
}

class Home extends StatefulWidget {
  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {

  var _enterDataField = TextEditingController();
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Read/Write"),
        centerTitle: true,
        backgroundColor: Colors.greenAccent,
      ),
      body: new Container(
        padding: EdgeInsets.all(13.4),
        alignment: Alignment.topCenter,
        child: ListTile(
          title: TextField(
            controller: _enterDataField,
            decoration: InputDecoration(
                labelText: "Input Something"
            ),
          ),
          subtitle: FlatButton(
            color: Colors.redAccent,
            onPressed: (){
              print("Flat button");
              writeData(_enterDataField.text);
            },
            child: new Column(
              children: <Widget>[
                Text("Save Data"),
                Padding(padding: EdgeInsets.all(14.5)),
                Text("Save data goes all"),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

Future<String> get _localPath async {
  final directory = await getApplicationDocumentsDirectory();
  return directory.path; // /home/directory/
}

Future<File> get _localFile async {
  final path = await _localPath;
  return File("$path/data.txt"); // /home/directory/data.txt
}

Future<File> writeData(String message) async {
  final file = await _localFile;
  return file.writeAsString("$message");
}

Future<String> readData() async{
  try{
    final file = await _localFile;
    String data = await file.readAsString();
    return data;
  }catch(e){
    return "Nothing has been saved yet!";
  }
}
</code>```

pubspec.yaml

```<code>version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2
  path_provider: ^1.1.0
</code>```

Error during run:

```<code>Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
Gradle task 'assembleDebug'...
Built build\app\outputs\apk\debug\app-debug.apk.
I/flutter ( 4904): Nothing has been saved yet!
I/Choreographer( 4904): Skipped 105 frames!  The application may be doing too much work on its main thread.
Syncing files to device Android SDK built for x86...
D/EGL_emulation( 4904): eglMakeCurrent: 0xe7085900: ver 3 1 (tinfo 0xe70839b0)
I/flutter ( 4904): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter ( 4904): The following assertion was thrown during performLayout():
I/flutter ( 4904): not implemented
I/flutter ( 4904): 'package:flutter/src/material/input_decorator.dart': Failed assertion: line 977 pos 12: 'false'
I/flutter ( 4904):
I/flutter ( 4904): Either the assertion indicates an error in the framework itself, or we should provide substantially
I/flutter ( 4904): more information in this error message to help you determine and fix the underlying cause.
I/flutter ( 4904): In either case, please report this assertion by filing a bug on GitHub:
I/flutter ( 4904):   https://github.com/flutter/flutter/issues/new?template=BUG.md
I/flutter ( 4904):
I/flutter ( 4904): When the exception was thrown, this was the stack:
I/flutter ( 4904): #2      _RenderDecoration.computeDistanceToActualBaseline (package:flutter/src/material/input_decorator.dart:977:12)
I/flutter ( 4904): #3      RenderBox.getDistanceToActualBaseline.<anonymous closure> (package:flutter/src/rendering/box.dart:1672:50)
I/flutter ( 4904): #4      __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection/runtime/libcompact_hash.dart:281:23)
I/flutter ( 4904): #5      RenderBox.getDistanceToActualBaseline (package:flutter/src/rendering/box.dart:1672:22)
I/flutter ( 4904): #6      _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeDistanceToActualBaseline (package:flutter/src/rendering/proxy_box.dart:97:20)
I/flutter ( 4904): #7      RenderBox.getDistanceToActualBaseline.<anonymous closure> (package:flutter/src/rendering/box.dart:1672:50)
I/flutter ( 4904): #8      __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection/runtime/libcompact_hash.dart:281:23)
I/flutter ( 4904): #9      RenderBox.getDistanceToActualBaseline (package:flutter/src/rendering/box.dart:1672:22)
I/flutter ( 4904): #10     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeDistanceToActualBaseline (package:flutter/src/rendering/proxy_box.dart:97:20)
I/flutter ( 4904): #11     RenderBox.getDistanceToActualBaseline.<anonymous closure> (package:flutter/src/rendering/box.dart:1672:50)
I/flutter ( 4904): #12     __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection/runtime/libcompact_hash.dart:281:23)
I/flutter ( 4904): #13     RenderBox.getDistanceToActualBaseline (package:flutter/src/rendering/box.dart:1672:22)
I/flutter ( 4904): #14     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeDistanceToActualBaseline (package:flutter/src/rendering/proxy_box.dart:97:20)
I/flutter ( 4904): #15     RenderBox.getDistanceToActualBaseline.<anonymous closure> (package:flutter/src/rendering/box.dart:1672:50)
I/flutter ( 4904): #16     __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection/runtime/libcompact_hash.dart:281:23)
I/flutter ( 4904): #17     RenderBox.getDistanceToActualBaseline (package:flutter/src/rendering/box.dart:1672:22)
I/flutter ( 4904): #18     RenderBox.getDistanceToBaseline (package:flutter/src/rendering/box.dart:1655:27)
I/flutter ( 4904): #19     _RenderListTile._boxBaseline (package:flutter/src/material/list_tile.dart:886:16)
I/flutter ( 4904): #20     _RenderListTile.performLayout (package:flutter/src/material/list_tile.dart:945:32)
I/flutter ( 4904): #21     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #22     RenderPadding.performLayout (package:flutter/src/rendering/shifted_box.dart:199:11)
I/flutter ( 4904): #23     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #24     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #25     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #26     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #27     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #28     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #29     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #30     RenderPositionedBox.performLayout (package:flutter/src/rendering/shifted_box.dart:385:13)
I/flutter ( 4904): #31     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #32     RenderPadding.performLayout (package:flutter/src/rendering/shifted_box.dart:199:11)
I/flutter ( 4904): #33     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #34     MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:142:11)
I/flutter ( 4904): #35     _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:339:7)
I/flutter ( 4904): #36     MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:212:7)
I/flutter ( 4904): #37     RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:356:14)
I/flutter ( 4904): #38     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #39     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #40     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #41     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #42     _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1203:11)
I/flutter ( 4904): #43     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #44     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #45     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #46     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #47     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #48     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #49     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #50     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #51     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #52     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #53     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #54     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #55     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #56     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #57     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #58     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #59     RenderOffstage.performLayout (package:flutter/src/rendering/proxy_box.dart:2900:13)
I/flutter ( 4904): #60     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #61     RenderStack.performLayout (package:flutter/src/rendering/stack.dart:510:15)
I/flutter ( 4904): #62     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #63     __RenderTheatre&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #64     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #65     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #66     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #67     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #68     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #69     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #70     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #71     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #72     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #73     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #74     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #75     RenderView.performLayout (package:flutter/src/rendering/view.dart:147:13)
I/flutter ( 4904): #76     RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1509:7)
I/flutter ( 4904): #77     PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:768:18)
I/flutter ( 4904): #78     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:281:19)
I/flutter ( 4904): #79     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:686:13)
I/flutter ( 4904): #80     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:219:5)
I/flutter ( 4904): #81     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
I/flutter ( 4904): #82     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
I/flutter ( 4904): #83     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:751:7)
I/flutter ( 4904): #85     _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
I/flutter ( 4904): #86     _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
I/flutter ( 4904): #87     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
I/flutter ( 4904): (elided 3 frames from class _AssertionError and package dart:async)
I/flutter ( 4904):
I/flutter ( 4904): The following RenderObject was being processed when the exception was fired:
I/flutter ( 4904):   _RenderListTile#c955b relayoutBoundary=up7 NEEDS-LAYOUT NEEDS-PAINT
I/flutter ( 4904):   creator: _ListTile ← MediaQuery ← Padding ← SafeArea ← Semantics ← Listener ← _GestureSemantics ←
I/flutter ( 4904):   RawGestureDetector ← GestureDetector ← InkWell ← ListTile ← Align ← ⋯
I/flutter ( 4904):   parentData: offset=Offset(0.0, 0.0) (can use size)
I/flutter ( 4904):   constraints: BoxConstraints(0.0<=w<=352.6, 0.0<=h<=668.1)
I/flutter ( 4904):   size: MISSING
I/flutter ( 4904): This RenderObject had the following descendants (showing up to depth 5):
I/flutter ( 4904):   RenderSemanticsAnnotations#30cbc relayoutBoundary=up8 NEEDS-PAINT
I/flutter ( 4904):     RenderIgnorePointer#d2ac5 relayoutBoundary=up9 NEEDS-PAINT
I/flutter ( 4904):       RenderPointerListener#95c88 relayoutBoundary=up10 NEEDS-PAINT
I/flutter ( 4904):         _RenderDecoration#d39f5 relayoutBoundary=up11 NEEDS-PAINT
I/flutter ( 4904):           RenderRepaintBoundary#7e8a4 relayoutBoundary=up12 NEEDS-PAINT
I/flutter ( 4904):           RenderTransform#6a1d0 relayoutBoundary=up12 NEEDS-PAINT
I/flutter ( 4904):           RenderConstrainedBox#bd9be relayoutBoundary=up12 NEEDS-PAINT
I/flutter ( 4904):           RenderCustomPaint#862dd NEEDS-PAINT
I/flutter ( 4904):   RenderSemanticsAnnotations#103e3 relayoutBoundary=up8 NEEDS-PAINT
I/flutter ( 4904):     _RenderInputPadding#ab3b4 relayoutBoundary=up9 NEEDS-PAINT
I/flutter ( 4904):       RenderConstrainedBox#39a4f relayoutBoundary=up10 NEEDS-PAINT
I/flutter ( 4904):         RenderPhysicalShape#32f8b relayoutBoundary=up11 NEEDS-PAINT
I/flutter ( 4904):           RenderCustomPaint#5950d relayoutBoundary=up12 NEEDS-PAINT
I/flutter ( 4904): ════════════════════════════════════════════════════════════════════════════════════════════════════
I/flutter ( 4904): Another exception was thrown: RenderBox was not laid out: _RenderListTile#c955b relayoutBoundary=up7 NEEDS-PAINT
I/flutter ( 4904): Another exception was thrown: RenderBox was not laid out: RenderPadding#a1895 relayoutBoundary=up6 NEEDS-PAINT
I/flutter ( 4904): Another exception was thrown: RenderBox was not laid out: RenderSemanticsAnnotations#9585a relayoutBoundary=up5 NEEDS-PAINT
I/flutter ( 4904): Another exception was thrown: RenderBox was not laid out: RenderPointerListener#867ef relayoutBoundary=up4 NEEDS-PAINT
I/flutter ( 4904): Another exception was thrown: 'package:flutter/src/rendering/shifted_box.dart': Failed assertion: line 314 pos 12: 'child.hasSize': is not true.
D/        ( 4904): HostConnection::get() New Host Connection established 0xce8870c0, tid 4923
D/EGL_emulation( 4904): eglMakeCurrent: 0xe569c960: ver 3 1 (tinfo 0xe447f500)
</code>```

答:
Use this.

```<code>Widget _myWidget() {
  return Padding(
    padding: const EdgeInsets.all(24.0),
    child: Column(
      mainAxisSize: MainAxisSize.min,
      crossAxisAlignment: CrossAxisAlignment.start,
      children: <Widget>[
        TextField(decoration: InputDecoration(hintText: "Write Something")),
        Container(
          color: Colors.red,
          width: 200,
          height: 100,
          child: Column(children: <Widget>[
            Text("Save Data"),
            Spacer(),
            Text("Save Data goes here"),
          ],),
        ),
      ],
    ),
  );
}
</code>```

Body:
I'm new to flutter and I'm following up with this Udemy course but I face this error when I run the app on Android emulater on windows machine it shows the button on the whole screen

the app simple I'm just trying to get data from the user to store it in s file then print it in the console

My Result

Expected result

My code:-

main.dart

import 'dart:async';
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:path_provider/path_provider.dart';

void main() async{

  var data = await readData();
  if(data != null){
    print(data);
  }

  runApp(
      MaterialApp(
        title: "IO",
        home: Home(),
      )
  );
}

class Home extends StatefulWidget {
  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {

  var _enterDataField = TextEditingController();
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Read/Write"),
        centerTitle: true,
        backgroundColor: Colors.greenAccent,
      ),
      body: new Container(
        padding: EdgeInsets.all(13.4),
        alignment: Alignment.topCenter,
        child: ListTile(
          title: TextField(
            controller: _enterDataField,
            decoration: InputDecoration(
                labelText: "Input Something"
            ),
          ),
          subtitle: FlatButton(
            color: Colors.redAccent,
            onPressed: (){
              print("Flat button");
              writeData(_enterDataField.text);
            },
            child: new Column(
              children: <Widget>[
                Text("Save Data"),
                Padding(padding: EdgeInsets.all(14.5)),
                Text("Save data goes all"),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

Future<String> get _localPath async {
  final directory = await getApplicationDocumentsDirectory();
  return directory.path; // /home/directory/
}

Future<File> get _localFile async {
  final path = await _localPath;
  return File("$path/data.txt"); // /home/directory/data.txt
}

Future<File> writeData(String message) async {
  final file = await _localFile;
  return file.writeAsString("$message");
}

Future<String> readData() async{
  try{
    final file = await _localFile;
    String data = await file.readAsString();
    return data;
  }catch(e){
    return "Nothing has been saved yet!";
  }
}

pubspec.yaml

version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2
  path_provider: ^1.1.0

Error during run:

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
Gradle task 'assembleDebug'...
Built build\app\outputs\apk\debug\app-debug.apk.
I/flutter ( 4904): Nothing has been saved yet!
I/Choreographer( 4904): Skipped 105 frames!  The application may be doing too much work on its main thread.
Syncing files to device Android SDK built for x86...
D/EGL_emulation( 4904): eglMakeCurrent: 0xe7085900: ver 3 1 (tinfo 0xe70839b0)
I/flutter ( 4904): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter ( 4904): The following assertion was thrown during performLayout():
I/flutter ( 4904): not implemented
I/flutter ( 4904): 'package:flutter/src/material/input_decorator.dart': Failed assertion: line 977 pos 12: 'false'
I/flutter ( 4904):
I/flutter ( 4904): Either the assertion indicates an error in the framework itself, or we should provide substantially
I/flutter ( 4904): more information in this error message to help you determine and fix the underlying cause.
I/flutter ( 4904): In either case, please report this assertion by filing a bug on GitHub:
I/flutter ( 4904):   https://github.com/flutter/flutter/issues/new?template=BUG.md
I/flutter ( 4904):
I/flutter ( 4904): When the exception was thrown, this was the stack:
I/flutter ( 4904): #2      _RenderDecoration.computeDistanceToActualBaseline (package:flutter/src/material/input_decorator.dart:977:12)
I/flutter ( 4904): #3      RenderBox.getDistanceToActualBaseline.<anonymous closure> (package:flutter/src/rendering/box.dart:1672:50)
I/flutter ( 4904): #4      __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection/runtime/libcompact_hash.dart:281:23)
I/flutter ( 4904): #5      RenderBox.getDistanceToActualBaseline (package:flutter/src/rendering/box.dart:1672:22)
I/flutter ( 4904): #6      _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeDistanceToActualBaseline (package:flutter/src/rendering/proxy_box.dart:97:20)
I/flutter ( 4904): #7      RenderBox.getDistanceToActualBaseline.<anonymous closure> (package:flutter/src/rendering/box.dart:1672:50)
I/flutter ( 4904): #8      __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection/runtime/libcompact_hash.dart:281:23)
I/flutter ( 4904): #9      RenderBox.getDistanceToActualBaseline (package:flutter/src/rendering/box.dart:1672:22)
I/flutter ( 4904): #10     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeDistanceToActualBaseline (package:flutter/src/rendering/proxy_box.dart:97:20)
I/flutter ( 4904): #11     RenderBox.getDistanceToActualBaseline.<anonymous closure> (package:flutter/src/rendering/box.dart:1672:50)
I/flutter ( 4904): #12     __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection/runtime/libcompact_hash.dart:281:23)
I/flutter ( 4904): #13     RenderBox.getDistanceToActualBaseline (package:flutter/src/rendering/box.dart:1672:22)
I/flutter ( 4904): #14     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.computeDistanceToActualBaseline (package:flutter/src/rendering/proxy_box.dart:97:20)
I/flutter ( 4904): #15     RenderBox.getDistanceToActualBaseline.<anonymous closure> (package:flutter/src/rendering/box.dart:1672:50)
I/flutter ( 4904): #16     __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection/runtime/libcompact_hash.dart:281:23)
I/flutter ( 4904): #17     RenderBox.getDistanceToActualBaseline (package:flutter/src/rendering/box.dart:1672:22)
I/flutter ( 4904): #18     RenderBox.getDistanceToBaseline (package:flutter/src/rendering/box.dart:1655:27)
I/flutter ( 4904): #19     _RenderListTile._boxBaseline (package:flutter/src/material/list_tile.dart:886:16)
I/flutter ( 4904): #20     _RenderListTile.performLayout (package:flutter/src/material/list_tile.dart:945:32)
I/flutter ( 4904): #21     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #22     RenderPadding.performLayout (package:flutter/src/rendering/shifted_box.dart:199:11)
I/flutter ( 4904): #23     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #24     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #25     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #26     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #27     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #28     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #29     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #30     RenderPositionedBox.performLayout (package:flutter/src/rendering/shifted_box.dart:385:13)
I/flutter ( 4904): #31     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #32     RenderPadding.performLayout (package:flutter/src/rendering/shifted_box.dart:199:11)
I/flutter ( 4904): #33     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #34     MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:142:11)
I/flutter ( 4904): #35     _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:339:7)
I/flutter ( 4904): #36     MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:212:7)
I/flutter ( 4904): #37     RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:356:14)
I/flutter ( 4904): #38     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #39     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #40     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #41     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #42     _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1203:11)
I/flutter ( 4904): #43     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #44     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #45     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #46     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #47     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #48     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #49     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #50     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #51     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #52     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #53     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #54     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #55     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #56     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #57     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #58     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #59     RenderOffstage.performLayout (package:flutter/src/rendering/proxy_box.dart:2900:13)
I/flutter ( 4904): #60     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #61     RenderStack.performLayout (package:flutter/src/rendering/stack.dart:510:15)
I/flutter ( 4904): #62     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #63     __RenderTheatre&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #64     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #65     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #66     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #67     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #68     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #69     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #70     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #71     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #72     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #73     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter ( 4904): #74     RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter ( 4904): #75     RenderView.performLayout (package:flutter/src/rendering/view.dart:147:13)
I/flutter ( 4904): #76     RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1509:7)
I/flutter ( 4904): #77     PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:768:18)
I/flutter ( 4904): #78     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:281:19)
I/flutter ( 4904): #79     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:686:13)
I/flutter ( 4904): #80     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:219:5)
I/flutter ( 4904): #81     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
I/flutter ( 4904): #82     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
I/flutter ( 4904): #83     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:751:7)
I/flutter ( 4904): #85     _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
I/flutter ( 4904): #86     _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
I/flutter ( 4904): #87     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
I/flutter ( 4904): (elided 3 frames from class _AssertionError and package dart:async)
I/flutter ( 4904):
I/flutter ( 4904): The following RenderObject was being processed when the exception was fired:
I/flutter ( 4904):   _RenderListTile#c955b relayoutBoundary=up7 NEEDS-LAYOUT NEEDS-PAINT
I/flutter ( 4904):   creator: _ListTile ← MediaQuery ← Padding ← SafeArea ← Semantics ← Listener ← _GestureSemantics ←
I/flutter ( 4904):   RawGestureDetector ← GestureDetector ← InkWell ← ListTile ← Align ← ⋯
I/flutter ( 4904):   parentData: offset=Offset(0.0, 0.0) (can use size)
I/flutter ( 4904):   constraints: BoxConstraints(0.0<=w<=352.6, 0.0<=h<=668.1)
I/flutter ( 4904):   size: MISSING
I/flutter ( 4904): This RenderObject had the following descendants (showing up to depth 5):
I/flutter ( 4904):   RenderSemanticsAnnotations#30cbc relayoutBoundary=up8 NEEDS-PAINT
I/flutter ( 4904):     RenderIgnorePointer#d2ac5 relayoutBoundary=up9 NEEDS-PAINT
I/flutter ( 4904):       RenderPointerListener#95c88 relayoutBoundary=up10 NEEDS-PAINT
I/flutter ( 4904):         _RenderDecoration#d39f5 relayoutBoundary=up11 NEEDS-PAINT
I/flutter ( 4904):           RenderRepaintBoundary#7e8a4 relayoutBoundary=up12 NEEDS-PAINT
I/flutter ( 4904):           RenderTransform#6a1d0 relayoutBoundary=up12 NEEDS-PAINT
I/flutter ( 4904):           RenderConstrainedBox#bd9be relayoutBoundary=up12 NEEDS-PAINT
I/flutter ( 4904):           RenderCustomPaint#862dd NEEDS-PAINT
I/flutter ( 4904):   RenderSemanticsAnnotations#103e3 relayoutBoundary=up8 NEEDS-PAINT
I/flutter ( 4904):     _RenderInputPadding#ab3b4 relayoutBoundary=up9 NEEDS-PAINT
I/flutter ( 4904):       RenderConstrainedBox#39a4f relayoutBoundary=up10 NEEDS-PAINT
I/flutter ( 4904):         RenderPhysicalShape#32f8b relayoutBoundary=up11 NEEDS-PAINT
I/flutter ( 4904):           RenderCustomPaint#5950d relayoutBoundary=up12 NEEDS-PAINT
I/flutter ( 4904): ════════════════════════════════════════════════════════════════════════════════════════════════════
I/flutter ( 4904): Another exception was thrown: RenderBox was not laid out: _RenderListTile#c955b relayoutBoundary=up7 NEEDS-PAINT
I/flutter ( 4904): Another exception was thrown: RenderBox was not laid out: RenderPadding#a1895 relayoutBoundary=up6 NEEDS-PAINT
I/flutter ( 4904): Another exception was thrown: RenderBox was not laid out: RenderSemanticsAnnotations#9585a relayoutBoundary=up5 NEEDS-PAINT
I/flutter ( 4904): Another exception was thrown: RenderBox was not laid out: RenderPointerListener#867ef relayoutBoundary=up4 NEEDS-PAINT
I/flutter ( 4904): Another exception was thrown: 'package:flutter/src/rendering/shifted_box.dart': Failed assertion: line 314 pos 12: 'child.hasSize': is not true.
D/        ( 4904): HostConnection::get() New Host Connection established 0xce8870c0, tid 4923
D/EGL_emulation( 4904): eglMakeCurrent: 0xe569c960: ver 3 1 (tinfo 0xe447f500)

Body:
Use this.

Widget _myWidget() {
  return Padding(
    padding: const EdgeInsets.all(24.0),
    child: Column(
      mainAxisSize: MainAxisSize.min,
      crossAxisAlignment: CrossAxisAlignment.start,
      children: <Widget>[
        TextField(decoration: InputDecoration(hintText: "Write Something")),
        Container(
          color: Colors.red,
          width: 200,
          height: 100,
          child: Column(children: <Widget>[
            Text("Save Data"),
            Spacer(),
            Text("Save Data goes here"),
          ],),
        ),
      ],
    ),
  );
}


问:
Model not getting assigned values on form submit
I'm new to MVC and have the following ActionMethod in my controller:

```<code> public async Task<ActionResult> ViewSsoProviders(int? page, string nameFilter = "", string bpIdFilter = "",
        string protocolFilter = "")
</code>```

I'm trying to call it through the following form in my view:

```<code>@{
using (Html.BeginForm("ViewSsoProviders", "SsoAdmin", new
{
    page = 1,
    nameFilter = Model.ProviderNameFilter,
    bpIdfilter = Model.BusinessPartnerIdFilter,
    protocolFilter = Model.ProtocolFilterSelection
}))
{
    <div id="providerForm">
        @Html.ValidationSummary()
        <div class="form-group row">
            <span class="col-sm-4">
                @Html.LabelFor(m => m.ProviderNameFilter)
                @Html.TextBoxFor(m => m.ProviderNameFilter, new {@class = "form-control"})
            </span>
            <span class="col-sm-4">
                @Html.LabelFor(m => m.BusinessPartnerIdFilter)
                @Html.TextBoxFor(m => m.BusinessPartnerIdFilter, new {@class = "form-control", style = "display: block"})
            </span>
            <span class="col-sm-4">
                @Html.LabelFor(m => m.ProtocolFilterOptions)
                @Html.TranslatedDropDownListFor(m => m.ProtocolFilterSelection, Model.ProtocolFilterOptions, new {id = "ddlProtocols", @class = "form-control"})
            </span>
        </div>
        <button class="btn" type="submit" value="Filter">@Html.Translate("Filter")</button>
    </div>
</code>```

The method is being hit, however, the filters have not been assigned values, I can hardcode the 'page' variable and it will reach my controller with the correct value, so the issue is not in the routing itself. Is there any obvious reason here why my route variables would be failing to be assigned values?

Edit: It's worth noting that if I instead pass 'null' rather than any routevalues in the view, I can pass a model through to the controller with only the fields on the form assigned data.

答:
You are submitting a form which should be a post. You should have a new method and decorate it with:

```<code>[HttpPost]
</code>```

and parameterize it with another model or view model that holds the properties you need to get.

Ex.

```<code>[HttpPost]
public ActionResult ViewSsoProviders(MyViewModel model)
{
     //Do a redirection to ViewSoProviders
     //ex.
     return RedirectToAction("ViewSsoProviders", new {nameFilter = model.NameFiler, bpIdFilter = model.BpIdFilter, protocolFilter= model.ProtocolFilter });
}
</code>```

And specify the form method on your razor view:

```<code>Html.BeginForm("ViewSsoProviders", "SsoAdmin", FormMethod.Post, new
{
    page = 1,
    nameFilter = Model.ProviderNameFilter,
    bpIdfilter = Model.BusinessPartnerIdFilter,
    protocolFilter = Model.ProtocolFilterSelection
}))
</code>```

Body:
I'm new to MVC and have the following ActionMethod in my controller:

 public async Task<ActionResult> ViewSsoProviders(int? page, string nameFilter = "", string bpIdFilter = "",
        string protocolFilter = "")

I'm trying to call it through the following form in my view:

@{
using (Html.BeginForm("ViewSsoProviders", "SsoAdmin", new
{
    page = 1,
    nameFilter = Model.ProviderNameFilter,
    bpIdfilter = Model.BusinessPartnerIdFilter,
    protocolFilter = Model.ProtocolFilterSelection
}))
{

        @Html.ValidationSummary()

                @Html.LabelFor(m => m.ProviderNameFilter)
                @Html.TextBoxFor(m => m.ProviderNameFilter, new {@class = "form-control"})

                @Html.LabelFor(m => m.BusinessPartnerIdFilter)
                @Html.TextBoxFor(m => m.BusinessPartnerIdFilter, new {@class = "form-control", style = "display: block"})

                @Html.LabelFor(m => m.ProtocolFilterOptions)
                @Html.TranslatedDropDownListFor(m => m.ProtocolFilterSelection, Model.ProtocolFilterOptions, new {id = "ddlProtocols", @class = "form-control"})

        <button class="btn" type="submit" value="Filter">@Html.Translate("Filter")</button>

The method is being hit, however, the filters have not been assigned values, I can hardcode the 'page' variable and it will reach my controller with the correct value, so the issue is not in the routing itself. Is there any obvious reason here why my route variables would be failing to be assigned values?

Edit: It's worth noting that if I instead pass 'null' rather than any routevalues in the view, I can pass a model through to the controller with only the fields on the form assigned data.

Body:
You are submitting a form which should be a post. You should have a new method and decorate it with:

[HttpPost]

and parameterize it with another model or view model that holds the properties you need to get.

Ex.

[HttpPost]
public ActionResult ViewSsoProviders(MyViewModel model)
{
     //Do a redirection to ViewSoProviders
     //ex.
     return RedirectToAction("ViewSsoProviders", new {nameFilter = model.NameFiler, bpIdFilter = model.BpIdFilter, protocolFilter= model.ProtocolFilter });
}

And specify the form method on your razor view:

Html.BeginForm("ViewSsoProviders", "SsoAdmin", FormMethod.Post, new
{
    page = 1,
    nameFilter = Model.ProviderNameFilter,
    bpIdfilter = Model.BusinessPartnerIdFilter,
    protocolFilter = Model.ProtocolFilterSelection
}))


问:
I have created a docker image for python PyQt4 application using ubuntu 14.04 ,now when i run container i wan to access docker host ip and interfaces
I want to get docker host machine ip address and interface names i.e ifconfig of docker host machine. instead im getting docker container ip address on doing ifconfig in docker container.

It would be great if someone tell me to fetch ip address of docker host machine from a docker container.

i have tried doing ifconfig dockerhostname,
as a result i get error
dockerhostmachi: error fetching interface information: Device not found

This is my dockerfile

FROM ubuntu:14.04

Install dependencies

RUN apt-get update && apt-get install -y \
    python-dev \
    libffi-dev \
    libssl-dev \
    python-enum \
    apache2    \
    libapache2-mod-wsgi  \
    python-pip \
    python-qt4

```<code>RUN chmod -R 777 /var/log/apache2/error.log
RUN chmod -R 777 /var/log/apache2/other_vhosts_access.log
RUN chmod -R 777 /var/log/apache2/access.log
RUN chmod -R 777 /var/run/apache2/
</code>```

RUN a2enmod wsgi

i need to get ifconfig result for docker host machine from a docker container or when i run docker image.

答:
The answer to above question is follows .

METHOD :you can create your own network and communicate with it.

$ sudo docker network create --driver=bridge --subnet=192.168.10.0/24      --gateway=192.168.10.1 doc1net

                              or

$ sudo docker network create --driver=bridge --subnet=10.45.0.0/24 --gateway=10.45.0.0 doc1net

Here sub-net and gateway can be your own network address and doc1net is a my network name.

2 METHOD

While running the docker connect with your network host.

$ sudo docker network ls

gives you list of your networks.

$ sudo docker run -it --network=host myimage

Here myimage is name of the image i have created

2nd method worked for me.

Body:
I want to get docker host machine ip address and interface names i.e ifconfig of docker host machine. instead im getting docker container ip address on doing ifconfig in docker container.

It would be great if someone tell me to fetch ip address of docker host machine from a docker container.

i have tried doing ifconfig dockerhostname,
as a result i get error
dockerhostmachi: error fetching interface information: Device not found

This is my dockerfile

FROM ubuntu:14.04

Install dependencies

RUN apt-get update && apt-get install -y \
    python-dev \
    libffi-dev \
    libssl-dev \
    python-enum \
    apache2    \
    libapache2-mod-wsgi  \
    python-pip \
    python-qt4

RUN chmod -R 777 /var/log/apache2/error.log
RUN chmod -R 777 /var/log/apache2/other_vhosts_access.log
RUN chmod -R 777 /var/log/apache2/access.log
RUN chmod -R 777 /var/run/apache2/

RUN a2enmod wsgi

i need to get ifconfig result for docker host machine from a docker container or when i run docker image.


问:
Tried to POST on HTTP/2, but libcurl is connecting on HTTP/1.1
I have developed a client application to connect custom server on HTTP/2 with libcurl. It is working perfectly on Ubuntu 18.04. By the way, in Ubuntu 16.04, it is choosing HTTP/1.1 rather then HTTP/2.

I've found that nghttp2 library is needed to be installed on 16.04, so I installed it, then I found that ALPN is offering h2 also. But eventually it still use HTTP/1.1.

    CURL *curl;
    CURLcode res = curl_global_init(CURL_GLOBAL_DEFAULT);
    if(res != CURLE_OK) {
        fprintf(stderr, "curl_global_init() failed: %s\n",
                curl_easy_strerror(res));
        return 1;
    }

    curl = curl_easy_init();
    if(curl) {
        struct curl_slist *headerList = agent->getHeaderList();

        /* what call to write: */
        curl_easy_setopt(curl, CURLOPT_URL, agent->getUrl().c_str());
        curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerList);
        curl_easy_setopt(curl, CURLOPT_VERBOSE, ASR_CLIENT_DEBUG ? 1L : 0L);

        CURLcode rv;
        do { /* dummy loop, just to break out from */
            rv = curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
            rv = curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
            rv = curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, ConnectAgent::headerCallback);
            rv = curl_easy_setopt(curl, CURLOPT_HEADERDATA, agent);
            rv = curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, ConnectAgent::bodyCallback);
            rv = curl_easy_setopt(curl, CURLOPT_WRITEDATA, agent);

            rv = curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
            rv = curl_easy_setopt(curl, CURLOPT_POST, 1L);
            rv = curl_easy_setopt(curl, CURLOPT_READFUNCTION, ConnectAgent::readToVoiceServerCallback);
            rv = curl_easy_setopt(curl, CURLOPT_READDATA, agent);

            /* Perform the request, res will get the return code */
            res = curl_easy_perform(curl);

            /* Check for errors */
            if(res != CURLE_OK)
                fprintf(stderr, "curl_easy_perform() failed: %s\n",
                        curl_easy_strerror(res));

            /* we are done... */
        } while(0);
        /* always cleanup */
        curl_easy_cleanup(curl);
    }
    curl_global_cleanup();
```

<p>In Ubuntu 16.04, It seems that HTTP2 is ready, but actual connection is on HTTP/1.1</p>

```*   Trying xx.xxx.xxx.xxx...
* Connected to xxx.xxx.xxx.xxx (xx.xxx.xxx.xxx) port xxxxx (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: -----------------------
  CApath: none
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use h2
* Server certificate:
*    subject: C=Unknown; ST=Unknown; L=Unknown; O=Mort Bay Consulting Pty. Ltd.; OU=Jetty; CN=jetty.eclipse.org
*    start date: May 20 11:38:03 2015 GMT
*    expire date: Aug 18 11:38:03 2015 GMT
*    issuer: C=Unknown; ST=Unknown; L=Unknown; O=Mort Bay Consulting Pty. Ltd.; OU=Jetty; CN=jetty.eclipse.org
*    SSL certificate verify result: self signed certificate (18), continuing anyway.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* TCP_NODELAY set
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7f40f00008c0)
> POST /voice HTTP/1.1
```

Built on Ubuntu 18.04 with same source code is working fine with connecting on HTTP/2

答: I have found that it is occurred with curl-7.46 and curl-7.47. When I built library with curl-7.58 and I built my application with it, the problem was solved and it worked.</p>

Body:
I have developed a client application to connect custom server on HTTP/2 with libcurl. It is working perfectly on Ubuntu 18.04. By the way, in Ubuntu 16.04, it is choosing HTTP/1.1 rather then HTTP/2.

I've found that nghttp2 library is needed to be installed on 16.04, so I installed it, then I found that ALPN is offering h2 also. But eventually it still use HTTP/1.1.

    CURL *curl;
    CURLcode res = curl_global_init(CURL_GLOBAL_DEFAULT);
    if(res != CURLE_OK) {
        fprintf(stderr, "curl_global_init() failed: %s\n",
                curl_easy_strerror(res));
        return 1;
    }

    curl = curl_easy_init();
    if(curl) {
        struct curl_slist *headerList = agent->getHeaderList();

        /* what call to write: */
        curl_easy_setopt(curl, CURLOPT_URL, agent->getUrl().c_str());
        curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerList);
        curl_easy_setopt(curl, CURLOPT_VERBOSE, ASR_CLIENT_DEBUG ? 1L : 0L);

        CURLcode rv;
        do { /* dummy loop, just to break out from */
            rv = curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
            rv = curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
            rv = curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, ConnectAgent::headerCallback);
            rv = curl_easy_setopt(curl, CURLOPT_HEADERDATA, agent);
            rv = curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, ConnectAgent::bodyCallback);
            rv = curl_easy_setopt(curl, CURLOPT_WRITEDATA, agent);

            rv = curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
            rv = curl_easy_setopt(curl, CURLOPT_POST, 1L);
            rv = curl_easy_setopt(curl, CURLOPT_READFUNCTION, ConnectAgent::readToVoiceServerCallback);
            rv = curl_easy_setopt(curl, CURLOPT_READDATA, agent);

            /* Perform the request, res will get the return code */
            res = curl_easy_perform(curl);

            /* Check for errors */
            if(res != CURLE_OK)
                fprintf(stderr, "curl_easy_perform() failed: %s\n",
                        curl_easy_strerror(res));

            /* we are done... */
        } while(0);
        /* always cleanup */
        curl_easy_cleanup(curl);
    }
    curl_global_cleanup();

In Ubuntu 16.04, It seems that HTTP2 is ready, but actual connection is on HTTP/1.1

*   Trying xx.xxx.xxx.xxx...
* Connected to xxx.xxx.xxx.xxx (xx.xxx.xxx.xxx) port xxxxx (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: -----------------------
  CApath: none
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use h2
* Server certificate:
*    subject: C=Unknown; ST=Unknown; L=Unknown; O=Mort Bay Consulting Pty. Ltd.; OU=Jetty; CN=jetty.eclipse.org
*    start date: May 20 11:38:03 2015 GMT
*    expire date: Aug 18 11:38:03 2015 GMT
*    issuer: C=Unknown; ST=Unknown; L=Unknown; O=Mort Bay Consulting Pty. Ltd.; OU=Jetty; CN=jetty.eclipse.org
*    SSL certificate verify result: self signed certificate (18), continuing anyway.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* TCP_NODELAY set
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7f40f00008c0)
> POST /voice HTTP/1.1

Built on Ubuntu 18.04 with same source code is working fine with connecting on HTTP/2


问:
Conditional "or" operator in Python is not validating properly
```<code>status= None
if 'Up' or 101 in status:
    print "Inside If statement"
else:
    print "Inside Else Statement"
</code>```

The code flow goes inside "If" loop and prints "Inside If Statement". The status is None actually and by reading the code it should print "Inside Else Statement". I can modify the validation part and make it execute inside else statement. But i would like to know how "True" is returned for this condition

```<code>if 'Up' or 101 in status:
</code>```

答:
Strings in Python are falsy, which is to say an empty string ('') is equivalent to False, and others are True.

Your condition is evaluated as (brackets only for explanatory purpose)

```<code>if ('Up') or (101 in status):
</code>```

And since 'Up' is always True it will always go inside the if block.

You can instead write:

```<code>if 'Up' in status or 101 in status:
</code>```

Or a more generic way with any would be:

```<code>if any(x in status for x in ('Up', 101)):
</code>```

You can find more answers for this in this question

Body:
status= None
if 'Up' or 101 in status:
    print "Inside If statement"
else:
    print "Inside Else Statement"

The code flow goes inside "If" loop and prints "Inside If Statement". The status is None actually and by reading the code it should print "Inside Else Statement". I can modify the validation part and make it execute inside else statement. But i would like to know how "True" is returned for this condition

if 'Up' or 101 in status:

Body:
Strings in Python are falsy, which is to say an empty string ('') is equivalent to False, and others are True.

Your condition is evaluated as (brackets only for explanatory purpose)

if ('Up') or (101 in status):

And since 'Up' is always True it will always go inside the if block.

You can instead write:

if 'Up' in status or 101 in status:

Or a more generic way with any would be:

if any(x in status for x in ('Up', 101)):

You can find more answers for this in this question