snapshot of https://github.com/flutter/samples.git (main, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Main Branch CI / Test Flutter beta on ubuntu-latest (push) Has been skipped
Main Branch CI / Test Flutter stable on ubuntu-latest (push) Has been skipped
Main Branch CI / Test Flutter beta on macos-latest (push) Has been cancelled
Main Branch CI / Test Flutter stable on macos-latest (push) Has been cancelled
Some checks failed
Main Branch CI / Test Flutter beta on ubuntu-latest (push) Has been skipped
Main Branch CI / Test Flutter stable on ubuntu-latest (push) Has been skipped
Main Branch CI / Test Flutter beta on macos-latest (push) Has been cancelled
Main Branch CI / Test Flutter stable on macos-latest (push) Has been cancelled
This commit is contained in:
53
add_to_app/ios_content_resizing/flutter_module/lib/main.dart
Normal file
53
add_to_app/ios_content_resizing/flutter_module/lib/main.dart
Normal file
@@ -0,0 +1,53 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
void main() {
|
||||
runApp(const ResizeApp());
|
||||
}
|
||||
|
||||
class ResizeApp extends StatefulWidget {
|
||||
const ResizeApp({super.key});
|
||||
|
||||
@override
|
||||
State<ResizeApp> createState() => _ResizeAppState();
|
||||
}
|
||||
|
||||
class _ResizeAppState extends State<ResizeApp> {
|
||||
int _listSize = 1;
|
||||
void _addToList() {
|
||||
setState(() {
|
||||
_listSize++;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
heightFactor: 1,
|
||||
child: Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
for (int i = 0; i < _listSize; i++)
|
||||
Container(
|
||||
color: HSVColor.fromAHSV(1, (10.0 * i), 1, 1).toColor(),
|
||||
height: 50,
|
||||
width: 200,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Flutter Widget $i',
|
||||
style: const TextStyle(fontSize: 16, color: Colors.black),
|
||||
),
|
||||
),
|
||||
),
|
||||
TextButton(onPressed: _addToList, child: Text('Listception!')),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user