Skip to content

Instantly share code, notes, and snippets.

@Wizpna
Created July 25, 2019 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wizpna/f6424485fa1a02d4366d5db188f89b8a to your computer and use it in GitHub Desktop.
Save Wizpna/f6424485fa1a02d4366d5db188f89b8a to your computer and use it in GitHub Desktop.
Flutter Web: How to Build a Google Search
import 'package:flutter_web/material.dart';
import 'footerOptions.dart';
import 'googleMenuOptions.dart';
import 'googleSearch.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: MyHomePage(),
theme: ThemeData(
primaryColor: Colors.black,
),
title: 'Google',
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: Column(
children: [
//A Flexible widget controls how a child of a Row, Column, or Flex flexes.
//I gave
Flexible(
flex: 1,
child: GoogleMenuOptions(),
),
Flexible(
flex: 8,
child: GoogleSearch(),
),
Flexible(
flex: 1,
child: FooterOptions(),
),
],
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment