Add OverflowBox example and update existing examples under basic.dart (#121213)
Add `OverflowBox` example and update existing examples under `basic.dart`
This commit is contained in:
@@ -6,51 +6,46 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
void main() => runApp(const MyApp());
|
||||
void main() => runApp(const PhysicalShapeApp());
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({super.key});
|
||||
|
||||
static const String _title = 'Flutter Code Sample';
|
||||
class PhysicalShapeApp extends StatelessWidget {
|
||||
const PhysicalShapeApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const MaterialApp(
|
||||
title: _title,
|
||||
home: MyStatelessWidget(),
|
||||
return MaterialApp(
|
||||
home: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('PhysicalShape Sample'),
|
||||
),
|
||||
body: const Center(child: PhysicalShapeExample()),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyStatelessWidget extends StatelessWidget {
|
||||
const MyStatelessWidget({super.key});
|
||||
class PhysicalShapeExample extends StatelessWidget {
|
||||
const PhysicalShapeExample({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('PhysicalShape Sample'),
|
||||
return PhysicalShape(
|
||||
elevation: 5.0,
|
||||
clipper: ShapeBorderClipper(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
),
|
||||
body: Center(
|
||||
child: PhysicalShape(
|
||||
elevation: 5.0,
|
||||
clipper: ShapeBorderClipper(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
),
|
||||
color: Colors.orange,
|
||||
child: const SizedBox(
|
||||
height: 200.0,
|
||||
width: 200.0,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Hello, World!',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 20.0,
|
||||
),
|
||||
),
|
||||
color: Colors.orange,
|
||||
child: const SizedBox(
|
||||
height: 200.0,
|
||||
width: 200.0,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Hello, World!',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 20.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user