Skip to content

Commit

Permalink
Fixing Warnings: missing consts, unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
luismdsleite committed Apr 26, 2022
1 parent b7d5d4a commit aa6364d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
4 changes: 3 additions & 1 deletion flutter_prototype/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class MyApp extends StatelessWidget {
return MaterialApp(
title: 'FEUPQ',
theme: ThemeData(primarySwatch: Colors.deepOrange),
home: LoginView(),
home: const HomeView(),
);
}
}
Expand Down Expand Up @@ -70,6 +70,8 @@ class HomeView extends StatelessWidget {
}

class LoginView extends StatefulWidget {
const LoginView({Key? key}) : super(key: key);

@override
LoginViewState createState() => LoginViewState();
}
Expand Down
2 changes: 0 additions & 2 deletions flutter_prototype/lib/src/objects/chatmessage.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'package:flutter/cupertino.dart';

class ChatMessage {
String messageContent;
String messageType;
Expand Down
34 changes: 18 additions & 16 deletions flutter_prototype/lib/src/views/chatdetailpage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_code/src/objects/chatmessage.dart';

class ChatDetailPage extends StatefulWidget {
const ChatDetailPage({Key? key}) : super(key: key);

@override
_ChatDetailPageState createState() => _ChatDetailPageState();
}
Expand All @@ -24,26 +26,26 @@ class _ChatDetailPageState extends State<ChatDetailPage> {
backgroundColor: Colors.red,
flexibleSpace: SafeArea(
child: Container(
padding: EdgeInsets.only(right: 16),
padding: const EdgeInsets.only(right: 16),
child: Row(
children: <Widget>[
IconButton(
onPressed: () {
Navigator.pop(context);
},
icon: Icon(
icon: const Icon(
Icons.arrow_back,
color: Colors.black,
),
),
SizedBox(
const SizedBox(
width: 2,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
children: const <Widget>[
Text(
"Chat",
style: TextStyle(height: 3, fontSize: 15),
Expand All @@ -64,12 +66,12 @@ class _ChatDetailPageState extends State<ChatDetailPage> {
ListView.builder(
itemCount: messages.length,
shrinkWrap: true,
padding: EdgeInsets.only(top: 10, bottom: 10),
physics: NeverScrollableScrollPhysics(),
padding: const EdgeInsets.only(top: 10, bottom: 10),
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return Container(
padding:
EdgeInsets.only(left: 16, right: 16, top: 10, bottom: 10),
padding: const EdgeInsets.only(
left: 16, right: 16, top: 10, bottom: 10),
child: Align(
alignment: (messages[index].messageType == "receiver"
? Alignment.topLeft
Expand All @@ -81,10 +83,10 @@ class _ChatDetailPageState extends State<ChatDetailPage> {
? Colors.grey.shade200
: Colors.blue[200]),
),
padding: EdgeInsets.all(16),
padding: const EdgeInsets.all(16),
child: Text(
messages[index].messageContent,
style: TextStyle(fontSize: 15),
style: const TextStyle(fontSize: 15),
),
),
),
Expand All @@ -94,7 +96,7 @@ class _ChatDetailPageState extends State<ChatDetailPage> {
Align(
alignment: Alignment.bottomLeft,
child: Container(
padding: EdgeInsets.only(left: 10, bottom: 10, top: 10),
padding: const EdgeInsets.only(left: 10, bottom: 10, top: 10),
height: 60,
width: double.infinity,
color: Colors.white,
Expand All @@ -109,30 +111,30 @@ class _ChatDetailPageState extends State<ChatDetailPage> {
color: Colors.lightBlue,
borderRadius: BorderRadius.circular(30),
),
child: Icon(
child: const Icon(
Icons.add,
color: Colors.white,
size: 20,
),
),
),
SizedBox(
const SizedBox(
width: 15,
),
Expanded(
const Expanded(
child: TextField(
decoration: InputDecoration(
hintText: "Write message...",
hintStyle: TextStyle(color: Colors.black54),
border: InputBorder.none),
),
),
SizedBox(
const SizedBox(
width: 15,
),
FloatingActionButton(
onPressed: () {},
child: Icon(
child: const Icon(
Icons.send,
color: Colors.white,
size: 18,
Expand Down
2 changes: 1 addition & 1 deletion flutter_prototype/lib/src/views/facility_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class FacilityView extends StatelessWidget {
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => ChatDetailPage()),
MaterialPageRoute(builder: (context) => const ChatDetailPage()),
);
},
),
Expand Down

0 comments on commit aa6364d

Please sign in to comment.