Skip to content

Commit

Permalink
⬆️ Upgrade packages dependencies.
Browse files Browse the repository at this point in the history
🩹 Fix deprecated code
  • Loading branch information
TheAlphamerc committed May 27, 2023
1 parent 223a8a5 commit 8461982
Show file tree
Hide file tree
Showing 23 changed files with 732 additions and 580 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 32
compileSdkVersion 33

lintOptions {
disable 'InvalidPackage'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.thealphamerc.flutter_twitter_clone_dev"
applicationId "com.thealphamerc.flutter_twitter_clone"
minSdkVersion 20
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.thealphamerc.flutter_twitter_clone_dev">
package="com.thealphamerc.flutter_twitter_clone">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.thealphamerc.flutter_twitter_clone_dev">
package="com.thealphamerc.flutter_twitter_clone">

<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.2.0'
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.google.gms:google-services:4.3.10'
}
}
Expand Down
6 changes: 3 additions & 3 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Jun 23 08:50:38 CEST 2017
#Mon Aug 01 13:36:21 IST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
zipStoreBase=GRADLE_USER_HOME
5 changes: 3 additions & 2 deletions lib/helper/utility.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:intl/intl.dart';
import 'package:share/share.dart';
import 'package:share_plus/share_plus.dart';
import 'package:url_launcher/url_launcher.dart';

import '../widgets/newWidget/customLoader.dart';
Expand Down Expand Up @@ -271,7 +271,8 @@ class Utility {

static shareFile(List<String> path, {String text = ""}) {
try {
Share.shareFiles(path, text: text);
final files = path.map((path) => XFile(path)).toList();
Share.shareXFiles(files, text: text);
} catch (error) {
print(error);
}
Expand Down
10 changes: 5 additions & 5 deletions lib/state/feedState.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import 'package:flutter_twitter_clone/helper/utility.dart';
import 'package:flutter_twitter_clone/model/user.dart';
import 'package:flutter_twitter_clone/state/appState.dart';
import 'package:flutter_twitter_clone/ui/page/common/locator.dart';
import 'package:link_preview_generator/link_preview_generator.dart'
show WebInfo;
// import 'package:link_preview_generator/link_preview_generator.dart'
// show WebInfo;
import 'package:path/path.dart' as path;
import 'package:translator/translator.dart';
// import 'package:flutter_chat_types/flutter_chat_types.dart' show PreviewData;
Expand Down Expand Up @@ -76,9 +76,9 @@ class FeedState extends AppState {
return list;
}

Map<String, WebInfo> _linkWebInfos = {};
Map<String, WebInfo> get linkWebInfos => _linkWebInfos;
void addWebInfo(String url, WebInfo webInfo) {
Map<String, dynamic> _linkWebInfos = {};
Map<String, dynamic> get linkWebInfos => _linkWebInfos;
void addWebInfo(String url, dynamic webInfo) {
_linkWebInfos.addAll({url: webInfo});
}

Expand Down
2 changes: 1 addition & 1 deletion lib/ui/page/common/splash.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'package:flutter_twitter_clone/ui/page/Auth/selectAuthMethod.dart';
import 'package:flutter_twitter_clone/ui/page/common/updateApp.dart';
import 'package:flutter_twitter_clone/ui/page/homePage.dart';
import 'package:flutter_twitter_clone/ui/theme/theme.dart';
import 'package:package_info/package_info.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:provider/provider.dart';

class SplashPage extends StatefulWidget {
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/page/feed/composeTweet/composeTweet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class _ComposeTweetReplyPageState extends State<ComposeTweetPage> {
Provider.of<FeedState>(context).isBusy,
isBottomLine: Provider.of<ComposeTweetState>(context).isScrollingDown,
),
backgroundColor: Theme.of(context).backgroundColor,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: Stack(
//!Removed container
children: <Widget>[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class _ComposeBottomIconWidgetState extends State<ComposeBottomIconWidget> {
widget.textEditingController.text.length < 280) {
wordCountColor = Colors.orange;
} else if (widget.textEditingController.text.length >= 280) {
wordCountColor = Theme.of(context).errorColor;
wordCountColor = Theme.of(context).colorScheme.error;
} else {
wordCountColor = Colors.blue;
}
Expand All @@ -53,9 +53,9 @@ class _ComposeBottomIconWidgetState extends State<ComposeBottomIconWidget> {
width: double.infinity,
height: 50,
decoration: BoxDecoration(
border:
Border(top: BorderSide(color: Theme.of(context).dividerColor)),
color: Theme.of(context).backgroundColor),
border: Border(top: BorderSide(color: Theme.of(context).dividerColor)),
color: Theme.of(context).scaffoldBackgroundColor,
),
child: Row(
children: <Widget>[
IconButton(
Expand Down Expand Up @@ -83,9 +83,11 @@ class _ComposeBottomIconWidgetState extends State<ComposeBottomIconWidget> {
child: /*tweet != null &&*/ tweet.length > 289
? Padding(
padding: const EdgeInsets.only(right: 10),
child: customText('${280 - tweet.length}',
style:
TextStyle(color: Theme.of(context).errorColor)),
child: customText(
'${280 - tweet.length}',
style: TextStyle(
color: Theme.of(context).colorScheme.error),
),
)
: Stack(
alignment: Alignment.center,
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/page/feed/feedPostDetail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class _FeedPostDetailState extends State<FeedPostDetail> {
child: Scaffold(
key: scaffoldKey,
floatingActionButton: _floatingActionButton(),
backgroundColor: Theme.of(context).backgroundColor,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: CustomScrollView(
slivers: <Widget>[
SliverAppBar(
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/page/feed/suggestedUsers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class _SuggestedUsersState extends State<SuggestedUsers> {
? null
: BottomAppBar(
child: Container(
color: Theme.of(context).backgroundColor,
color: Theme.of(context).scaffoldBackgroundColor,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/page/message/chatScreenPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class _ChatScreenPageState extends State<ChatScreenPage> {
padding: const EdgeInsets.only(right: 10, left: 10),
child: Text(
Utility.getChatTime(chat.createdAt),
style: Theme.of(context).textTheme.caption!.copyWith(fontSize: 12),
style: Theme.of(context).textTheme.bodySmall,
),
)
],
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/page/profile/qrCode/scanner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class _QrCodeState extends State<QrCode> {
),
borderRadius: BorderRadius.circular(10)),
padding: const EdgeInsets.all(22),
child: QrImage(
child: QrImageView(
data: "fwitter/profile/${widget.user.userId}",
embeddedImageStyle:
QrEmbeddedImageStyle(size: const Size(60, 60)),
Expand Down
90 changes: 46 additions & 44 deletions lib/ui/theme/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,54 @@ part 'text_styles.dart';
part 'extention.dart';

class AppTheme {
static final ThemeData appTheme = ThemeData(
static final ThemeData appTheme = ThemeData.light().copyWith(
scaffoldBackgroundColor: TwitterColor.white,
brightness: Brightness.light,
primaryColor: AppColor.primary,
cardColor: Colors.white,
unselectedWidgetColor: Colors.grey,
bottomSheetTheme: const BottomSheetThemeData(
backgroundColor: AppColor.white,
),
appBarTheme: AppBarTheme(
backgroundColor: TwitterColor.white,
brightness: Brightness.light,
primaryColor: AppColor.primary,
cardColor: Colors.white,
unselectedWidgetColor: Colors.grey,
bottomAppBarColor: Colors.white,
bottomSheetTheme:
const BottomSheetThemeData(backgroundColor: AppColor.white),
appBarTheme: AppBarTheme(
backgroundColor: TwitterColor.white,
iconTheme: IconThemeData(
color: TwitterColor.dodgeBlue,
),
elevation: 0,
// ignore: deprecated_member_use
textTheme: const TextTheme(
headline5: TextStyle(
color: Colors.black, fontSize: 26, fontStyle: FontStyle.normal),
)),
tabBarTheme: TabBarTheme(
labelStyle:
TextStyles.titleStyle.copyWith(color: TwitterColor.dodgeBlue),
unselectedLabelColor: AppColor.darkGrey,
unselectedLabelStyle:
TextStyles.titleStyle.copyWith(color: AppColor.darkGrey),
labelColor: TwitterColor.dodgeBlue,
labelPadding: const EdgeInsets.symmetric(vertical: 12),
),
floatingActionButtonTheme: FloatingActionButtonThemeData(
backgroundColor: TwitterColor.dodgeBlue,
iconTheme: IconThemeData(
color: TwitterColor.dodgeBlue,
),
colorScheme: const ColorScheme(
background: Colors.white,
onPrimary: Colors.white,
onBackground: Colors.black,
onError: Colors.white,
onSecondary: Colors.white,
onSurface: Colors.black,
error: Colors.red,
primary: Colors.blue,
primaryContainer: Colors.blue,
secondary: AppColor.secondary,
secondaryContainer: AppColor.darkGrey,
surface: Colors.white,
brightness: Brightness.light));
elevation: 0,
// ignore: deprecated_member_use
),
bottomAppBarTheme: ThemeData.light().bottomAppBarTheme.copyWith(
color: Colors.white,
elevation: 0,
),
tabBarTheme: TabBarTheme(
labelStyle: TextStyles.titleStyle.copyWith(color: TwitterColor.dodgeBlue),
unselectedLabelColor: AppColor.darkGrey,
unselectedLabelStyle:
TextStyles.titleStyle.copyWith(color: AppColor.darkGrey),
labelColor: TwitterColor.dodgeBlue,
labelPadding: const EdgeInsets.symmetric(vertical: 12),
),
floatingActionButtonTheme: FloatingActionButtonThemeData(
backgroundColor: TwitterColor.dodgeBlue,
),
colorScheme: const ColorScheme(
background: Colors.white,
onPrimary: Colors.white,
onBackground: Colors.black,
onError: Colors.white,
onSecondary: Colors.white,
onSurface: Colors.black,
error: Colors.red,
primary: Colors.blue,
primaryContainer: Colors.blue,
secondary: AppColor.secondary,
secondaryContainer: AppColor.darkGrey,
surface: Colors.white,
brightness: Brightness.light,
),
);

static List<BoxShadow> shadow = <BoxShadow>[
BoxShadow(
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/bottomMenuBar/bottomMenuBar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class _BottomMenubarState extends State<BottomMenubar> {
return Container(
height: 50,
decoration: BoxDecoration(
color: Theme.of(context).bottomAppBarColor,
color: Theme.of(context).bottomAppBarTheme.color,
boxShadow: const [
BoxShadow(
color: Colors.black12, offset: Offset(0, -.1), blurRadius: 0)
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/customAppBar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
child: Container(
color: isBottomLine
? Colors.grey.shade200
: Theme.of(context).backgroundColor,
: Theme.of(context).scaffoldBackgroundColor,
height: 1.0,
),
preferredSize: const Size.fromHeight(0.0),
Expand Down
6 changes: 3 additions & 3 deletions lib/widgets/customWidgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Widget customText(
TextAlign textAlign = TextAlign.justify,
TextOverflow overflow = TextOverflow.visible,
BuildContext? context,
bool softwrap = true,
bool softWrap = true,
int? maxLines,
}) {
if (msg == null) {
Expand All @@ -55,7 +55,7 @@ Widget customText(
} else {
if (context != null && style != null) {
var fontSize =
style.fontSize ?? Theme.of(context).textTheme.bodyText1!.fontSize;
style.fontSize ?? Theme.of(context).textTheme.bodyMedium!.fontSize;
style = style.copyWith(
fontSize: fontSize! - (context.width <= 375 ? 2 : 0),
);
Expand All @@ -65,7 +65,7 @@ Widget customText(
style: style,
textAlign: textAlign,
overflow: overflow,
softWrap: softwrap,
softWrap: softWrap,
key: key,
maxLines: maxLines,
);
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/newWidget/customLoader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CustomLoader {
}

showLoader(context) {
_overlayState = Overlay.of(context)!;
_overlayState = Overlay.of(context);
_buildLoader();
_overlayState!.insert(_overlayEntry!);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/tweet/widgets/tweetImage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class TweetImage extends StatelessWidget {
context.width * (type == TweetType.Detail ? .95 : .8) -
8,
decoration: BoxDecoration(
color: Theme.of(context).backgroundColor,
color: Theme.of(context).scaffoldBackgroundColor,
),
child: AspectRatio(
aspectRatio: 4 / 3,
Expand Down
Loading

0 comments on commit 8461982

Please sign in to comment.