D1APP-26 radar static items added
This commit is contained in:
parent
8dc35af965
commit
8937970716
|
|
@ -21,6 +21,7 @@ class LightThemeConfig {
|
|||
subtitle2: _subtitle2Text,
|
||||
subtitle1: _subtitle1Text,
|
||||
headline3: _headline3Text,
|
||||
overline: _overlineText,
|
||||
).apply(bodyColor: _black, displayColor: _black);
|
||||
|
||||
static const ColorScheme _colorScheme = ColorScheme(
|
||||
|
|
@ -63,6 +64,10 @@ class LightThemeConfig {
|
|||
fontSize: 13,
|
||||
fontWeight: FontWeight.w400,
|
||||
);
|
||||
static const TextStyle _overlineText = TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w300,
|
||||
);
|
||||
}
|
||||
|
||||
class DarkThemeConfig {
|
||||
|
|
@ -88,6 +93,7 @@ class DarkThemeConfig {
|
|||
subtitle2: _subtitle2Text,
|
||||
subtitle1: _subtitle1Text,
|
||||
headline3: _headline3Text,
|
||||
overline: _overlineText,
|
||||
).apply(bodyColor: text, displayColor: text);
|
||||
|
||||
static const ColorScheme _colorScheme = ColorScheme(
|
||||
|
|
@ -130,10 +136,10 @@ class DarkThemeConfig {
|
|||
fontSize: 13,
|
||||
fontWeight: FontWeight.w400,
|
||||
);
|
||||
|
||||
// Secondary colors
|
||||
static const Color secondaryColor = Color(0XFFD61515);
|
||||
static const Color secondaryDark = Color(0XFF703838);
|
||||
static const TextStyle _overlineText = TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w300,
|
||||
);
|
||||
|
||||
// Grey colors
|
||||
static const Color white = Color(0XFFFFFFFF);
|
||||
|
|
@ -164,7 +170,7 @@ extension DidvanColorScheme on ColorScheme {
|
|||
: const Color(0XFF012348);
|
||||
Color get focusedBorder => brightness == Brightness.dark
|
||||
? const Color(0XFFC8E0F4)
|
||||
: const Color(0XFFE6F3FA);
|
||||
: const Color(0XFF195D80);
|
||||
Color get title => brightness == Brightness.dark
|
||||
? const Color(0XFFD6D6D6)
|
||||
: const Color(0XFF1B3C59);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class _HomeState extends State<Home> with SingleTickerProviderStateMixin {
|
|||
|
||||
@override
|
||||
void initState() {
|
||||
Future.delayed(Duration(milliseconds: 500), () {
|
||||
Future.delayed(const Duration(milliseconds: 400), () {
|
||||
DesignConfig.context = context;
|
||||
DesignConfig.updateSystemUiOverlayStyle();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import 'package:didvan/config/design_config.dart';
|
|||
import 'package:didvan/config/theme_data.dart';
|
||||
import 'package:didvan/pages/home/radar/widgets/categories_gird.dart';
|
||||
import 'package:didvan/pages/home/radar/widgets/categories_list.dart';
|
||||
import 'package:didvan/pages/home/radar/widgets/radar_item.dart';
|
||||
import 'package:didvan/pages/home/radar/widgets/search_field.dart';
|
||||
import 'package:didvan/pages/home/widgets/logo_app_bar.dart';
|
||||
import 'package:didvan/widgets/didvan/text.dart';
|
||||
|
|
@ -33,35 +34,36 @@ class _RadarState extends State<Radar> {
|
|||
return Scaffold(
|
||||
body: Stack(
|
||||
children: [
|
||||
Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
colorScheme: Theme.of(context).colorScheme.copyWith(
|
||||
secondary: Colors.white,
|
||||
),
|
||||
),
|
||||
child: CustomScrollView(
|
||||
controller: _scrollController,
|
||||
slivers: [
|
||||
const SliverToBoxAdapter(child: LogoAppBar()),
|
||||
const SliverPadding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
sliver: SliverToBoxAdapter(
|
||||
child: SearchField(),
|
||||
CustomScrollView(
|
||||
controller: _scrollController,
|
||||
slivers: [
|
||||
const SliverToBoxAdapter(child: LogoAppBar()),
|
||||
const SliverPadding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
sliver: SliverToBoxAdapter(
|
||||
child: SearchField(),
|
||||
),
|
||||
),
|
||||
SliverPadding(
|
||||
padding: const EdgeInsets.only(top: 300, right: 16, bottom: 20),
|
||||
sliver: SliverToBoxAdapter(
|
||||
child: DidvanText(
|
||||
'آخرین رصد',
|
||||
style: Theme.of(context).textTheme.subtitle1,
|
||||
color: Theme.of(context).colorScheme.title,
|
||||
),
|
||||
),
|
||||
SliverPadding(
|
||||
padding:
|
||||
const EdgeInsets.only(top: 300, right: 16, bottom: 20),
|
||||
sliver: SliverToBoxAdapter(
|
||||
child: DidvanText(
|
||||
'آخرین رصد',
|
||||
style: Theme.of(context).textTheme.subtitle1,
|
||||
color: Theme.of(context).colorScheme.title,
|
||||
),
|
||||
),
|
||||
SliverPadding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
sliver: SliverList(
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(_, index) => const RadarItem(),
|
||||
childCount: 10,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
CategoriesRow1(isColapsed: _isColapsed),
|
||||
CategoriesRow2(isColapsed: _isColapsed),
|
||||
|
|
|
|||
|
|
@ -67,10 +67,14 @@ class CategoriesList extends StatelessWidget {
|
|||
width: 100,
|
||||
padding: const EdgeInsets.all(4),
|
||||
alignment: Alignment.center,
|
||||
child: DidvanText(category.title),
|
||||
child: DidvanText(
|
||||
category.title,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).colorScheme.focusedBorder,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Theme.of(context).colorScheme.title,
|
||||
color: Theme.of(context).colorScheme.focusedBorder,
|
||||
),
|
||||
borderRadius: DesignConfig.lowBorderRadius,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class CategoryItem extends StatelessWidget {
|
|||
decoration: BoxDecoration(
|
||||
borderRadius: DesignConfig.lowBorderRadius,
|
||||
border: isColapsed
|
||||
? Border.all(color: Theme.of(context).colorScheme.title)
|
||||
? Border.all(color: Theme.of(context).colorScheme.focusedBorder)
|
||||
: null,
|
||||
),
|
||||
child: Column(
|
||||
|
|
|
|||
|
|
@ -0,0 +1,84 @@
|
|||
import 'package:didvan/config/design_config.dart';
|
||||
import 'package:didvan/config/theme_data.dart';
|
||||
import 'package:didvan/constants/app_icons.dart';
|
||||
import 'package:didvan/widgets/didvan/card.dart';
|
||||
import 'package:didvan/widgets/didvan/divider.dart';
|
||||
import 'package:didvan/widgets/didvan/text.dart';
|
||||
import 'package:didvan/widgets/skeletun_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class RadarItem extends StatelessWidget {
|
||||
const RadarItem({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DidvanCard(
|
||||
margin: const EdgeInsets.only(bottom: 20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(4),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
borderRadius: DesignConfig.highBorderRadius,
|
||||
),
|
||||
child: DidvanText(
|
||||
'برای مدیران',
|
||||
style: Theme.of(context).textTheme.overline,
|
||||
color: Theme.of(context).colorScheme.white,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const DidvanText(
|
||||
'نقش مهم فولاد در اقتصاد جهانی',
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const SkeletonImage(
|
||||
imageUrl: 'https://wallpapercave.com/wp/wp9373116.jpg',
|
||||
width: double.infinity,
|
||||
height: 140,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
DidvanText(
|
||||
'رادار کسب و کار',
|
||||
style: Theme.of(context).textTheme.overline,
|
||||
color: Theme.of(context).colorScheme.caption,
|
||||
),
|
||||
const Spacer(),
|
||||
DidvanText(
|
||||
'هفته پیش | خواندن 5 دقیقه',
|
||||
style: Theme.of(context).textTheme.overline,
|
||||
color: Theme.of(context).colorScheme.caption,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const DidvanText(
|
||||
'صنعت فولاد جوادی مجد سلیمی است پس باید به آن توجه زیادی شود تا بازار به انفجار نرسد. پس جواد مهربانگو باشیم...',
|
||||
maxLine: 3,
|
||||
),
|
||||
const DidvanDivider(),
|
||||
Row(
|
||||
children: const [
|
||||
Icon(
|
||||
DidvanIcons.bookmark_regular,
|
||||
),
|
||||
Spacer(),
|
||||
DidvanText('2'),
|
||||
SizedBox(width: 4),
|
||||
Icon(DidvanIcons.chats_regular),
|
||||
SizedBox(width: 16),
|
||||
DidvanText('10'),
|
||||
SizedBox(width: 4),
|
||||
Icon(DidvanIcons.evaluation_regular),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,4 @@
|
|||
import 'package:didvan/config/design_config.dart';
|
||||
import 'package:didvan/config/theme_data.dart';
|
||||
import 'package:didvan/main.dart';
|
||||
import 'package:didvan/pages/splash/splash_state.dart';
|
||||
import 'package:didvan/providers/theme_provider.dart';
|
||||
import 'package:didvan/routes/routes.dart';
|
||||
import 'package:didvan/services/app_initalizer.dart';
|
||||
|
|
|
|||
|
|
@ -3,12 +3,20 @@ import 'package:flutter/material.dart';
|
|||
|
||||
class DidvanCard extends StatelessWidget {
|
||||
final Widget child;
|
||||
const DidvanCard({Key? key, required this.child}) : super(key: key);
|
||||
final EdgeInsets? padding;
|
||||
final EdgeInsets? margin;
|
||||
const DidvanCard(
|
||||
{Key? key,
|
||||
required this.child,
|
||||
this.padding = const EdgeInsets.all(16),
|
||||
this.margin})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
padding: padding,
|
||||
margin: margin,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: DesignConfig.lowBorderRadius,
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ class DidvanText extends StatelessWidget {
|
|||
final FontWeight? fontWeight;
|
||||
final double? fontSize;
|
||||
final TextAlign textAlign;
|
||||
final int? maxLine;
|
||||
|
||||
const DidvanText(
|
||||
this.text, {
|
||||
|
|
@ -16,6 +17,7 @@ class DidvanText extends StatelessWidget {
|
|||
this.fontSize,
|
||||
this.fontWeight,
|
||||
this.textAlign = TextAlign.right,
|
||||
this.maxLine,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
|
|
@ -28,6 +30,7 @@ class DidvanText extends StatelessWidget {
|
|||
fontSize: fontSize,
|
||||
),
|
||||
textAlign: textAlign,
|
||||
maxLines: maxLine,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class DidvanProgressIndicator extends StatelessWidget {
|
||||
const DidvanProgressIndicator({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:didvan/config/design_config.dart';
|
||||
import 'package:didvan/config/theme_data.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:skeleton_text/skeleton_text.dart';
|
||||
|
||||
class SkeletonImage extends StatelessWidget {
|
||||
final String imageUrl;
|
||||
final double width;
|
||||
final double height;
|
||||
final BorderRadius? borderRadius;
|
||||
const SkeletonImage({
|
||||
Key? key,
|
||||
required this.imageUrl,
|
||||
required this.width,
|
||||
required this.height,
|
||||
this.borderRadius,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CachedNetworkImage(
|
||||
width: width,
|
||||
height: height,
|
||||
imageUrl: imageUrl,
|
||||
imageBuilder: (context, imageProvider) => Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: borderRadius ?? DesignConfig.lowBorderRadius,
|
||||
image: DecorationImage(
|
||||
image: imageProvider,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
progressIndicatorBuilder: (context, url, progress) => SkeletonAnimation(
|
||||
shimmerColor: Theme.of(context).colorScheme.border,
|
||||
borderRadius: borderRadius ?? DesignConfig.lowBorderRadius,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.disabledBackground,
|
||||
),
|
||||
height: height,
|
||||
width: width,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
93
pubspec.lock
93
pubspec.lock
|
|
@ -15,6 +15,27 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
cached_network_image:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: cached_network_image
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.2.0"
|
||||
cached_network_image_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: cached_network_image_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
cached_network_image_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: cached_network_image_web
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -97,6 +118,20 @@ packages:
|
|||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_blurhash:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_blurhash
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.6.0"
|
||||
flutter_cache_manager:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_cache_manager
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.3.0"
|
||||
flutter_lints:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
|
|
@ -231,6 +266,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
octo_image:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: octo_image
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -301,6 +343,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.4"
|
||||
pedantic:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pedantic
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.11.1"
|
||||
petitparser:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -350,6 +399,20 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.7.33"
|
||||
rxdart:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: rxdart
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.27.3"
|
||||
skeleton_text:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: skeleton_text
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.0"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
|
|
@ -362,6 +425,20 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.1"
|
||||
sqflite:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: sqflite
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
sqflite_common:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: sqflite_common
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -383,6 +460,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
synchronized:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: synchronized
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.0"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -404,6 +488,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
uuid:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: uuid
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.5"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -433,5 +524,5 @@ packages:
|
|||
source: hosted
|
||||
version: "5.3.1"
|
||||
sdks:
|
||||
dart: ">=2.14.0 <3.0.0"
|
||||
dart: ">=2.15.0 <3.0.0"
|
||||
flutter: ">=2.5.0"
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ dependencies:
|
|||
path_provider: ^2.0.8
|
||||
flutter_spinkit: ^5.1.0
|
||||
flutter_svg: ^1.0.0
|
||||
cached_network_image: ^3.2.0
|
||||
skeleton_text: ^3.0.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
|
|
|||
Loading…
Reference in New Issue