-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* loading indicator update (cherry picked from commit c572c5a)
- Loading branch information
Showing
5 changed files
with
74 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,61 @@ | ||
import 'package:adhara/constants.dart'; | ||
import 'package:adhara/resources/r.dart'; | ||
import 'package:adhara/styles/text_styles.dart'; | ||
import 'package:adhara/widgets/no_data.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
import '../resources/r.dart'; | ||
import '../styles/text_styles.dart'; | ||
import 'no_data.dart'; | ||
|
||
class Fetching extends NoData { | ||
final String text; | ||
final Widget bottom; | ||
final TextStyle textStyle; | ||
final String assetPath; | ||
|
||
Fetching( | ||
{Key key, | ||
this.bottom, | ||
this.text: "Loading...", | ||
this.textStyle: AdharaStyles.textMuted, | ||
this.assetPath}) | ||
: super(key: key); | ||
Fetching({ | ||
Key key, | ||
this.bottom, | ||
this.text: "Loading...", | ||
this.textStyle: AdharaStyles.textMuted, | ||
this.assetPath | ||
}) : super(key: key); | ||
|
||
Widget getTop(r){ | ||
String _assetPath = assetPath ?? r.config.fromFile['fetchingImage']; | ||
if(_assetPath == null) return Container(); | ||
return Container( | ||
width: 120.0, | ||
child: Center(child: Image.asset(_assetPath)), | ||
); | ||
} | ||
|
||
Widget getCenter(){ | ||
if(text == null) return Container(); | ||
return Text( | ||
text, | ||
style: textStyle, | ||
textAlign: TextAlign.center, | ||
); | ||
} | ||
|
||
Widget getBottom(Resources r){ | ||
return SizedBox( | ||
width: 100.0, | ||
child: Padding( | ||
padding: const EdgeInsets.symmetric(vertical: 8.0), | ||
child: r.config.fetchingIndicator==ConfigValues.FETCHING_INDICATOR_CIRCULAR?CircularProgressIndicator():LinearProgressIndicator(), | ||
), | ||
); | ||
} | ||
|
||
@override | ||
Widget buildWithResources(BuildContext context, Resources r) { | ||
String _assetPath = assetPath ?? | ||
r.config.fromFile['fetchingImage'] ?? | ||
"assets/animations/fetching.gif"; | ||
return Center( | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
Container( | ||
width: 120.0, | ||
child: Center(child: Image.asset(_assetPath)), | ||
), | ||
bottom ?? text != null | ||
? Text( | ||
text, | ||
style: textStyle, | ||
textAlign: TextAlign.center, | ||
) | ||
: Container(), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
getTop(r), | ||
getCenter(), | ||
getBottom(r) | ||
])); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name: adhara | ||
description: Base framework for Flutter Apps with intense networking and data interactivity | ||
version: 0.1.63 | ||
version: 0.1.64 | ||
author: Rohit R. Abbadi <[email protected]> | ||
homepage: https://infitio.com | ||
|
||
|