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:
Taha Tesser
2023-02-27 20:52:00 +02:00
committed by GitHub
parent 5c334d10df
commit 9a4e897965
35 changed files with 828 additions and 304 deletions

View File

@@ -2,37 +2,34 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flutter code sample for [IndexedStack.].
// Flutter code sample for [IndexedStack].
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
void main() => runApp(const IndexedStackApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
static const String _title = 'Flutter Code Sample';
class IndexedStackApp extends StatelessWidget {
const IndexedStackApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: _title,
home: Scaffold(
appBar: AppBar(title: const Text(_title)),
body: const MyStatefulWidget(),
appBar: AppBar(title: const Text('IndexedStack Sample')),
body: const IndexedStackExample(),
),
);
}
}
class MyStatefulWidget extends StatefulWidget {
const MyStatefulWidget({super.key});
class IndexedStackExample extends StatefulWidget {
const IndexedStackExample({super.key});
@override
State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
State<IndexedStackExample> createState() => _IndexedStackExampleState();
}
class _MyStatefulWidgetState extends State<MyStatefulWidget> {
class _IndexedStackExampleState extends State<IndexedStackExample> {
List<String> names = <String>['Dash', 'John', 'Mary'];
int index = 0;
final TextEditingController fieldText = TextEditingController();