Skip to content
Merged
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
2 changes: 2 additions & 0 deletions dataconnect/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
Expand Down
39 changes: 0 additions & 39 deletions dataconnect/firebase.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,4 @@
{
"flutter": {
"platforms": {
"android": {
"default": {
"projectId": "quickstart-flutter-cc624",
"appId": "1:731568610039:android:2fda8b27330be9447251f2",
"fileOutput": "android/app/google-services.json"
}
},
"ios": {
"default": {
"projectId": "quickstart-flutter-cc624",
"appId": "1:731568610039:ios:e78b43f1d75a77d87251f2",
"uploadDebugSymbols": false,
"fileOutput": "ios/Runner/GoogleService-Info.plist"
}
},
"dart": {
"lib/firebase_options.dart": {
"projectId": "quickstart-flutter-cc624",
"configurations": {
"android": "1:731568610039:android:2fda8b27330be9447251f2",
"ios": "1:731568610039:ios:e78b43f1d75a77d87251f2",
"macos": "1:731568610039:ios:e78b43f1d75a77d87251f2",
"web": "1:731568610039:web:2896847d0f5655fb7251f2",
"windows": "1:731568610039:web:3c1e404f955f0b467251f2"
}
}
},
"macos": {
"default": {
"projectId": "quickstart-flutter-cc624",
"appId": "1:731568610039:ios:e78b43f1d75a77d87251f2",
"uploadDebugSymbols": false,
"fileOutput": "macos/Runner/GoogleService-Info.plist"
}
}
}
},
"dataconnect": { "source": "dataconnect" },
"emulators": { "dataconnect": { "port": 9399 }, "auth": { "port": 9400 } }
}
146 changes: 66 additions & 80 deletions dataconnect/lib/actor_detail.dart
Original file line number Diff line number Diff line change
@@ -1,92 +1,78 @@
import 'package:dataconnect/movie_state.dart';
import 'package:dataconnect/movies_connector/movies.dart';
import 'package:dataconnect/widgets/list_movies.dart';
import 'package:flutter/material.dart';

Check failure on line 1 in dataconnect/lib/actor_detail.dart

View workflow job for this annotation

GitHub Actions / analyze

Target of URI doesn't exist: 'package:flutter/material.dart'.

Try creating the file referenced by the URI, or try using a URI for a file that does exist. See https://dart.dev/diagnostics/uri_does_not_exist to learn more about this problem.

class ActorDetail extends StatefulWidget {
const ActorDetail({super.key, required this.actorId});
import 'movie_state.dart';
import 'widgets/list_movies.dart';

final String actorId;

@override
State<ActorDetail> createState() => _ActorDetailState();
}

class _ActorDetailState extends State<ActorDetail> {
bool loading = true;
GetActorByIdActor? actor;
@override
void initState() {
super.initState();

MovieState.getActorById(widget.actorId).then((value) {
setState(() {
loading = false;
actor = value.data.actor;
});
});
}
class ActorDetail extends StatelessWidget {

Check failure on line 6 in dataconnect/lib/actor_detail.dart

View workflow job for this annotation

GitHub Actions / analyze

Classes can only extend other classes.

Try specifying a different superclass, or removing the extends clause. See https://dart.dev/diagnostics/extends_non_class to learn more about this problem.
const ActorDetail({
super.key,

Check failure on line 8 in dataconnect/lib/actor_detail.dart

View workflow job for this annotation

GitHub Actions / analyze

No associated named super constructor parameter.

Try changing the name to the name of an existing named super constructor parameter, or creating such named parameter. See https://dart.dev/diagnostics/super_formal_parameter_without_associated_named to learn more about this problem.
required this.actorId,
});

_buildActorInfo() {
return [
Align(
alignment: Alignment.centerLeft,
child: Container(
child: Text(
actor!.name,
style: const TextStyle(fontSize: 30),
),
)),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: AspectRatio(
aspectRatio: 9 / 16, // 9:16 aspect ratio for the image
child: Image.network(
actor!.imageUrl,
fit: BoxFit.cover,
),
),
),
]),
];
}

Widget _buildMainRoles() {
return ListMovies(
movies: MovieState.convertMainActorDetail(actor!.mainActors),
title: "Main Roles");
}

Widget _buildSupportingRoles() {
return ListMovies(
movies:
MovieState.convertSupportingActorDetail(actor!.supportingActors),
title: "Supporting Roles");
}
final String actorId;

@override
Widget build(BuildContext context) {

Check warning on line 15 in dataconnect/lib/actor_detail.dart

View workflow job for this annotation

GitHub Actions / analyze

The method doesn't override an inherited method.

Try updating this class to match the superclass, or removing the override annotation. See https://dart.dev/diagnostics/override_on_non_overriding_member to learn more about this problem.

Check failure on line 15 in dataconnect/lib/actor_detail.dart

View workflow job for this annotation

GitHub Actions / analyze

Undefined class 'Widget'.

Try changing the name to the name of an existing class, or creating a class with the name 'Widget'. See https://dart.dev/diagnostics/undefined_class to learn more about this problem.

Check failure on line 15 in dataconnect/lib/actor_detail.dart

View workflow job for this annotation

GitHub Actions / analyze

Undefined class 'BuildContext'.

Try changing the name to the name of an existing class, or creating a class with the name 'BuildContext'. See https://dart.dev/diagnostics/undefined_class to learn more about this problem.
return Scaffold(
body: SafeArea(
child: actor == null
? const Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [CircularProgressIndicator()],
)
: Padding(
padding: const EdgeInsets.all(30),
child: SingleChildScrollView(
child: Column(
return FutureBuilder(

Check failure on line 16 in dataconnect/lib/actor_detail.dart

View workflow job for this annotation

GitHub Actions / analyze

The method 'FutureBuilder' isn't defined for the type 'ActorDetail'.

Try correcting the name to the name of an existing method, or defining a method named 'FutureBuilder'. See https://dart.dev/diagnostics/undefined_method to learn more about this problem.
future: MovieState.getActorById(actorId),
builder: (context, snapshot) {
final actor = snapshot.data?.data.actor;
final loading = snapshot.connectionState == ConnectionState.waiting;

Check failure on line 20 in dataconnect/lib/actor_detail.dart

View workflow job for this annotation

GitHub Actions / analyze

Undefined name 'ConnectionState'.

Try correcting the name to one that is defined, or defining the name. See https://dart.dev/diagnostics/undefined_identifier to learn more about this problem.
return Scaffold(

Check failure on line 21 in dataconnect/lib/actor_detail.dart

View workflow job for this annotation

GitHub Actions / analyze

The method 'Scaffold' isn't defined for the type 'ActorDetail'.

Try correcting the name to the name of an existing method, or defining a method named 'Scaffold'. See https://dart.dev/diagnostics/undefined_method to learn more about this problem.
body: SafeArea(

Check failure on line 22 in dataconnect/lib/actor_detail.dart

View workflow job for this annotation

GitHub Actions / analyze

The method 'SafeArea' isn't defined for the type 'ActorDetail'.

Try correcting the name to the name of an existing method, or defining a method named 'SafeArea'. See https://dart.dev/diagnostics/undefined_method to learn more about this problem.
child: () {
if (actor == null || loading) {
return const Center(

Check failure on line 25 in dataconnect/lib/actor_detail.dart

View workflow job for this annotation

GitHub Actions / analyze

The name 'Center' isn't a class.

Try correcting the name to match an existing class. See https://dart.dev/diagnostics/creation_with_non_type to learn more about this problem.
child: CircularProgressIndicator(),
);
}
return Padding(
padding: const EdgeInsets.all(30),
child: SingleChildScrollView(
child: Column(
children: [
..._buildActorInfo(),
_buildMainRoles(),
_buildSupportingRoles()
Align(
alignment: Alignment.centerLeft,
child: Text(
actor.name,
style: const TextStyle(fontSize: 30),
)),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: AspectRatio(
aspectRatio:
9 / 16, // 9:16 aspect ratio for the image
child: Image.network(
actor.imageUrl,
fit: BoxFit.cover,
),
),
),
],
),
ListMovies(
movies: MovieState.convertMainActorDetail(
actor.mainActors,
),
title: "Main Roles",
),
ListMovies(
movies: MovieState.convertSupportingActorDetail(
actor.supportingActors,
),
title: "Supporting Roles",
),
],
)))),
),
),
);
}(),
),
);
},
);
}
}
39 changes: 24 additions & 15 deletions dataconnect/lib/destination.dart
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
import 'package:flutter/material.dart';

class Destination {
const Destination({required this.label, required this.icon});
final String label;
final IconData icon;
}

class Route {
Route({required this.path, required this.label, required this.iconData});
class Route extends NavigationDestination {
Route({
super.key,
required this.path,
required super.label,
required this.iconData,
}) : super(icon: Icon(iconData));
final String path;
final String label;
final IconData iconData;
}

var homePath = Route(path: '/home', label: 'Home', iconData: Icons.home);
var searchPath =
Route(path: '/search', label: 'Search', iconData: Icons.search);
var profilePath =
Route(path: '/profile', label: 'Profile', iconData: Icons.person);
var paths = [homePath, searchPath, profilePath];
final homePath = Route(
path: '/home',
label: 'Home',
iconData: Icons.home,
);
final searchPath = Route(
path: '/search',
label: 'Search',
iconData: Icons.search,
);
final profilePath = Route(
path: '/profile',
label: 'Profile',
iconData: Icons.person,
);

final paths = [homePath, searchPath, profilePath];
Loading
Loading