Commit 3d5b8b6c authored by Lila NICKLER's avatar Lila NICKLER

Exercice 1

parent 898ed3ca
org.gradle.jvmargs=-Xmx1536M org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
android.enableR8=true
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class Exercice1 extends StatelessWidget {
Widget build(BuildContext context)
{
var mediaQueryData = MediaQuery.of(context);
return Container(
height:mediaQueryData.size.height - 200 ,
child:Image.network("https://picsum.photos/512/1024"),
);
}
}
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'Exo.dart';
void main() { void main() {
runApp(MyApp()); runApp(MyApp());
} }
...@@ -29,14 +31,9 @@ class MyHomePage extends StatefulWidget { ...@@ -29,14 +31,9 @@ class MyHomePage extends StatefulWidget {
} }
class _MyHomePageState extends State<MyHomePage> { class _MyHomePageState extends State<MyHomePage> {
int _counter = 0; @override
void _incrementCounter() {
setState(() {
_counter++;
});
}
static Exercice1 exo1 = new Exercice1();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
...@@ -48,21 +45,12 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -48,21 +45,12 @@ class _MyHomePageState extends State<MyHomePage> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Text(
'You have pushed the button this many times:', exo1,
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
),
], ],
), ),
), ),
floatingActionButton: FloatingActionButton( // This trailing comma makes auto-formatting nicer for build methods.
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
); );
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment