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

remove all warnings and remove deprecated widgets and properties #40

Open
wants to merge 1 commit into
base: master
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider","path":"/Users/jideguru/flutterdev/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.11/","dependencies":[]}],"android":[{"name":"path_provider","path":"/Users/jideguru/flutterdev/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.11/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/jideguru/flutterdev/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+3/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/jideguru/flutterdev/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+2/","dependencies":[]}],"windows":[],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]}],"date_created":"2020-10-18 17:02:00.335289","version":"1.23.0-7.0.pre"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_ios","path":"/home/munsif/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_ios-2.0.11/","native_build":true,"dependencies":[]}],"android":[{"name":"path_provider_android","path":"/home/munsif/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_android-2.0.19/","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/home/munsif/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.6/","native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/home/munsif/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.7/","native_build":false,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/home/munsif/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.1.2/","native_build":false,"dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_ios","path_provider_linux","path_provider_macos","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_ios","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2022-08-21 16:50:52.227399","version":"3.0.5"}
39 changes: 37 additions & 2 deletions .metadata
Original file line number Diff line number Diff line change
@@ -1,10 +1,45 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
# This file should be version controlled.

version:
revision: 7a4c33425ddd78c54aba07d86f3f9a4a0051769b
revision: f1875d570e39de09040c8f79aa13cc56baab8db1
channel: stable

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
- platform: android
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
- platform: ios
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
- platform: linux
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
- platform: macos
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
- platform: web
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
- platform: windows
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
28 changes: 28 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
# include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package dev.jideguru.flutter_social_app_ui_kit

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}
12 changes: 12 additions & 0 deletions android/app/src/main/res/drawable-v21/launch_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />

<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
26 changes: 20 additions & 6 deletions lib/util/theme_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,49 @@ class ThemeConfig {
static ThemeData lightTheme = ThemeData(
backgroundColor: lightBG,
primaryColor: lightPrimary,
accentColor: lightAccent,
scaffoldBackgroundColor: lightBG,
appBarTheme: AppBarTheme(
elevation: 0,
textTheme: TextTheme(
toolbarTextStyle: TextTheme(
headline6: TextStyle(
color: darkBG,
fontSize: 18.0,
fontWeight: FontWeight.w800,
),
),
).bodyText2,
titleTextStyle: TextTheme(
headline6: TextStyle(
color: darkBG,
fontSize: 18.0,
fontWeight: FontWeight.w800,
),
).headline6,
),
colorScheme: ColorScheme.fromSwatch().copyWith(secondary: lightAccent),
);

static ThemeData darkTheme = ThemeData(
brightness: Brightness.dark,
backgroundColor: darkBG,
primaryColor: darkPrimary,
accentColor: darkAccent,
scaffoldBackgroundColor: darkBG,
appBarTheme: AppBarTheme(
elevation: 0,
textTheme: TextTheme(
toolbarTextStyle: TextTheme(
headline6: TextStyle(
color: lightBG,
fontSize: 18.0,
fontWeight: FontWeight.w800,
),
).bodyText2,
titleTextStyle: TextTheme(
headline6: TextStyle(
color: lightBG,
fontSize: 18.0,
fontWeight: FontWeight.w800,
),
),
).headline6,
),
colorScheme: ColorScheme.fromSwatch().copyWith(secondary: darkAccent),
);
}
14 changes: 8 additions & 6 deletions lib/views/screens/auth/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:social_app_ui/views/screens/main_screen.dart';
import 'package:social_app_ui/views/widgets/custom_button.dart';
import 'package:social_app_ui/views/widgets/custom_text_field.dart';
import 'package:social_app_ui/util/extensions.dart';

class Login extends StatefulWidget {
@override
_LoginState createState() => _LoginState();
Expand Down Expand Up @@ -38,8 +39,9 @@ class _LoginState extends State<Login> {
}

void showInSnackBar(String value) {
_scaffoldKey.currentState.removeCurrentSnackBar();
_scaffoldKey.currentState.showSnackBar(SnackBar(content: Text(value)));
ScaffoldMessenger.of(context).removeCurrentSnackBar();

ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(value)));
}

@override
Expand Down Expand Up @@ -74,7 +76,7 @@ class _LoginState extends State<Login> {
return AnimatedContainer(
width: screenWidth < 700 ? 0 : screenWidth * 0.5,
duration: Duration(milliseconds: 500),
color: Theme.of(context).accentColor.withOpacity(0.3),
color: Theme.of(context).colorScheme.secondary.withOpacity(0.3),
child: Center(
child: Lottie.asset(
AppAnimations.chatAnimation,
Expand Down Expand Up @@ -111,7 +113,7 @@ class _LoginState extends State<Login> {
SizedBox(height: 10.0),
Align(
alignment: Alignment.centerRight,
child: FlatButton(
child: TextButton(
onPressed: () {
formMode = FormMode.FORGOT_PASSWORD;
setState(() {});
Expand All @@ -130,7 +132,7 @@ class _LoginState extends State<Login> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('Don\'t have an account?'),
FlatButton(
TextButton(
onPressed: () {
formMode = FormMode.REGISTER;
setState(() {});
Expand All @@ -146,7 +148,7 @@ class _LoginState extends State<Login> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('Already have an account?'),
FlatButton(
TextButton(
onPressed: () {
formMode = FormMode.LOGIN;
setState(() {});
Expand Down
4 changes: 2 additions & 2 deletions lib/views/screens/chat/chats.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class _ChatsState extends State<Chats>
],
bottom: TabBar(
controller: _tabController,
indicatorColor: Theme.of(context).accentColor,
labelColor: Theme.of(context).accentColor,
indicatorColor: Theme.of(context).colorScheme.secondary,
labelColor: Theme.of(context).colorScheme.secondary,
unselectedLabelColor: Theme.of(context).textTheme.caption.color,
isScrollable: false,
tabs: <Widget>[
Expand Down
7 changes: 4 additions & 3 deletions lib/views/screens/chat/conversation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class _ConversationState extends State<Conversation> {
IconButton(
icon: Icon(
Icons.add,
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
),
onPressed: () {},
),
Expand All @@ -130,7 +130,8 @@ class _ConversationState extends State<Conversation> {
hintText: "Write your message...",
hintStyle: TextStyle(
fontSize: 15.0,
color: Theme.of(context).textTheme.headline6.color,
color:
Theme.of(context).textTheme.headline6.color,
),
),
maxLines: null,
Expand All @@ -139,7 +140,7 @@ class _ConversationState extends State<Conversation> {
IconButton(
icon: Icon(
Icons.mic,
color: Theme.of(context).accentColor,
color: Theme.of(context).colorScheme.secondary,
),
onPressed: () {},
)
Expand Down
13 changes: 9 additions & 4 deletions lib/views/screens/friends.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,29 @@ class _FriendsState extends State<Friends> {
title: Text(friend['name']),
subtitle: Text(friend['status']),
trailing: friend['isAccept']
? FlatButton(
? TextButton(
child: Text(
"Unfollow",
style: TextStyle(
color: Colors.white,
),
),
color: Colors.grey,
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Colors.grey),
),
onPressed: () {},
)
: FlatButton(
: TextButton(
child: Text(
"Follow",
style: TextStyle(
color: Colors.white,
),
),
color: Theme.of(context).accentColor,
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
Theme.of(context).colorScheme.secondary),
),
onPressed: () {},
),
onTap: () {},
Expand Down
2 changes: 1 addition & 1 deletion lib/views/screens/main_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class _MainScreenState extends State<MainScreen> {
// sets the background color of the `BottomNavigationBar`
canvasColor: Theme.of(context).primaryColor,
// sets the active color of the `BottomNavigationBar` if `Brightness` is light
primaryColor: Theme.of(context).accentColor,
primaryColor: Theme.of(context).colorScheme.secondary,
textTheme: Theme.of(context).textTheme.copyWith(
caption: TextStyle(color: Colors.grey[500]),
),
Expand Down
14 changes: 10 additions & 4 deletions lib/views/screens/profile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,27 @@ class _ProfileState extends State<Profile> {
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
FlatButton(
TextButton(
child: Icon(
Icons.message,
color: Colors.white,
),
color: Colors.grey,
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Colors.grey),
),
onPressed: () {},
),
SizedBox(width: 10),
FlatButton(
TextButton(
child: Icon(
Icons.add,
color: Colors.white,
),
color: Theme.of(context).accentColor,
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
Theme.of(context).colorScheme.secondary,
),
),
onPressed: () {},
),
],
Expand Down
16 changes: 11 additions & 5 deletions lib/views/widgets/chat_bubble.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class _ChatBubbleState extends State<ChatBubble> {

Color chatBubbleColor() {
if (widget.isMe) {
return Theme.of(context).accentColor;
return Theme.of(context).colorScheme.secondary;
} else {
if (Theme.of(context).brightness == Brightness.dark) {
return Colors.grey[800];
Expand Down Expand Up @@ -123,7 +123,8 @@ class _ChatBubbleState extends State<ChatBubble> {
child: Text(
widget.isMe ? "You" : widget.replyName,
style: TextStyle(
color: Theme.of(context).accentColor,
color:
Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
fontSize: 12,
),
Expand All @@ -137,8 +138,10 @@ class _ChatBubbleState extends State<ChatBubble> {
child: Text(
widget.replyText,
style: TextStyle(
color:
Theme.of(context).textTheme.headline6.color,
color: Theme.of(context)
.textTheme
.headline6
.color,
fontSize: 10.0,
),
maxLines: 2,
Expand Down Expand Up @@ -170,7 +173,10 @@ class _ChatBubbleState extends State<ChatBubble> {
style: TextStyle(
color: widget.isMe
? Colors.white
: Theme.of(context).textTheme.headline6.color,
: Theme.of(context)
.textTheme
.headline6
.color,
),
),
)
Expand Down
18 changes: 11 additions & 7 deletions lib/views/widgets/custom_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,18 @@ class CustomButton extends StatelessWidget {
return Container(
height: 50.0,
width: MediaQuery.of(context).size.width,
child: FlatButton(
child: TextButton(
onPressed: onPressed,
color: color ?? Theme.of(context).accentColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
),
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(color) ??
Theme.of(context).colorScheme.secondary,
shape: MaterialStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
),
)),
child: Text(
"$label",
style: TextStyle(
Expand Down
1 change: 1 addition & 0 deletions linux/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
flutter/ephemeral