Skip to content
Snippets Groups Projects
Commit 051c212a authored by Benoît Harrault's avatar Benoît Harrault
Browse files

Clean/improve application conception

parent 6453219a
No related branches found
No related tags found
1 merge request!6Resolve "Clean application conception"
Pipeline #929 passed
org.gradle.jvmargs=-Xmx1536M org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
app.versionName=0.0.3 app.versionName=0.0.4
app.versionCode=3 app.versionCode=4
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:wordguessing/home_page.dart';
import 'package:wordguessing/game_pick_word.dart'; import 'provider/data.dart';
import 'screens/home.dart';
import 'screens/game_pick_word.dart';
void main() { void main() {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
...@@ -12,12 +15,15 @@ void main() { ...@@ -12,12 +15,15 @@ void main() {
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ChangeNotifierProvider(
create: (BuildContext context) => Data(),
child: Consumer<Data>(builder: (context, data, child) {
return MaterialApp( return MaterialApp(
title: 'Jeux de mots et lettres', title: 'Jeux de mots et lettres',
theme: ThemeData( theme: ThemeData(
primarySwatch: Colors.blue, primarySwatch: Colors.blue,
), ),
home: HomePage(), home: Home(),
onGenerateRoute: (settings) { onGenerateRoute: (settings) {
final args = settings.arguments as Map<String, dynamic>; final args = settings.arguments as Map<String, dynamic>;
...@@ -36,5 +42,7 @@ class MyApp extends StatelessWidget { ...@@ -36,5 +42,7 @@ class MyApp extends StatelessWidget {
return null; return null;
}, },
); );
}),
);
} }
} }
import 'package:flutter/foundation.dart';
class Data extends ChangeNotifier {
}
File moved
import 'dart:math';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../provider/data.dart';
class Home extends StatelessWidget {
static const String id = 'home';
class HomePage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Data _myProvider = Provider.of<Data>(context);
return Scaffold( return Scaffold(
backgroundColor: Colors.blue, backgroundColor: Colors.blue,
body: Center( body: Center(
......
...@@ -74,6 +74,13 @@ packages: ...@@ -74,6 +74,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0" version: "1.3.0"
nested:
dependency: transitive
description:
name: nested
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
path: path:
dependency: transitive dependency: transitive
description: description:
...@@ -81,6 +88,13 @@ packages: ...@@ -81,6 +88,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0" version: "1.8.0"
provider:
dependency: "direct main"
description:
name: provider
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.0"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
...@@ -144,3 +158,4 @@ packages: ...@@ -144,3 +158,4 @@ packages:
version: "2.1.0" version: "2.1.0"
sdks: sdks:
dart: ">=2.12.0-0.0 <3.0.0" dart: ">=2.12.0-0.0 <3.0.0"
flutter: ">=1.16.0"
...@@ -9,6 +9,7 @@ environment: ...@@ -9,6 +9,7 @@ environment:
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
provider: ^5.0.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment