Skip to content

Instantly share code, notes, and snippets.

@richardshiue
Last active October 28, 2024 15:08
Show Gist options
  • Select an option

  • Save richardshiue/d402ab47c0494afa536548ce10aeb763 to your computer and use it in GitHub Desktop.

Select an option

Save richardshiue/d402ab47c0494afa536548ce10aeb763 to your computer and use it in GitHub Desktop.
bustling-glacier-6043

bustling-glacier-6043

Created with <3 with dartpad.dev.

// Copyright 2019 the Dart project 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 MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
// visualDensity: VisualDensity.standard,
colorSchemeSeed: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
final String title;
const MyHomePage({
super.key,
required this.title,
});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final textController = TextEditingController(text: "hello world");
@override
void dispose() {
textController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Container(
color: Colors.red,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.symmetric(vertical: 10),
child: Text(
'hello world',
style: Theme.of(context).textTheme.bodyMedium,
),
),
SizedBox(
width: 20,
),
Expanded(
child: TextField(
controller: textController,
style: Theme.of(context).textTheme.bodyMedium,
decoration: InputDecoration(
border: InputBorder.none,
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
isDense: true,
isCollapsed: true,
contentPadding: EdgeInsets.symmetric(vertical: 10),
),
),
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment