Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get starter-project branch working with the latest sdk #8

Open
wants to merge 1 commit into
base: starter-project
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import 'package:flutter/material.dart';

void main() {
runApp(MyApp());
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({super.key});

// This widget is the root of your application.
@override
Widget build(BuildContext context) {
Expand All @@ -21,18 +23,14 @@ class MyApp extends StatelessWidget {
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.blue,
// This makes the visual density adapt to the platform that you run
// the app on. For desktop platforms, the controls will be smaller and
// closer together (more dense) than on mobile platforms.
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
const MyHomePage({super.key, required this.title});

// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
Expand All @@ -46,7 +44,7 @@ class MyHomePage extends StatefulWidget {
final String title;

@override
_MyHomePageState createState() => _MyHomePageState();
State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
Expand Down Expand Up @@ -97,20 +95,20 @@ class _MyHomePageState extends State<MyHomePage> {
// horizontal).
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
const Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
style: Theme.of(context).textTheme.headlineMedium,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add),
child: const Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
Expand Down
17 changes: 8 additions & 9 deletions lib/models/post_model.dart
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import 'package:meta/meta.dart';
import 'package:flutter_facebook_responsive_ui/models/models.dart';

class Post {
final User user;
final String caption;
final String timeAgo;
final String imageUrl;
final String? imageUrl;
final int likes;
final int comments;
final int shares;

const Post({
@required this.user,
@required this.caption,
@required this.timeAgo,
@required this.imageUrl,
@required this.likes,
@required this.comments,
@required this.shares,
required this.user,
required this.caption,
required this.timeAgo,
this.imageUrl,
required this.likes,
required this.comments,
required this.shares,
});
}
5 changes: 2 additions & 3 deletions lib/models/story_model.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:meta/meta.dart';
import 'package:flutter_facebook_responsive_ui/models/models.dart';

class Story {
Expand All @@ -7,8 +6,8 @@ class Story {
final bool isViewed;

const Story({
@required this.user,
@required this.imageUrl,
required this.user,
required this.imageUrl,
this.isViewed = false,
});
}
6 changes: 2 additions & 4 deletions lib/models/user_model.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import 'package:meta/meta.dart';

class User {
final String name;
final String imageUrl;

const User({
@required this.name,
@required this.imageUrl,
required this.name,
required this.imageUrl,
});
}
43 changes: 25 additions & 18 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.2"
version: "2.9.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.0"
cached_network_image:
dependency: "direct main"
description:
Expand All @@ -28,7 +28,7 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "1.2.1"
charcode:
dependency: transitive
description:
Expand All @@ -42,14 +42,14 @@ packages:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "1.1.1"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.13"
version: "1.16.0"
convert:
dependency: transitive
description:
Expand Down Expand Up @@ -77,7 +77,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.3.1"
file:
dependency: transitive
description:
Expand Down Expand Up @@ -129,7 +129,14 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.8"
version: "0.12.12"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
material_design_icons_flutter:
dependency: "direct main"
description:
Expand All @@ -143,14 +150,14 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.8"
version: "1.8.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.8.2"
path_provider:
dependency: transitive
description:
Expand Down Expand Up @@ -225,7 +232,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.9.1"
sqflite:
dependency: transitive
description:
Expand All @@ -246,21 +253,21 @@ packages:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.5"
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.1"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
version: "1.1.1"
synchronized:
dependency: transitive
description:
Expand All @@ -274,14 +281,14 @@ packages:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.17"
version: "0.4.14"
typed_data:
dependency: transitive
description:
Expand All @@ -302,7 +309,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
version: "2.1.4"
xdg_directories:
dependency: transitive
description:
Expand All @@ -311,5 +318,5 @@ packages:
source: hosted
version: "0.1.0"
sdks:
dart: ">=2.9.0-14.0.dev <3.0.0"
flutter: ">=1.12.13+hotfix.5 <2.0.0"
dart: ">=2.19.0-240.0.dev <3.0.0"
flutter: ">=1.12.13+hotfix.5"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
sdk: '>=2.7.0 <3.0.0'
sdk: '>=2.19.0-240.0.dev <3.0.0'

dependencies:
flutter:
Expand Down