1// Copyright 2014 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5import 'package:flutter/material.dart';
6
7/// Flutter code sample for [Divider].
8
9void main() => runApp(const DividerExampleApp());
10
11class DividerExampleApp extends StatelessWidget {
12 const DividerExampleApp({super.key});
13
14 @override
15 Widget build(BuildContext context) {
16 return MaterialApp(
17 theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)),
18 home: Scaffold(
19 appBar: AppBar(title: const Text('Divider Sample')),
20 body: const DividerExample(),
21 ),
22 );
23 }
24}
25
26class DividerExample extends StatelessWidget {
27 const DividerExample({super.key});
28
29 @override
30 Widget build(BuildContext context) {
31 return const Center(
32 child: Padding(
33 padding: EdgeInsets.all(16.0),
34 child: Column(
35 children: <Widget>[
36 Expanded(child: Card(child: SizedBox.expand())),
37 Divider(),
38 Expanded(child: Card(child: SizedBox.expand())),
39 ],
40 ),
41 ),
42 );
43 }
44}
45

Provided by KDAB

Privacy Policy
Learn more about Flutter for embedded and desktop on industrialflutter.com