From 2ed45715e8da54247fb74f1c3b7e60eab6444973 Mon Sep 17 00:00:00 2001 From: Jeff Neet Date: Sat, 3 Oct 2020 12:22:43 -0600 Subject: [PATCH] Step 4 - log button click --- ios/Flutter/flutter_export_environment.sh | 15 +++++++++ lib/main.dart | 37 ++++++++++++++++++++++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 ios/Flutter/flutter_export_environment.sh diff --git a/ios/Flutter/flutter_export_environment.sh b/ios/Flutter/flutter_export_environment.sh new file mode 100644 index 0000000..332b843 --- /dev/null +++ b/ios/Flutter/flutter_export_environment.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# This is a generated file; do not edit or check into version control. +export "FLUTTER_ROOT=C:\tools\flutter" +export "FLUTTER_APPLICATION_PATH=D:\git\complete-flutter-dev-bootcamp\magic-8-ball-flutter" +export "FLUTTER_TARGET=lib\main.dart" +export "FLUTTER_BUILD_DIR=build" +export "SYMROOT=${SOURCE_ROOT}/../build\ios" +export "OTHER_LDFLAGS=$(inherited) -framework Flutter" +export "FLUTTER_FRAMEWORK_DIR=C:\tools\flutter\bin\cache\artifacts\engine\ios" +export "FLUTTER_BUILD_NAME=1.0.0" +export "FLUTTER_BUILD_NUMBER=1" +export "DART_OBFUSCATION=false" +export "TRACK_WIDGET_CREATION=false" +export "TREE_SHAKE_ICONS=false" +export "PACKAGE_CONFIG=.packages" diff --git a/lib/main.dart b/lib/main.dart index a2c1e78..8229e03 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,6 +2,41 @@ import 'package:flutter/material.dart'; void main() => runApp( MaterialApp( - home: null, + home: BallPage(), ), ); + +class BallPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + backgroundColor: Colors.blue.shade900, + title: Text('Ask Me Anything'), + ), + body: Ball(), + backgroundColor: Colors.blue, + ); + } +} + +class Ball extends StatefulWidget { + @override + _BallState createState() => _BallState(); +} + +class _BallState extends State { + @override + Widget build(BuildContext context) { + return Container( + child: Center( + child: FlatButton( + child: Image.asset('images/ball1.png'), + onPressed: () { + print('I got clicked'); + }, + ), + ), + ); + } +}