import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:tsacdop/class/importompl.dart'; class Import extends StatelessWidget { @override Widget build(BuildContext context) { return Consumer( builder: (_, importOmpl, __) => Container( color: Theme.of(context).primaryColorDark, child: importOmpl.importState == ImportState.start ? Column( mainAxisAlignment: MainAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ SizedBox(height: 2.0, child: LinearProgressIndicator()), Container( padding: EdgeInsets.symmetric(horizontal: 20.0), height: 20.0, alignment: Alignment.centerLeft, child: Text('Read file successful'), ), ]) : importOmpl.importState == ImportState.import ? Column( mainAxisAlignment: MainAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ SizedBox(height: 2.0, child: LinearProgressIndicator()), Container( height: 20.0, padding: EdgeInsets.symmetric(horizontal: 20.0), alignment: Alignment.centerLeft, child: Text('Connetting: ' + (importOmpl.rsstitle))), ], ) : importOmpl.importState == ImportState.parse ? Column( mainAxisAlignment: MainAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ SizedBox( height: 2.0, child: LinearProgressIndicator()), Container( height: 20.0, padding: EdgeInsets.symmetric(horizontal: 20.0), alignment: Alignment.centerLeft, child: Text('Fetch data: ' + (importOmpl.rsstitle)), ), ], ) : importOmpl.importState == ImportState.error ? Column( mainAxisAlignment: MainAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ SizedBox( height: 2.0, child: LinearProgressIndicator()), Container( height: 20.0, padding: EdgeInsets.symmetric(horizontal: 20.0), alignment: Alignment.centerLeft, child: Text('Error: ' + (importOmpl.rsstitle)), ), ], ) : Center()), ); } }