Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- import './utils/TextStyles.dart' as textStyles;
- class CityScreen extends StatefulWidget {
- @override
- _CityScreenState createState() => _CityScreenState();
- }
- class _CityScreenState extends State<CityScreen> {
- TextEditingController _cityNameController = TextEditingController();
- final snackBar = SnackBar(content: Text('Yay! A SnackBar!'));
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: Text('City Search'),
- centerTitle: true,
- backgroundColor: Colors.green,
- ),
- body: Container(
- alignment: Alignment.topCenter,
- margin: EdgeInsets.all(10.0),
- child: Column(
- children: <Widget>[
- Text(
- 'enter city name',
- style: textStyles.citySearchStyle(),
- ),
- TextField(
- controller: _cityNameController,
- decoration: InputDecoration(
- labelText: 'city name', hintText: 'enter city name duh....'),
- ),
- Padding(
- padding: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
- child: Container(
- child: RaisedButton(
- child: Text(
- 'Search',
- style: textStyles.searchStyle(),
- ),
- onPressed: () => Scaffold.of(context).showSnackBar(snackBar),
- color: Colors.green,
- ),
- ),
- )
- ],
- ),
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement