Skip to content

Commit 0138d20

Browse files
authored
Merge pull request #38 from Restfulness/ui
Update UI
2 parents 28b9290 + e6693fe commit 0138d20

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1770
-119
lines changed

.github/workflows/ci_build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
java-version: '12.x'
1616
- uses: subosito/[email protected]
1717
with:
18-
flutter-version: '1.26.x'
1918
channel: 'dev'
2019
- run: flutter pub get
2120
- run: flutter test

.github/workflows/ci_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ jobs:
1515
java-version: '12.x'
1616
- uses: subosito/[email protected]
1717
with:
18-
channel: 'stable'
18+
channel: 'dev'
1919
- run: flutter pub get
2020
- run: flutter test

lib/main.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import 'src/app.dart';
77
import 'src/config/app_config.dart';
88
import 'package:sqflite_common_ffi/sqflite_ffi.dart';
99
import 'package:sqflite/sqflite.dart';
10-
10+
import 'package:window_size/window_size.dart';
1111

1212
void main() {
1313
if (Platform.isWindows || Platform.isLinux) {
@@ -16,6 +16,12 @@ void main() {
1616
// Change the default factory
1717
databaseFactory = databaseFactoryFfi;
1818
}
19+
WidgetsFlutterBinding.ensureInitialized();
20+
if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
21+
setWindowTitle('Restfulness');
22+
setWindowMaxSize(const Size(480, 800));
23+
setWindowMinSize(const Size(480, 800));
24+
}
1925
AppConfig(
2026
flavor: Flavor.DEV,
2127
color: primaryColor,

lib/src/app.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:flutter/material.dart';
2+
import 'package:responsive_framework/responsive_framework.dart';
23
import 'package:restfulness/src/blocs/category/categories_provider.dart';
34
import 'package:restfulness/src/blocs/reset_password/reset_password_provider.dart';
45
import 'package:restfulness/src/blocs/social/social_provider.dart';
@@ -20,6 +21,18 @@ class App extends StatelessWidget {
2021
child: SocialProvider(
2122
child: CategoriesProvider(
2223
child: MaterialApp(
24+
builder: (context, widget) => ResponsiveWrapper.builder(
25+
BouncingScrollWrapper.builder(context, widget),
26+
maxWidth: 1200,
27+
minWidth: 420,
28+
defaultScale: true,
29+
breakpoints: [
30+
ResponsiveBreakpoint.resize(420, name: MOBILE),
31+
ResponsiveBreakpoint.autoScale(800, name: TABLET),
32+
ResponsiveBreakpoint.autoScale(1000, name: TABLET),
33+
ResponsiveBreakpoint.resize(1200, name: DESKTOP),
34+
],
35+
background: Container(color: Color(0xFFF5F5F5))),
2336
title: 'Restfulness',
2437
debugShowCheckedModeBanner: false,
2538
theme: ThemeData(

lib/src/screens/home_screen.dart

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -81,35 +81,35 @@ class HomeScreenState extends State<HomeScreen> {
8181
}
8282

8383
Widget buildAddBar() {
84+
double cWidth = MediaQuery.of(context).size.width;
85+
8486
return Align(
8587
alignment: Alignment.topCenter,
8688
child: Row(
8789
children: [
88-
Expanded(
89-
child: Container(
90-
margin: EdgeInsets.fromLTRB(11, 15, 0, 15),
91-
child: Material(
92-
elevation: 6.0,
93-
borderRadius: BorderRadius.circular(30),
94-
child: _buildAddField(context),
95-
),
96-
height: 50,
97-
width: double.infinity,
90+
Container(
91+
height: 50,
92+
width: cWidth * 0.77,
93+
margin: EdgeInsets.fromLTRB(11, 15, 0, 15),
94+
child: Material(
95+
elevation: 6.0,
96+
borderRadius: BorderRadius.circular(30),
97+
child: _buildAddField(context),
9898
),
99-
flex: 4,
10099
),
101-
Expanded(
100+
Container(
101+
height: 50,
102+
width: cWidth * 0.20,
102103
child: MaterialButton(
103104
onPressed: () async {
104105
addLink();
105106
},
106107
elevation: 8.0,
107108
color: primaryColor,
108109
child: _buildButtonIcon(),
109-
padding: EdgeInsets.all(14.0),
110+
padding: EdgeInsets.all(15.0),
110111
shape: CircleBorder(),
111112
),
112-
flex: 1,
113113
),
114114
],
115115
),
@@ -216,21 +216,21 @@ class HomeScreenState extends State<HomeScreen> {
216216
builder: (context, snapshot) {
217217
if (!snapshot.hasData) {
218218
if (isPreview) {
219-
return LinkListWidget(key: _keyPreviewList ,screenName:
220-
this.runtimeType);
219+
return LinkListWidget(
220+
key: _keyPreviewList, screenName: this.runtimeType);
221221
} else {
222-
return LinkListSimpleWidget(key: _keySimpleList,screenName:
223-
this.runtimeType);
222+
return LinkListSimpleWidget(
223+
key: _keySimpleList, screenName: this.runtimeType);
224224
}
225225
}
226226
if (isPreview) {
227227
_keyPreviewList.currentState.setCardList(snapshot.data);
228-
return LinkListWidget(key: _keyPreviewList,screenName:
229-
this.runtimeType);
228+
return LinkListWidget(
229+
key: _keyPreviewList, screenName: this.runtimeType);
230230
} else {
231231
_keySimpleList.currentState.setList(snapshot.data);
232-
return LinkListSimpleWidget(key: _keySimpleList,screenName:
233-
this.runtimeType);
232+
return LinkListSimpleWidget(
233+
key: _keySimpleList, screenName: this.runtimeType);
234234
}
235235
},
236236
);
@@ -254,7 +254,6 @@ class HomeScreenState extends State<HomeScreen> {
254254

255255
void addLinkShare(LinksBloc bloc) async {
256256
if (_getUrlFromString(_sharedText) != '') {
257-
258257
List<String> tags = new List<String>();
259258
tags.add("untagged");
260259

@@ -265,15 +264,13 @@ class HomeScreenState extends State<HomeScreen> {
265264
tags, _validateUrl(_getUrlFromString(_sharedText)));
266265

267266
if (id != null) {
268-
269267
bloc.fetchLinkById(id);
270268

271269
ToastContext(context, "Link successfully added ", true);
272270

273271
// get new categories if we have new one
274272
final categoriesBloc = CategoriesProvider.of(context);
275273
categoriesBloc.fetchCategories();
276-
277274
}
278275
} catch (e) {
279276
if (JsonUtils.isValidJSONString(e.toString())) {

lib/src/widgets/animated/card_tile_widget.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ class _CardTileWidgetState extends State<CardTileWidget>
292292
controller3.forward();
293293
setState(() {
294294
selectedState = 2;
295-
share = true;
295+
openUrl = true;
296296
backX = true;
297297
});
298298
}
@@ -322,8 +322,8 @@ class _CardTileWidgetState extends State<CardTileWidget>
322322
setState(() {
323323
selectedState = 3;
324324
remove = false;
325-
openUrl = true;
326-
share = false;
325+
openUrl = false;
326+
share = true;
327327
animationTop = true;
328328
animationZero = false;
329329
backX = false;

lib/src/widgets/animated/icon_animation_widget.dart

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ class _IconAnimationState extends State<IconAnimation>
5252
animatable: Tween<double>(begin: 0.0, end: 34.0),
5353
from: Duration(milliseconds: 80),
5454
to: Duration(milliseconds: 200),
55-
tag: 'share')
55+
tag: 'open')
5656
.addAnimatable(
5757
animatable: Tween<double>(begin: 0.0, end: 34.0),
5858
from: Duration(milliseconds: 200),
5959
to: Duration(milliseconds: 300),
60-
tag: 'open')
60+
tag: 'share')
6161
.animate(_sequenceAnimationController);
6262
_sequenceAnimationController.addListener(() {
6363
setState(() {});
@@ -135,8 +135,8 @@ class _IconAnimationState extends State<IconAnimation>
135135
_sequenceAnimationController.forward();
136136
setState(() {
137137
_firstAnimationValueX = _sequenceAnimation['trash'].value;
138-
_secondAnimationValueX = _sequenceAnimation['share'].value;
139-
_thirdAnimationValueX = _sequenceAnimation['open'].value;
138+
_secondAnimationValueX = _sequenceAnimation['open'].value;
139+
_thirdAnimationValueX = _sequenceAnimation['share'].value;
140140
});
141141

142142
// Share Icon Animation
@@ -191,8 +191,8 @@ class _IconAnimationState extends State<IconAnimation>
191191
setState(() {
192192
_rightAnimationIsCompleted = false;
193193
_firstAnimationValueX = _sequenceAnimation['trash'].value;
194-
_secondAnimationValueX = _sequenceAnimation['share'].value;
195-
_thirdAnimationValueX = _sequenceAnimation['open'].value;
194+
_secondAnimationValueX = _sequenceAnimation['open'].value;
195+
_thirdAnimationValueX = _sequenceAnimation['share'].value;
196196
});
197197
}
198198

@@ -254,11 +254,11 @@ class _IconAnimationState extends State<IconAnimation>
254254
left: _secondAnimationValueX,
255255
child: Container(
256256
decoration: BoxDecoration(
257-
color: Colors.blue,
257+
color: Colors.orange,
258258
borderRadius: BorderRadius.circular(15.0),
259259
boxShadow: [
260260
BoxShadow(
261-
color: Colors.blue.withOpacity(0.2),
261+
color: Colors.orange.withOpacity(0.2),
262262
blurRadius: 1.0,
263263
spreadRadius: 1.5,
264264
offset: Offset.zero,
@@ -268,7 +268,7 @@ class _IconAnimationState extends State<IconAnimation>
268268
width: _iconsCircleSize,
269269
height: _iconsCircleSize,
270270
child: Icon(
271-
MdiIcons.shareVariantOutline,
271+
MdiIcons.earth,
272272
size: _whiteIconSize,
273273
color: Colors.white,
274274
),
@@ -280,11 +280,11 @@ class _IconAnimationState extends State<IconAnimation>
280280
left: _thirdAnimationValueX,
281281
child: Container(
282282
decoration: BoxDecoration(
283-
color: Colors.orange,
283+
color: Colors.blue,
284284
borderRadius: BorderRadius.circular(15.0),
285285
boxShadow: [
286286
BoxShadow(
287-
color: Colors.orange.withOpacity(0.2),
287+
color: Colors.blue.withOpacity(0.2),
288288
blurRadius: 2.0,
289289
spreadRadius: 1.5,
290290
offset: Offset.zero,
@@ -294,7 +294,7 @@ class _IconAnimationState extends State<IconAnimation>
294294
width: _iconsCircleSize,
295295
height: _iconsCircleSize,
296296
child: Icon(
297-
MdiIcons.earth,
297+
MdiIcons.shareVariantOutline,
298298
size: _whiteIconSize,
299299
color: Colors.white,
300300
),

lib/src/widgets/link_preview_widget.dart

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -133,24 +133,24 @@ class LinkPreviewWidget extends StatelessWidget {
133133
],
134134
),
135135
Positioned(
136-
child: ButtonTheme(
137-
minWidth: 0.5,
138-
height: 0.5,
139-
child: MaterialButton(
140-
onPressed: () {
136+
child: ClipOval(
137+
child: Material(
138+
color: primaryLightColor, // button color
139+
child: InkWell(
140+
splashColor: secondaryTextColor, // inkwell color
141+
child: SizedBox(width: 25, height: 25, child:Icon(
142+
MdiIcons.plus,
143+
color: Colors.white,
144+
)),
145+
onTap: () {
141146
UpdateCategoryWidget update = new UpdateCategoryWidget();
142147
update.updateCategory(context, id, category);
143148
},
144-
elevation: 1,
145-
color: primaryLightColor,
146-
child: Icon(
147-
MdiIcons.plus,
148-
color: Colors.white,
149-
),
150-
shape: CircleBorder()),
149+
),
150+
),
151151
),
152-
bottom: -4,
153-
right: -8,
152+
bottom: 5,
153+
right: 8,
154154
)
155155
],
156156
),

lib/src/widgets/lists/link_list_simple_widget.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class LinkListSimpleWidgetState extends State<LinkListSimpleWidget> {
105105
child: child,
106106
onRefresh: () async {
107107
linksBloc.resetLinks();
108-
page = 0;
108+
page = firstPage;
109109
await linksBloc.fetchLinks(firstPage, firstPageSize);
110110
},
111111
);

lib/src/widgets/lists/link_list_widget.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ class LinkListWidgetState extends State<LinkListWidget>
310310
child: child,
311311
onRefresh: () async {
312312
linkBloc.resetLinks();
313-
page = 0;
313+
page = firstPage;
314314
await linkBloc.fetchLinks(firstPage, firstPageSize);
315315
},
316316
);

0 commit comments

Comments
 (0)