Program/Flutter

SingleChildScrollView

하랑파파♡ 2019. 9. 2. 10:53
728x90
반응형
SMALL

#SingleChildScrollView

단일 widget 스크롤 있는 Box

위젯은 일반적으로 사용 있는 단일 Box 있을 유용함.

 

참고 : https://api.flutter.dev/flutter/widgets/SingleChildScrollView-class.html

 

SingleChildScrollView class - widgets library - Dart API

A box in which a single widget can be scrolled. This widget is useful when you have a single box that will normally be entirely visible, for example a clock face in a time picker, but you need to make sure it can be scrolled if the container gets too small

api.flutter.dev

 

ex)


import 'package:flutter/material.dart';

class ScrollView extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Material(
      child: new Container(
        child: new SingleChildScrollView(
          child: new ConstrainedBox(
            constraints: new BoxConstraints(),
            child: new Column(
              children: <Widget>[
                new Image.network(
                  'https://github.com/flutter/website/blob/master/_includes/code/layout/lakes/images/lake.jpg?raw=true',
                ),
                new Container(
                  padding: EdgeInsets.only(
                    left: 16.0,
                    right: 16.0,
                    top: 16.0,
                    bottom: 16.0,
                  ),
                  color: Colors.grey,
                  child: new Text(
                    'Cast Light life style Here',
                    textDirection: TextDirection.ltr,
                    style: new TextStyle(
                      fontSize: 40.0,
                      fontWeight: FontWeight.bold,
                      color: Colors.black,
                    ),
                  ),
                ),
                new Container(
                  child: new Text(
                    'Hi There ? this is sample plaid app using flutter sdk and dart programming language, devceloper is Hammad Tariq'
                    'this is sample Flutter app example Code'
                    'Flutter Column Widget scrollable using SingleChildScrollView'
                    'I am just loving Flutter SDK'
                    'Flutter scrollview example using Single Child Scroll View'
                    'flutter fixing bottom overflow by xx pixels in flutter'
                    'Flutter scrollable layout example'
                    'Flutter app SingleChildScrollView Example ',
                    textDirection: TextDirection.ltr,
                    style: new TextStyle(
                      fontSize: 20.0,
                      fontWeight: FontWeight.bold,
                      color: Colors.pink,
                    ),
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
728x90
반응형
LIST

'Program > Flutter' 카테고리의 다른 글

Dart 기본 문법  (0) 2020.07.08
Flutter Card Widget Sample  (0) 2019.10.02
Flutter Focus on a Text Field  (0) 2018.11.14
Flutter Create and style a text field  (0) 2018.11.14
Flutter Form Validation  (0) 2018.11.14